Is there a way to count pulses with a frequency higher than the MCU-clock without prescaler? (STM32L0)
Dear all,
I am quite new to the STM32-verse but need to work on a project using an STM32L0 (if possible the L081KZ) to count pulses. The pulses are generated by a clock (~2Mhz) and a gate / AND with an other signal. So there are some pulses with 2Mhz and then a long time nothing and again some pulses… I need to count how many of these short pulses there are per time interval. Because of power constrains I would like to use 1Mhz or less as clock and later implement the sleep-mode.
Therefore I wanted to use two timers:
- the LPTIM with an external oscillator to generate the time interval (and later to wake up the MCU)
- a TIM to count the pulses
(or vice versa)
I tried a bit and found that I cant count pulses with a frequency higher than ~0.5 of the system clock. In the AN47776 “generalpurpose-timer-cookbook�? I found something regarding this and on page 21 a disconcerting part that I must use a prescaler with the ETR (mode 2) input to count frequencies higher than the clock…
This is not feasible since I need to measure low counts 0.1Hz to 2MHz and cant wait so long until I have enough pulses measured due to the prescaler.
So… is there any way to use a timer as a simple counter where I can read out the register? Disable this synchronization stage which implements these clock constrains, or some other way?
Thanks for your help and best wishes
Tobias
