Part Number: TMS320F28034
I am using the PWM5 counter simply to trigger interrupts used to update compare values for PWM1-4. PWM1-5 are all in up-down count mode. In order to get the timing right I need a phase offset for PWM5 relative to the other PWM. Currently I have a procedure that works:
- clear PCLKCR0[TBCLKSYNC]
- set up PWM registers, including TBPHS nonzero for PWM5
- set TBCTL[PHSEN] for PWM5
- set PWM1 TBCTL[SYNCOSEL] to 2 for sync output when counter = CMPB
- set PWM1 CMPB to 1
- set PWM2-5 TBCTL[SYNCOSEL] to 0 for pass through
- set PCLKCR0[TBCLKSYNC]
- set PWM1 TBCTL[SYNCOSEL] to 0 to disable sync output
This procedure does work: the counter of PWM5 is set to TBPHS as I expect, counting in the correct direction.
I have tried to use instead a software forced sync as a simpler alternative. As a test, I set TBCTL[SWFSYNC] for PWM2 immediately after setting PCLKCR0[TBCLKSYNC].
The software force did have the effect of setting PWM5 TBSTS[SYNCI], but it did not cause TBPHS to be loaded to TBCTR. This was a disappointment.
What am I missing with regard to software forcing PWM sync?