cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use timer (TIM22) in STM32L031K6 to get interrupt on OC on channel 1 and generate PWM signal on channel 2?

noobmaster69
Associate III

In my application I want to use timer to turn on LED for around 300ms and simultaneously generate PWM signal of freq 2.7kHz (for buzzer) on PA10 pin. Is there any way I can achieve this?

(NOTE: I have already used TIM2 and TIM21 timers. TIM21 is also running at the same time as I trun on LED and buzzer)

No matter what configurations I set on channel 1, I always get around 400us wave as shown in screenshot below.

10 REPLIES 10

Yes. This was the case indeed.