esp32 PCNT counter

dwayne99
Posts: 1
Joined: Mon Dec 02, 2024 10:13 am

esp32 PCNT counter

Postby dwayne99 » Mon Dec 02, 2024 10:28 am

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.

MicroController
Posts: 1823
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp32 PCNT counter

Postby MicroController » Wed Dec 04, 2024 8:25 am

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.

Who is online

Users browsing this forum: JohnnyZ and 145 guests