TIDUF56 January 2024
Figure 4-3 shows the general structure of the project. The device peripheral configuration is based on C2000Ware DriverLib and is generated using the SysConfig tool. The SysConfig tool also generates the clock settings and the linker command file. This enables easy migration using SysConfig. The design can be ported to a different C2000 MCU by changing the device settings in SysConfig and remapping the pin assignments, as necessary. The motor parameters, protection threshold and other settings can be changed in settings.h if migrating the reference design to a different motor or running the system at different conditions.
Figure 4-4 shows the project software flow diagram. The main C28x CPU initializes the device, global variables, calibrates the ADC offset, and finally initializes the FreeRTOS scheduler. Once the scheduler is initialized, the main CPU does not run any other tasks. All tasks thereafter are run in the FreeRTOS context. In this software, there are two FreeRTOS tasks that toggle two LEDs on the control board. One of the tasks also checks the fault status flags and resets them if clearFaults is enabled. Add more tasks as necessary. The motor control algorithm runs exclusively on the CLA, specifically in CLA task 1. Once configured, the CLA task is triggered by the ADC End of Conversion (EOC). Data exchange between CLA and CPU happens using the CPU-CLA or CLA-CPU message RAM or the shared data RAM.