cancel
Showing results for 
Search instead for 
Did you mean: 

Hi! I wonder if someone knows if I should be able to generate an interrupt at a value of the counter when I am in PWM1-mode? I.e.: TIM_ITConfig(TIM1, TIM_IT_CC1, ENABLE) together with TIM_OCInitStructure.TIM_Pulse = value; If possible, how!? Tomas

TBerg
Associate II
 
4 REPLIES 4

Yes, use whichever channel is available to set the phase of the count you're interested in.

TIM1->CCR4 = X, and enable the CC4 interrupt

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TBerg
Associate II

Hi Clive,

Ok, I think I was too short in my description..

I still want my pwms to work. What I look for is an overflow interrupt so that every pwm-channel maintains its dutycycle that I've set in the TIM1->CCR1 register. There is no free CCR-channel to use.

Very thankful for your effort!

BR

Tomas

TBerg
Associate II

Hi again,

Just want to post how the issue was solved.

I used the TIM1_UP_IRQHandler interrupt and configured it to generate an interrupt at each over- and underflow.

Thanks,

/Tomas

Khouloud GARSI
Lead II

Hi @TBerg​ ,

Thanks a lot for sharing the solution. For sure, this will be helpful for other users facing the same issue.

Khouloud.