Overview of ESP32Encoder hardware acceleration
masterESP32Encoder is a library that leverages the ESP32 Pulse Counter (PCNT) hardware peripheral to track quadrature encoders.
Key characteristics:
- Low CPU Overhead: Instead of generating an interrupt for every pulse, the library uses the hardware's interrupt mechanism which only triggers when the 16-bit counter buffer overflows. This results in a very small interrupt footprint.
- Hardware Limits: The number of supported encoders depends on the specific ESP32 chip being used:
- ESP32 and ESP32C2: Supports up to 8 simultaneous encoders.
- ESP32S3: Supports only 2 hardware-accelerated encoders (due to having only 2 PCNT modules).
- ESP32C3: Does not support hardware-accelerated encoders as it lacks the PCNT hardware.