SDAA075 October   2025 CC2340R5

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 CC2340R5
    2. 1.2 DRV8329A
    3. 1.3 BLDC Motor
  5. 2BLDC Hardware
    1. 2.1 Hardware Setup
      1. 2.1.1 DRV8329AEVM Settings
    2. 2.2 Connection Diagram
  6. 3Running the Example
    1. 3.1 Dependencies
    2. 3.2 Loading Firmware
    3. 3.3 Motor Connection Test
    4. 3.4 BLDC Motor Hall Sensored Trap Operation With Bluetooth® LE
      1. 3.4.1 SimpleLink™ Connect Phone Application
  7. 4Firmware Design
    1. 4.1 Code Flow Description
    2. 4.2 Customized TI Drivers
      1. 4.2.1 PWM
      2. 4.2.2 ADCBuf
      3. 4.2.3 Power
    3. 4.3 Application Events
    4. 4.4 Commutation Table
    5. 4.5 Motor Acceleration
    6. 4.6 ADC Operations
    7. 4.7 Spin Detect Feature
    8. 4.8 Reporting Statistics
    9. 4.9 Bluetooth® LE Stack
  8. 5Tests and Results
  9. 6Summary
  10. 7References

ADC Operations

Measuring all pertinent ADC channels with the one CC2340R5 ADC peripheral is a challenge considering that there are more ADC inputs (ADC_COUNT is five) than memory registers (four) and the need to measure the ISEN pin (motor current) at each PWM duty cycle output (thus at a rate of PWM_PERIOD/2). The implementation devised is to have the modified ADCBuf TI Driver, which utilizes ADC and DMA to quickly and efficiently fill an ADC buffer of size ADCSAMPLESIZE without interrupting the CPU, measure both ISEN and VSENPVDD (system voltage) continuously while occasionally interrupting this process to measure the remaining VSENA, VSENB, and VSENC ADC pins at a rate of ADC_INTERVAL. As a result, the number of ADC measurements per channel using ADCBuf is slightly lower than the PWM_PERIOD/2 due to the time and frequency of the single ADC measurements triggered every time the ADC_INTERVAL timer expires. As the ADCBuf driver has been configured to trigger the ADC from PWM LGPT activity, the driver does not take measurements while the motor is stopped. By contrast, the single ADC measurements are valid each time ADC_INTERVAL occurs regardless of motor activity.

A window monitor is also enabled on the ADC peripheral so that immediate action can be taken if the value of the latest ISEN measurement goes within or above the window limits to be further processed in adcBufCallback. If the value of WINDOW_LOW is surpassed, then an ADC callback status of ADC_INT_INIFG reduces the PWM duty cycle until the cycle goes lower than the window value. At which point, the ADC_INT_LOWIFG status returns the duty cycle to the original value. If WINDOW_HIGH is surpassed, then the ADC_INT_HIGHIFG status immediately stops the motor. Any ADC memory register can trigger the window monitor, but only one value for the low and high window thresholds can be set. Only ISEN is configured to use memory register two for which the window monitor is enabled, thus, only ISEN can trigger the window monitor. As ISEN switches between two ADC memory registers (zero and two), the window monitor evaluates ISEN at a rate of approximately 10kHz.

Whenever the ADC callback is triggered and not caused by the window monitor status, the ADC buffer has been filled. The application populates the outputBuffer array with the results of the ADC conversions and evaluates whether the motor needs to be stopped due to a received VSENPVDD ADC conversion surpassing VSEN_THRESHOLD. All conversions are 12-bit resolution (maximum value of 4096) and left in the raw format. Although additional processing APIs are available in the TI Drivers to further adjust these values and convert them to a µV format. Caution must be taken so that these processes do not interfere with the motor drive functions.