Support for Pulse Counter
Is support for the ESP32's built-in pulse counter (and specifically for counting pulses in deep-sleep mode) on the schedule?
John Baird last edited by
@jmarcelino Is it still the case that we cannot access the counter through Python? Or has a driver been written? I'm looking to monitor a system fan, but with as little overhead as possible. If I count the fan tachometer output and check it every so often, I should get a good idea of how it's going. The system is busy, so I don't want lots of interrupts happening and was hoping to take care of this in the already available hardware.
@jmarcelino Yep, I'm currently using an NXP PCF8593, which draws less than 8μA in counter mode and an I2C interface. I was just trying to see how much of the ESP32 I could use and how many external components I could eliminate. For now, this sounds like something for a future PCB revision.
jmarcelino last edited by jmarcelino
The best information are the examples in ESP-IDF:
As you can see very different things. Also ULP requires special assembly code, so I'm not sure how or when this will work in Python.
How about an external counter chip like the SN74LV8154 ?
That only requires about 20 μA active and 5 with the output off.
For more flexibility you can also use a small ultra low power microcontroller...
@jmarcelino I see. I was not able to find much information (in the ESP32 docs) about the pulse counter. I had assumed it used the ULP, but you're saying there's a different way to count pulses using the ULP (and not using the built-in pulse counter, if I need to do this in deep-sleep mode)? That's fine, but I guess that means that this item is waiting on ULP support, too.
What I'm needing to do is count pulses from a water flow meter while sleeping, then wake up periodically and get the read the count. Any thoughts on how to do that without ULP support?
jmarcelino last edited by
The Pulse counter is not available in deep sleep mode. You can however count pulses via the ULP and GPIO, but those are two very different implementations.