Dear all,
I have encountered a problem when implementing PWM using TMS28335.
I want to output the following waveform in one period ( i.e. low----->high----->low)
----------------
| |
| |
---------- ------------------
but in the next period I want the waveform to be ( i.e. high----->low------->high):
------------ ---------------------
| |
| |
----------------
The PWM output can be any of the two kinds of waveforms shown above.
For the first case:
EPwm1Regs.AQCTLA.all= 0x60; // CAD clear (01) CAU set (10) [CBD CBU CAD CAU PRD ZRO]
For the second case:
EPwm3Regs.AQCTLA.all= 0x90; // CAD set (10) CAU clear (01) [CBD CBU CAD CAU PRD ZRO]
They both work well in seperate mode, but if I operate them dynamically (case 1, case 2, case 2, case 1 ...), the output is incorrect.
p.s. the timer period is fixed and up-down-count mode is assumed. The compare registers are correctly updated, so I guess there may be something wrong with the action qualifier setting.
Any ideas or comments are welcome!