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.
hi
I am using up down mode counter. For CMPA, I am using SIN wave and CMPB has two different counter values are used (i.e. for positive half and negative half of SIN wave has different CMPB values) how can i update ePWM.......
Regards,
Anish
Anish,
On F28335 the action qualifier is not shadowed, so you will have to write the new CMPB settings from within an ISR aligned with the PWM pattern. One example is shown in the attached timing diagram. In this case a periodic interrupt is triggered by a zero match. The ISR would have to calculate which half-cycle you are in and set CMPB to the new value if necessaty. The "Td" time is the delay between the interrupt trigger and the CMPB register update. You'll have to ensure that the new CMPB value is written before the counter passes it, or the event will be missed that PWM cycle.
Newer devices (F2837x) shadow the AQ registers so doing this is a little easier.
Regards,
Richard
Anish,
Your ISR will have to compute the new CMPB value each time. I don't know exactly what you are doing so I can't really recommend any code examples.
If you haven't already done so I recommend browsing through the development kits and code examples in controlSUITE. There is a lot of material there and I'm confident you will find something close. Feel free to post back with more information about what you're doing if you don't find anything useful.
Regards,
Richard