Hi TinkerBearNZ ,TinkerBearNZ wrote: ↑Mon Jul 15, 2019 5:57 amWouldn't you get more accuracy by using a hardware signal to gate the counter?
Like... using a 5Hz signal from the LEDC, fed to a GPIO that's also used as the counter gate. Then it's just a matter of adding an interrupt routine on the negative edge of the gate signal to grab the count.
I've had to poke around in the GPIO matrix to avoid using a second GPIO pin, but this does actually work.
My one remaining problem is that sometimes the low-speed LEDC pwm channel I'm using as a gate signal doesn't start, depending on what other LEDC channels are running. I don't have a reliable workaround yet.
could you share what you did on the gpio Matrix to avoid using a second GPIO ?