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.

PWM action-qualifier settings in 28335



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!

  • To be more universal,

    I want to achieve four kinds of waveforms and they should be switched to others free, including

               ----------------

               |                    |

               |                    |

    ----------                   ------------------

               ----------------

               |                   

               |                    

    ----------                  

    ------------                       

                    |                      

                    |                       

                      ----------------

    ------------                        ---------------------

                    |                       |

                    |                        |

                      ----------------

        i.e.

    0------------>1---------------->0

    0-------------->1

    1---------------->0

    1------------------>0-------------->1

     

    How to set the action qualifier? Thanks in advance.