This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: CMPA writing PRD value consequence

Part Number: TMS320F28377D


Hi.

Suppose in EPWM module my PRD value  of a counter is 3000 and I am using up-down counter mode. The settings for Action-Qualifier (AQ) module are: CAU = AQ_SET, CAD = AQ_CLEAR (when counter is going up PWM goes high when the value from CMPA is met, when counter goes down PWM goes low when CMPA value is met). So my question what happens if I write to CMPA the value of PRD (in my case it's 3000)? At this point I suppose two events take place at the same time. Accoring to priority level tabel "Counter equals CMPA on up-count (CAU)" has the highest priority, so I expect that PWM would go high. However when I did the test on oscilloscope I observe that my PWM output is always low. Could you please clarify what exactly happens in my case?

Best regards!





  • Hello,

    If you set CMPA equal to the period value,  you need to look at the "TBCTR is Decrementing" use-case. Notice in the figure below that once the period is reached that is considered counting down not counting up. In which case, the "Counter equals CMPA on down-count (CAD)" event will take place- the CLEAR action. 

    Best Regards,

    Marlyn