Pulse counter support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
OutoftheBOTS_
Posts: 626
Joined: Mon Nov 20, 2017 10:18 am

Re: Pulse counter support

Post by OutoftheBOTS_ » Thu Aug 01, 2019 8:40 pm

pidou46 wrote:
Thu Aug 01, 2019 5:53 am
It seems able to handel encoders: https://docs.espressif.com/projects/esp ... /pcnt.html
- it count rising and/or falling edge
- a filter can be set to avoid glinches
- up to 8 counter are availables, not as much as STM32, but it enable quite sophisticated projects.

But now the hardest part is how to bring it to esp32 micropython port ?
My C skills dates from ages, and I have no idea where to start with ? I guess setting up a toolchain (GCC, ESP-IDF, ect...)
Is there somewhere a tutorial or even a sample of ported fonctionality ?
Thanks for the link to the info. The info isn't detailed but from what I read it won't read an quadrature encoder. It does have a 2 pin mode but from what I can gather it works by 1 pin is the counter pin and the other pin is a direction pin (something like a stepper motor driver). A quadrature encoder works differently were both pins are counter pins but depending on the order of the rising and falling of the 2 pins whether it is counting up or down.

The PCNT would be great to have added for reading single channel encoder but not sure if it will be capable of reading a quadrature encoder

see STM32F407 encoder mode that is capable of both single and quadrature encoders https://www.st.com/content/ccc/resource ... %2Cnull%5D

OutoftheBOTS_
Posts: 626
Joined: Mon Nov 20, 2017 10:18 am

Re: Pulse counter support

Post by OutoftheBOTS_ » Sat Aug 03, 2019 6:55 am

If you really want to use ESP and need to count a number of Quadrature encoders then you might be interested in this https://lsicsi.com/products/Development ... /LS7366RSh it has 6 32bit quadrature counters and is read by SPI. It is an ardunio shield made by the manufacturer of the LS7366R chip

Post Reply