I use the CLA to updata the CMPA Reg in ePWM model. and i seem have some problem to do this.
first i set up the cla like this to use the EPWM1INT to trigger the task1 of the CLA
Cla1Regs.MVECT1 = (Uint16) (&Cla1Task1 - &Cla1Prog_Start)*sizeof(Uint32); Cla1Regs.MPISRCSEL1.bit.PERINT1SEL = CLA_INT1_EPWM1INT; Cla1Regs.MMEMCFG.bit.PROGE = 1; Cla1Regs.MMEMCFG.bit.RAM1E = 1; Cla1Regs.MMEMCFG.all = CLA_PROG_ENABLE|CLARAM0_ENABLE|CLARAM1_ENABLE|CLARAM2_ENABLE|CLA_RAM1CPUE; Cla1Regs.MCTL.bit.IACKE = 1; Cla1Regs.MIER.all = (M_INT8 | M_INT7 | M_INT1);// Enable Task 7 and Task 1
and then I set up the ePWM model for INT signal like below
EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event EPwm1Regs.ETSEL.bit.INTEN = PWM1_INT_ENABLE; // Enable INT EPwm1Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event EPwm1Regs.ETCLR.bit.INT = 1;
and i`ve also setup the EPWMCFG.bit.CONFIG Reg.
in the CLA task1 i use the code in asm like this
_Cla1Task1: MNOP MNOP MDEBUGSTOP ;Clear EPWM Flag if PWM1 triggers the CLA task MMOVXI MR0,#0x01 MMOV16 @_EPwm1Regs.ETCLR, MR0 MMOV32 @_EPwm1Regs.CMPA, MR0 MNOP MNOP MSTOP MNOP MNOP MNOP _Cla1T1End:
when I debug my program i cannot get to the debugstop in task1.but i can get to the debugstop of other task. and the value of EPwm1Regs.CMPA don`t change at all.
please help me with any kind of language. i can find to little material in Chinese. so i come here.
Thanks a lot.