SDAA111 October 2025 CC2340R5
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.