TIDUES0E June 2019 – April 2024 TMS320F28P550SG , TMS320F28P550SJ , TMS320F28P559SG-Q1 , TMS320F28P559SJ-Q1
The DAB project consists of two ISRs (ISR1 and ISR2) with ISR1 being the fastest and non-nestable ISR. ISR1 is reserved for the control loop and the PWM update. ISR1 is triggered by the PRIM_LEG1_PWM_BASE → EPWM_INT_TBCTR_U_CMPC event.
The following are the defines related to this ISR:
#define DAB_ISR1_PERIPHERAL_TRIG_BASE DAB_PRIM_LEG1_PWM_BASE
#define DAB_ISR1_TRIG INT_EPWM1
#define DAB_ISR1_PIE_GROUP INTERRUPT_ACK_GROUP3
#define DAB_ISR1_TRIG_CLA CLA_TRIGGER_EPWM1INTISR2 is triggered by CPU Timer INT which is initiated by an overflow on CPU timer. ISR2 runs the slew rate function for commanded references.
#define DAB_ISR2_TIMEBASE CLLLC_TASKC_CPUTIMER_BASE
#define DAB_ISR2_TRIG INT_TINT2Additionally, CPU timers are used to trigger slow background tasks (these are not interrupt-driven but polled). "A" tasks are triggered at TASKA_FREQ, which is 100 Hz. The SFRA GUI must be called at this rate. One task, A1, is executed at this rate. "B" tasks are triggered at TASKB_FREQ, which is 10 Hz. These are used for some basic LED toggles and state machine items that are not timing-critical. Three tasks—B1, B2, and B3—are serviced by this.
Figure 4-6 illustrates the ISR software diagram.
Figure 4-6 Software DiagramDAB_pwmEPSAlphaPRef_pu, DAB_pwmEPSAlphaP_pu,
DAB_pwmEPSAlphaSRef_pu, DAB_pwmEPSAlphaS_pu,
DAB_pwmEPSPhaseShift_P1_P2_ticks,
DAB_pwmEPSPhaseShift_P1_S1_ticks and
DAB_pwmEPSPhaseShift_P1_S2_ticks are introduced. The functions
DAB_calculatePWMPhaseShift ticks and
DAB_HAL_ipdatePWMDutyPeriodPhaseShift() are modified
accordingly.