External clock for timer

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
oattao
Posts: 9
Joined: Mon Dec 03, 2012 5:04 am

External clock for timer

Post by oattao »

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.
User avatar
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

Post by Giovanni »

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
kopanz
Posts: 9
Joined: Mon Jan 26, 2015 10:40 pm

Re: External clock for timer

Post by kopanz »

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
User avatar
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

Post by Giovanni »

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
kopanz
Posts: 9
Joined: Mon Jan 26, 2015 10:40 pm

Re: External clock for timer

Post by kopanz »

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.
Post Reply