Does this still apply to the ESP32?I think the problem you're hitting here is the interrupt latency of the ESP8266 which is frankly appalling.
Search found 5 matches
- Sat Jul 08, 2017 10:06 pm
- Forum: MicroPython pyboard
- Topic: How does timer encoder mode work?
- Replies: 16
- Views: 13397
Re: How does timer encoder mode work?
- Fri Jul 07, 2017 3:51 am
- Forum: Drivers for External Components
- Topic: A library for reading rotary encoders (ESP-8266 and Pyboard/stmhal)
- Replies: 22
- Views: 27418
Re: A library for reading rotary encoders (ESP-8266 and Pyboard/stmhal)
[quote="pythoncoder"]Given the observed rates of contact bounce events and the simplicity of the ISR this strikes me as improbable and I didn't observe it in testing.[/quote] I believe this is happening to me. I looked at one of the encoder channels on my scope and saw that my pulses are about 600μs...
- Fri Jul 07, 2017 2:36 am
- Forum: MicroPython pyboard
- Topic: How does timer encoder mode work?
- Replies: 16
- Views: 13397
Re: How does timer encoder mode work?
Callback function here takes also close to 800μs and I'm seeing similar results.mattyt wrote:Not sure if you're using the timers to interface to a Rotary Encoder but, if so, I've found Spotlight Kid's Encoder library works great...
- Fri Jul 07, 2017 2:16 am
- Forum: MicroPython pyboard
- Topic: How does timer encoder mode work?
- Replies: 16
- Views: 13397
Re: How does timer encoder mode work?
If you've no objection I'll update the original to reflect these changes which should provide portability to any MicroPython platform. That's fine. I've also discovered an issue. It seems the callback routine is around 800μs, which is a bit too slow for my application and is causing me to lose coun...
- Tue Jul 04, 2017 5:52 pm
- Forum: MicroPython pyboard
- Topic: How does timer encoder mode work?
- Replies: 16
- Views: 13397
Re: How does timer encoder mode work?
I modified the code as pythoncoder said and tested successfully with a quadrature encoder. You can find the code here https://github.com/Evidlo/periscope/blob/master/spooling/code/encoder.py Use it like so: from machine import Pin from encoder import Encoder pin_x = Pin(4, Pin.IN) pin_y = Pin(5, Pin...