Hi,
We are working with a wind speed detection that simply presents pulses to the uC as it spins. Faster spinning == more pulses. Slower spinning == less pulses. For our application, we are taking a 1 minute average of the pulses. On the STM32, it is possible to set up one of the timer modules with an input capture pin as the clock source. I would like to implement this functionality under Chibi, but I am not sure which HAL module, if any, best supports this operation mode.
What would be the proper way to implement this functionality as described above?
Thanks!
Eric
Pulse Counting
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Pulse Counting
Hi,
There is not a specific module implementing a counter but I think it is easily implemented using the STM32 TIM timers. You could define your own "CNT" driver using the driver templates under ./os/hal/templates/meta
Giovanni
There is not a specific module implementing a counter but I think it is easily implemented using the STM32 TIM timers. You could define your own "CNT" driver using the driver templates under ./os/hal/templates/meta
Giovanni