TIDUD61E October 2020 – April 2021
The CPU utilization can be monitored by toggling GPIOs and capturing the waveforms using oscilloscope. Each ISR includes profiling functions that set GPIO pin high at the beginning of ISR and set GPIO pin low at the end of ISR. However, this method is no longer accurate when ISRs are nested.
To overcome the drawback of the oscilloscope-based method, XBAR and ECAP module are utilized to capture the toggling instant of GPIOs and MCU calculates ISR loading that accommodates nesting. Furthermore, this method provides ISR loadings directly on watch window and therefore, oscilloscope is not required. ISR1(100 kHz) is designed for inner current loop control. The outer voltage loop and instrumentations are implemented on ISR2(10 kHz). ISR1 and ISR2 loadins are presented in TTPLPFC_ISR1_LoadingMax and TTPLPFC_ISR2_LoadingAvg_accountingForNesting respectively. Figure X captures the watch window in and when controls are running on CPU.
ISR loadings with advanced options enabled (phase shedding, adaptive dead time, non-linear loop, SFRA) can be measured in the same way by configuring main.syscfg. The ISR loadings for the worst case scenarios were captured in the table
ISR1 (100 kHz) |
ISR2 (10 kHz) |
|
CPU utilization (Advanced options: All Off) |
53% |
6 % |
CPU utilization (Advanced options: All On) |
65% |
9% |
The total CPU usage is approximately 59 % without advanced options. If all the advance options are enabled, the total CPU usage is about 74 %. With the CLA option, the CPU burden is reduced to 0% when both ISRs are offloaded to the CLA. The worst case ISR loadings on CLA is shown in the table
ISR1 (100 kHz) |
ISR2 (10 kHz) |
|
CLA utilization (Advanced options: All Off) |
57 % |
9 % |
CLA utilization (Advanced options: All On) |
79% |
12 % |
The advanced options obviously increase CPU usage due to additional computations. Other than that, the compiler optimization level, phase lock loop (PLL) method for grid synchronization also impact the CPU usage. The ISR loadings on Table x and y are captured with NOTCH SPLL (#define SPLL_METHOD_SELECT SPLL_1PH_NOTCH_SEL) and the compiler optimization level is 3. The reference for code optimization can be found at C2000™ C28x Optimization Guide.
The memory allocation is shown in Figure 3-8