Ok, great! So do you need to measure the frequency of every pulse, or just the amount of pulses in a minute (for instance)?
The nRF52832 doesn't have any timers (except the 32kHz real-time clock) that run when the device is in low-power mode, which makes the first option more difficult. I think at the moment we have:
Count the number of pulses, and then check every so often - very low power
Loop the comparator to an output pin, physically join that to another pin, and use setWatch on that to count using JavaScript and the RTC.
I've asked on Nordic's support site if there's another option - it might be possible to use the RTC to increment a timer 32k times a second.
Personally, if it's good enough, I think pulse counting would be the simplest and lowest power option.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, great! So do you need to measure the frequency of every pulse, or just the amount of pulses in a minute (for instance)?
The nRF52832 doesn't have any timers (except the 32kHz real-time clock) that run when the device is in low-power mode, which makes the first option more difficult. I think at the moment we have:
setWatch
on that to count using JavaScript and the RTC.I've asked on Nordic's support site if there's another option - it might be possible to use the RTC to increment a timer 32k times a second.
Personally, if it's good enough, I think pulse counting would be the simplest and lowest power option.