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
Problems with using PCNT.
Re: Problems with using PCNT.
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?
what is the other library?
could you implement a program using the two libraries which demonstrates the problem?
-
lbernstone
- Posts: 1132
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Problems with using PCNT.
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.
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.
Who is online
Users browsing this forum: No registered users and 2 guests