Page 1 of 1

Pulse Counting

Posted: Wed Jun 18, 2014 1:18 am
by estutzenberger
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

Re: Pulse Counting

Posted: Wed Jun 18, 2014 9:02 am
by Giovanni
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