Hi all,
I want to use Timer in counter mode, but I don't find how to config to use external clock for Timer. Please help me.
Thanks in advance.
External clock for timer
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: External clock for timer
Hi,
Currently the HAL does not have a driver that does that, you may use the timer directly at register level and use RCC/NVIC functions in order to enable the timer clocks/ISRs like the HAL drivers do.
Giovanni
Currently the HAL does not have a driver that does that, you may use the timer directly at register level and use RCC/NVIC functions in order to enable the timer clocks/ISRs like the HAL drivers do.
Giovanni
Re: External clock for timer
Giovanni wrote:Hi,
Currently the HAL does not have a driver that does that, you may use the timer directly at register level and use RCC/NVIC functions in order to enable the timer clocks/ISRs like the HAL drivers do.
Giovanni
Hi Giovanni,
Can you please explain this a little more, I seached a lot but couldn't find anything on using stm32f4 timers as pulse counters in ChibiOS.
Thank you
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: External clock for timer
kopanz wrote:Hi Giovanni,
Can you please explain this a little more, I seached a lot but couldn't find anything on using stm32f4 timers as pulse counters in ChibiOS.
Thank you
You should read the STM32 Reference Manual and program the timers accordingly at register level, ChibiOS is not directly related to this except for interrupts initialization.
If I remember well it is possible to use an external clock for timers, that clock line would be your input, the timer counter would increase on input fronts.
Giovanni
Re: External clock for timer
Giovanni wrote:kopanz wrote:Hi Giovanni,
Can you please explain this a little more, I seached a lot but couldn't find anything on using stm32f4 timers as pulse counters in ChibiOS.
Thank you
You should read the STM32 Reference Manual and program the timers accordingly at register level, ChibiOS is not directly related to this except for interrupts initialization.
If I remember well it is possible to use an external clock for timers, that clock line would be your input, the timer counter would increase on input fronts.
Giovanni
Thank you, this is more explanatory.