Frequency Measurement on digital input

cicciocb
Posts: 4
Joined: Mon Sep 10, 2018 2:08 pm

Re: Frequency Measurement on digital input

Postby cicciocb » Fri Jan 24, 2020 9:40 pm

TinkerBearNZ wrote:
Mon Jul 15, 2019 5:57 am
Wouldn'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.
Hi TinkerBearNZ ,
could you share what you did on the gpio Matrix to avoid using a second GPIO ?

Thanks

cicciocb

cicciocb
Posts: 4
Joined: Mon Sep 10, 2018 2:08 pm

Re: Frequency Measurement on digital input

Postby cicciocb » Sat Jan 25, 2020 6:49 pm

TinkerBearNZ,
finally I found the solution avoiding to use 2 extra GPIO.

Thanks for the tip

Who is online

Users browsing this forum: Google [Bot] and 8 guests