2017-04-18 10:11 PM
Dear All,
This is regarding the Timer 1 counter mode issue that we are facing with STM32F446RC microcontroller. We are trying to use F446 Timer 1 to count the external clock pulse by configuring timer 1 slave mode to External Clock Mode 1 with pulse input in TI1FP1 pin.
Here is the Configuration:
TIM1.SMCR = 0x57
TIM1.CCMR1 = 0x01
TIM1.CCER = 0x0B
TIM1.ARR =0x1388
TIM1.CR1 = 0x01
But the timer is start counting with internal clock when the input pulse is high and stop counting when the input is low. it's working similar to the gated mode configuration. But the expected behaviour is the timer should count the external pulse as it's configured to External Clock mode 1 and it's not working in F446 uC.
Here is the screen capture of TIMER 1 Register configuration debug window.
Same configuration is working fine with STM32F030 uC.
So please check and let us know, if there is any issue in our timer configuration.
Thanks,
Utpal
2017-04-19 03:38 AM
Register content looks good. Can you try with a different timer?
JW
2017-04-20 01:19 AM
Hi,
Thanks for your reply.
Can you please elaborate ?
Thanks,
Utpal
2017-04-20 02:08 AM
Try to use a different timer of the same mcu, with input on a different pin.
Are you sure the counting comes from internal clock source? Is the input signal stable in both its positive and negative portion? What happens if you set the input stage to react only on one edge instead of both?
JW