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

Code Flow Description

Figure 2-1 is a simple code block diagram of the processes used inside the CC2340R5 code. The functionality is realized in the stepper_motor.c file.

 Stepper Motor Code Diagram Figure 4-1 Stepper Motor Code Diagram

The main function initializes all TI drivers and timers necessary for the stepper motor example to operate. Once entering the main while loop, this can pend further action on an event being set by hardware callbacks. After servicing the corresponding action through a subroutine, the events are reset and the process repeats itself.

All hardware callbacks, with a few exceptions, simply post an event for the main application to process. An exception is the ADCBuf callback which processes the status immediately and does not call for any further action from the main application loop unless a window comparator threshold has been exceeded.