Other Parts Discussed in Thread: C2000WARE
Hello support,
I'm reporting you an unexpected behavior of ePWM.
Setup:
SYSCLK = 200MHz
EPWMCLK = 200MHz (PERCLKDIVSEL.EPWMCLKDIV = 0)
setup pf ePWM1 and ePWM3
both configured in UP-DOWN mode
both configured with CLKDIV = 0 and HSPCLKDIV = 1 (total prescaler = 2) so that TBCLK = 100MHz
ePWM1 (AQCTLA) is configured to generate output A: HIGH on CMPA when counting UP, LOW on CMPB when counting UP
ePWM3 (AQCTLA) is configured to generate output A: HIGH on CMPA when counting DOWN, LOW on CMPB when counting DOWN
ePWMs are synced (ePWM1 provides the sync to ePWM3) and ePWM3 PRD reload is linked to ePWM1 (through EPWMXLINK.TBPRDLINK)
Here the issue:
ePWM1_A is generated as expected
on ePWM3_A is not generated, even if TBCTR is running and CMPA/CMPB/TBPRD hold the right values.
If I change (even in runtime during debug session) the value of ePWM3 HSPCLKDIV to ZERO, the ePWM3_A is generated (of course
with a frequency double as desired).
On the other hand, keeping CLKDIV = 0 and HSPCLKDIV = 1, if I change the AQCTLA configuration of ePWM3 as follows
HIGH on CMPA when counting UP, LOW on CMPB when counting UP
the signal ePWM3_A is generated.
Finally, if I set
- EPWMCLK = 100MHz (PERCLKDIVSEL.EPWMCLKDIV = 1),
- ePWM1/ePWM3 with CLKDIV = 0 and HSPCLKDIV = 0 (total prescaler = 1) so that TBCLK = 100MHz,
- ePWM1 (AQCTLA) configured to generate output A: HIGH on CMPA when counting UP, LOW on CMPB when counting UP
- ePWM3 (AQCTLA) configured to generate output A: HIGH on CMPA when counting DOWN, LOW on CMPB when counting DOWN
everithing works fine --> ePWM3_A is generated properly
It seems that there is a sort of incompatibility between
- setting of TBCLK different than EPWMCLK, and
- the behavior of ePWM when it is counting down.
Do you have any idea?
Maybe something could be missing is my configuration ?