arduino / arduino/ArduinoCore-mbed

RP2040 unreliable encoder and external interrupts

Open
#583 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Hello, working with ConfigurableFirmata and RP2040 ive noticed the encoder library works unreliably for this board.
I get encoder readings however they are unreliable. meaning if i turn left sometimes the value increases, sometimes decreases, skips steps, and the same the other way. Also there is no correlation with the number of clicks of the encoder and the increase/decrease of the reading.
I suspect this issue is related with RP2040 interrupts.

This works great for other boards like arduino nano for instance.

Sketch:
https://github.com/PaulStoffregen/Encoder/blob/master/examples/Basic/Basic.ino

Encoder library: https://github.com/PaulStoffregen/Encoder

Support for RP2040 in this fork of the encoder library: https://github.com/oerkel47/Encoder/

Ive installed the RP2040 board in the Arduino IDE ARDUINO MBED OS RP2040 3.4.1

ive done some research and this issue has been reported here https://github.com/arduino/ArduinoCore-mbed/issues/253
and here: https://github.com/PaulStoffregen/Encoder/issues/69

in theory it was fixed here: https://github.com/arduino/ArduinoCore-mbed/pull/256

however its not working for me, can you please help me? having the encoder work is the last piece in the puzle to start using RP2040 for my projects. thanks a lot.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the linked Encoder Basic.ino sketch on the RP2040 with Arduino mbed OS RP2040 3.4.1, then compare the interrupt behavior with an Arduino Nano. Read the linked ArduinoCore-mbed issue and pull request alongside Encoder issue #69; done means encoder direction and counts reliably match the physical clicks.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.