AnsweredAssumed Answered

Timer counting too fast in input capture

Question asked by John Hite on Mar 17, 2017
Latest reply on Mar 20, 2017 by John Hite

Device: STM32F437

 

My timer seems to count twice as fast as I think it should. My peripheral clock is running @ 42MHz and I have scaled it down to 1 KHz. I got things started and interrupts going thanks to help from JW but I noticed the count seemed wrong. The external capture event occurs every 1 second and with the clock at 1 KHz I read the count a total of 10 times . I expected the count to to go up by 1000. With TIM_Period set to 0xFFFF I read a delta of 2000 each time. A code snippet is below and the detection is set for rising edge so it seems I should capture once a second and there should be a count of 1000 in the CNT register.

 

Thanks,

jh

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Outcomes