AnsweredAssumed Answered

Question regarding PWM

Question asked by obid.matic on Nov 14, 2015
Latest reply on Nov 16, 2015 by obid.matic

I'm using timer in PWM mode to control LED. If output is always 1 (CCR register is equal to ARR), LED is green. If output is 0 (CCR is always 0), LED is red. If I set duty cycle to 50% at high frequency, LED is orange. And if I increase a prescaler when duty cycle is 50%, I achieve visible toggling.

Now, I would like to achieve one more thing: When LED is constantly green, I would like to make it red for 200 ms when an error occurs and after that it should go back to green (CCR constantly equal to ARR). Of course, I would like to do that without looping in a while loop for 200 ms. Do you have any idea how to achieve that?

I am using F303.