Pulse counter controlled by hardware timing for frequency measurement

meowsqueak
Posts: 151
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

Re: Pulse counter controlled by hardware timing for frequency measurement

Postby meowsqueak » Mon Nov 13, 2017 7:47 am

Strange - hopefully one of the ESP guys can comment...

rohit269
Posts: 24
Joined: Mon Sep 11, 2017 4:22 am

Re: Pulse counter controlled by hardware timing for frequency measurement

Postby rohit269 » Mon Nov 13, 2017 5:12 pm

I tried to configure RMT-out as GPIO 12, and PCNT-CTRL-in as GPIO 13. Then I externally connected the GPIO's with a jumper wire. This seems to preserve the RMT signal.

Will the PCNT module work in this case? I don't see the counter increment though. Or do I need some other modification in my PCNT setup?

Thanks.

Edit: There was a mistake in my PCNT configuration, I am getting some value on my counter.

meowsqueak
Posts: 151
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

Re: Pulse counter controlled by hardware timing for frequency measurement

Postby meowsqueak » Mon Nov 13, 2017 8:15 pm

I noticed that you were counting up on one edge direction, down on the other, which would cause the counter to oscillate between two values. Change both to up, or both to down, to have it count monotonically. Sorry I didn't mention this at the time, as I wasn't sure what your application is.

I'm not sure why you can't share the GPIO. I wonder if the PCNT initialisation is modifying the GPIO mode in other ways that I didn't notice myself? It might be worth diving into the source for the PCNT init and see what it's doing to the GPIO mode.

Who is online

Users browsing this forum: No registered users and 100 guests