cancel
Showing results for 
Search instead for 
Did you mean: 

Is this a bug ?

craig239955_st
Associate II
Posted on March 23, 2007 at 05:02

Is this a bug ?

1 REPLY 1
craig239955_st
Associate II
Posted on May 17, 2011 at 09:40

Hi ,

After powering up (or hardware reset) I init the TIM0 and TIM2 in TIM_PWMI mode to count external pulses and to have the posibility to reset the counter with an external signal.

The first time I read the timer counter register, I get a value 0xFFFC (the reset value).

After applying a pulse on the external clock, I still get the same Countervalue, same for pulse 2,3 and 4.

After the 5th pulse, the counter value increments to 0xFFFD.

from that moment, the counter counts every pulse, even when setting it to zero by applying a pulse on the ICAP1 input, the counter starts counting the first pulse.

When I apply this ICAP1 pulse immediatly after initialisation at powerup, the counter value becomes zero, but it stays zero for the next 4 pulses.

So, it seems that the counter does not count the first 4 or 5 pulses after a hardware reset.

Is there a workaround for this ? for example first init the counter to count internal clock and then redirect it to count external pulses ?

I hope I am clear enough, because English is not my native ..

Thanks

Luc Vercruysse