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.

TMS320F2812 PWM generation



Hello.

Start to work with this processor and some questions appeared

1)What is the difference between CMPRx and TxCMPR registers, first of them set compare value which constantly compared with the value of the timer counter, but purpose of TxCMPR is unknown.And TxCNT is the value of timer counter?

2)The width of the PWM pulse sets by CMPR and  remain unchanged until the end of the period.But I need to change widht before the end of the period happens. In other words i would  like to get similar picture:

Thanks.

  • I believe 2812 has the first generation PWM modules in EV blocks. You will be better off using the latest generation peripherals found in 280xxx family of devices. Please check ePWM manual - ePWM blocks offer much more flexibility and should be able to create your waveforms.

  • But still using 2812 can i create like this waveforms?

  • Well, first generation EV based PWM blocks don't have two compares and therefore it will be difficult to generate off centered waveform. You may create something similar by combining simple coompare PWM outputs with EV PWM outputs but frankly I haven't tried it so am not able to confirm one way or other ... sorry.

  • Well, will try to do something with this proccesor.But another question came,how to synchronize GPTimer 1in EVA block  and GPtimer3 in EVB block (i mean that EVA block starts first and then after a while EVB block starts), and is it possible to do this?

  • As far as I can remember ... there is no way to synchornize using internal hardware .... you will need to sync using software which in most cases is okay ... only the latest e-modules offer hardware synchronization using syncIn and syncOut signals.

  • Thank you,but could you tell me how i can get waveforms like this:

  • Well, I am sure there multiple ways to generate your waveform ... one of the straight forward ways is to utilize PDPINT .... use the software bit to activate PDPINT to turn-off PWM outputs ... I don't remember various modes of PDPINT of 2812 but if you don't need super accuracy on turn off and turn ON time of your waveform then PDPINT should be a viable option.

  • If I understand correctly, there are 2 PDPINT (A and B), but  i need to get 3 such waveforms on only one EV block,because the other one is busy

  • I am trying to disable PWM outputs of Timer1, when compare interrupts on Timer2 happens.And there is question: when i use symmetric PWM waveforms, in the first time when compare match happen,appropriate bit of interrupt register set to 1, and what happens on the second compare match, interrupt bit set to 0?