Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RP2040 unreliable encoder and external interrupts #583

Open
ale-novo opened this issue Nov 25, 2022 · 1 comment
Open

RP2040 unreliable encoder and external interrupts #583

ale-novo opened this issue Nov 25, 2022 · 1 comment

Comments

@ale-novo
Copy link

ale-novo commented Nov 25, 2022

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 #253
and here: PaulStoffregen/Encoder#69

in theory it was fixed here: #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.

@alessandromrc
Copy link
Contributor

alessandromrc commented Mar 29, 2023

Hi @ale-novo you could look into my own implementation to get encoders working without using any code from the actual core to avoid issues like these here: https://github.com/alessandromrc/rp2040-mini-core/blob/fcf086a96f4388b3d22462bce10a06858bd4d5d0/core.hpp#L482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants