AnsweredAssumed Answered

Timer 3 PWM - strange behaviour on first pulse

Question asked by roofie01 on Feb 18, 2015
Latest reply on Feb 20, 2015 by roofie01

I am programming Timer 3 for PWM mode. Please see the attached image. The yellow trace is Timer 3, the green is Timer 4, which follows Timer 3 by a period of 180 degrees shift.
The top PWM train (Timer 3) seems to want to momentarily go high for about 100ms then low, and it doesn't agree with anything I am programming it for. There are supposed to be exactly 4 pulses at this frequency, which there are  - however, that first initial 100ms pulse is not supposed to be there. You can see that Timer 4 (green) follows Timer 3, including the initial pulse - which can be expected. I can post some code, but perhaps someone has experienced something like this before, or knows why it might be doing this. All the other pulses are perfectly fine, and behave exactly as expected.

If I insert a break right at the Timer 3 interrupt clear, the very first interrupt, before it's had a chance to process the interrupt, the scope trace shows the output pin for Timer 3 pin is HIGH, which does not make sense, as it's set as a "GPIO_PuPd_NOPULL", the same as Timer 4's pin, and that pin initializes and is low at the start.

It's a bit confusing as it doesn't appear to be related to the timer, but the pin configuration, yet both Timer 3 and 4 pins are configured exactly the same.

Any suggestions would be appreciated - thank you.