esp32 PCNT counter
esp32 PCNT counter
I am attempting to read a PWM bit signal from a WS2812B. Is it possible for me to use the PCNT module on the esp32 for me to count the pulses and obtain the frequency of the signal. The Ws2812B bit signal frequency when read using the oscilloscope is around 800Khz and the pulse high time is around 400-800ns. We are currently using an esp32-c3 but planning to move to an esp32 with the PCNT module if the need arises.
-
- Posts: 1823
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: esp32 PCNT counter
Yes, the PCNT can count the pulses and you can calculate the frequency from that count.
Do you really only want the frequency, or rather the actual data, i.e. the pulse widths?
You can also use the RMT to capture the pulses, but you'll need 32 bits of RAM for every WS2812B bit captured.
Do you really only want the frequency, or rather the actual data, i.e. the pulse widths?
You can also use the RMT to capture the pulses, but you'll need 32 bits of RAM for every WS2812B bit captured.
Who is online
Users browsing this forum: JohnnyZ and 145 guests