Page 1 of 1

Problems with using PCNT.

Posted: Sun Jun 15, 2025 10:14 pm
by Microzod
Hello.

I am trying to make use of the PCNT module, in my code I have two libraries that each use PCNT, they work just fine when I test them separated but once put into the same sketch one of the libraries stop working.

Is there any known issues with using driver/pulse_cnt.h?

FYI, I am using an esp32-s3 and all in all my sketch is trying to utilize 3 of 4 pcnt units.

The first library is a publicly available library called RotaryEncoderPCNT

Regards

Re: Problems with using PCNT.

Posted: Fri Jun 20, 2025 6:23 pm
by horace99
I have used the RotaryEncoderPCNT library for reading a QEI encoder module without problems
what is the other library?

could you implement a program using the two libraries which demonstrates the problem?

Re: Problems with using PCNT.

Posted: Sun Jun 22, 2025 6:43 pm
by lbernstone
The linked library is properly keeping track of the units used. Perhaps the other one isn't. Try switching the order of initialization.

Re: Problems with using PCNT.

Posted: Tue Oct 14, 2025 10:54 pm
by Microzod
I think it has something to do with keeping track of which units that are available or not, in the end I solved this by taking that rotary encoder library code and combining it with my own code. It is a really messy solution but at least everything works when I set up everything from within a single class instance.