SDAA111 October   2025 CC2340R5

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 CC2340R5
    2. 1.2 Stepper motor
  5. 2Stepper Motor Hardware
    1. 2.1 Hardware setup
    2. 2.2 DRV8411EVM settings
    3. 2.3 Connection Diagram
  6. 3Running the Example
    1. 3.1 Dependencies
    2. 3.2 Loading Firmware
    3. 3.3 Local Stepper Motor Control
    4. 3.4 Remote Control Using Proprietary RF
  7. 4Firmware Design
    1. 4.1 Code Flow Description
    2. 4.2 ADCBuf
    3. 4.3 Power
    4. 4.4 Application Events
    5. 4.5 Step Table
    6. 4.6 Fault Detection Pin
  8. 5Tests and Results
  9. 6Summary
  10. 7References

ADCBuf

The default ADCBuf operates on a single channel in repeated single mode. Since two continuous channel conversions are warranted for this application, both VSEN_A and VSEN_B, a repeated sequence mode is used by adding a custom ADCBufLPF3.c to the project's main directory. This transfers data through the ADC peripheral's FIFO instead of a single memory register.

The original TI Driver also chooses to begin subsequent ADC conversions automatically. This is not suitable for the purposes of the stepper motor design which should take measurements a defined number of times per step. Therefore, the ADC is set to trigger conversions based on a LGPT trigger. The rate of ADC measurements per step is determined by the ADC_PER_STEP definition. As two measurements are taken each interval, ADC_SAMPLE_SIZE divided by two represents the frequency of ADC callbacks. This also is dependent on the amount of RAM available for increasing the ADC buffer.

The ADCBuf callback operation also includes status processing for the high interrupts of the window monitor which is initialized in the stepper_motor.c file. This way the application is notified of a high current event and can stop the motor immediately if triggered. The values have been adjusted and converted to microVolts by default using APIs included in the TI Driver.