Hi Team,
For up or down counting mode, the ePWM frequency is given as TPWM = (TBPRD + 1) x TBCLK i.e. there is a factor of '+ 1' in the calculation. Should this +1 be considered in all the calculations i.e. CMPx and CMPxHR in case of high resolution?
Consider the example in the TRM for calculation of CMPA and CMPAHR register. It is mentioned that,
TBCLK = 10 ns (100 MHz)
PWM frequency = 1.25 MHz (1/800 ns)
Required PWM duty cycle, PWMDuty = 0.405 (40.5%)
PWM period in terms of coarse steps,PWMPeriod (800 ns/10 ns) = 80
This means that in case of up counting mode or down counting mode, the expected TBPRD value is 79. CMPA register = int((TBPRD + 1) * duty cycle) and CMPAHR = (frac(TBPRD + 1)*MEP_ScaleFactor + 0.5)
<<8);
Could you confirm my understanding is right?