SDAA116 October   2025 CC2340R5

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 CC2340R5
    2. 1.2 DRV8251A
    3. 1.3 BDC Motor
    4. 1.4 TMAG5213
  5. 2BDC Application
    1. 2.1 Hardware Setup
      1. 2.1.1 DRV8251AEVM Settings
    2. 2.2 Connection Diagram
  6. 3Running the Example
    1. 3.1 Dependencies
    2. 3.2 Loading Firmware
    3. 3.3 Zigbee Network Formation
  7. 4Firmware Design
    1. 4.1 Code Flow Description
    2. 4.2 LaunchPad Button Functionality
    3. 4.3 Non-Volatile Memory
    4. 4.4 Bidirectional PWM Motor Control
    5. 4.5 ADC Overcurrent Protection Feature
    6. 4.6 Hall-Effect Based Motor Position Tracking Feature with Configurable Endpoints
    7. 4.7 Logging Functionality
    8. 4.8 Interoperability with Third-Party Smart Hub Devices
  8. 5Tests and Results
    1. 5.1 PWM and Hall-effect Signal Analysis
    2. 5.2 Power Consumption Analysis with EnergyTrace™
  9. 6Summary
  10. 7References

ADC Overcurrent Protection Feature

In this BDC motor application, overcurrent protection (OCP) works by continuously monitoring current through ADC sampling of the VSENSE pin of the DRV8251A. The VSENSE pin outputs a voltage signal directly proportional to the current draw of the motor, providing real-time feedback on the electrical load of the motor. The CC2340R5's ADC periodically samples this voltage at one-millisecond intervals during motor operation, converting the analog VSENSE reading to a digital value that represents actual motor current. When this measured current exceeds the predefined ocpThreshold value, the protection mechanism immediately disables both PWM channels, stopping the motor before damage occurs. Possible causes of an overcurrent condition include a stalled motor, mechanical obstruction, or electrical fault. This implementation leverages the integrated current sensing capability of the DRV8251A, eliminating the need for external current sense resistors while providing accurate, responsive protection that safeguards both the motor and the mechanical system during operation in either direction. The implementation features a dedicated callback function that processes ADC samples and triggers the OCP functionality when necessary, which additionally logs the fault condition and increments a fault counter for diagnostic purposes.