AnsweredAssumed Answered

PWM Interrupts (help me!)

Question asked by Resinator on Jan 31, 2013
Latest reply on Feb 10, 2013 by Resinator

I am a power electronics engineer and I have been using the STM32F4 to develop AC motor drives and its great

I am now working on an application with space vector modulation and I have ran into a difficulty which I would love some advice on

For previous programs I could use an interrupt to update a count for timing applications and it was pretty straight forward

For my new program I need three PWM outputs center aligned which I can generate quite easily I can update the frequency and duty cycle but what I need to do is generate an interrupt on the carrier apex and I just don't know if I am barking up the right tree?

I can upload some code when I get in tonight but can anyone advise me if its feasable to use CCR1, CCR2 and CCR3 as the duty cycles of the different PWM outputs so I have three outputs from one timer and what I think would be great is if I could set CCR4 to the same value as the ARR register so that when the CNT is equal to CCR4 I know its the peak of the carrier but I just don't know how to generate an interrupt based on a CCR4 value is this possible? or is there another way to generate an interrupt on the carrier apex? all I can see changing in the registers is the DIR bit

I have been trying for about four days now and I have the manuals etc but I just cant see any useful info in there (it makes terrible reading IMO)

The other option would be to sync two timers together and use a separate timer to generate an interrupt but that seems like it shouldnt be needed?

Any help/advice is most welcome