Page 1 of 1
PCNT (Pulse Counter) example (arduino ide)
Posted: Sat Jul 17, 2021 12:07 pm
by Nikita71
Hi. I need to count high frequency pulses. On the internet i found that the esp32 has such a thing as PCNT (Pulse Counter)
even found its description but nowhere can find an example that could ideally output the number of pulses per second in compor. Please help )
Re: PCNT (Pulse Counter) example (arduino ide)
Posted: Sun Jul 18, 2021 7:16 am
by smah80
Hi,
I am also looking for a similar solution where I can count pulses for quadrature encoder running on 1500RPM.
I also found some code and look at the description on ESP-IDF of PCNT, but not able to understand how to connect my A,B,Z pulses encoder with it.
Also feel difficult to understand tasks. is there any good tutorial with example? or at-least a simple example of using quadrature encoder.
any help will be highly appreciated.
Thanks
Re: PCNT (Pulse Counter) example (arduino ide)
Posted: Fri Sep 03, 2021 12:59 pm
by smah80
Any help in this regard?
Re: PCNT (Pulse Counter) example (arduino ide)
Posted: Fri Sep 03, 2021 7:02 pm
by tommeyers
I googled: "esp32 pulse count"
This looks promising:
https://docs.espressif.com/projects/esp ... /pcnt.html
What did you look for?
Tom
Re: PCNT (Pulse Counter) example (arduino ide)
Posted: Sun Sep 05, 2021 6:21 pm
by smah80
Yes I looked at it, but I am not able to understand it properly.
could you please provide a sample program for arduino ide in which I can connect a encoder using PCNT along with hardware pin schematic?
Re: PCNT (Pulse Counter) example (arduino ide)
Posted: Mon Sep 06, 2021 6:15 pm
by tommeyers