arduino-ad-mux-lib icon indicating copy to clipboard operation
arduino-ad-mux-lib copied to clipboard

Using boards faster than 30MHz

Open lucien-laborderie opened this issue 5 years ago • 1 comments

Hello, I'm currently working with a Teensy 4.0 and a 4051 to read height pushbuttons, and I came across a bug using this library :

When pressing a button, multiple channels read as pressed, however the bug disappears when the sketch is loaded with the 24MHz clock speed. It seems like the board is too fast for the Mux, which doesn't have the time to switch between inputs. The bug disappeared when adding a 1 millisecond delay in Mux.cpp, in the setChannel function, which seems to confirm this.

I would like to share my sketch without other people having to modify the library, are there any ways to do that ? Let me know your thoughts on this !

(I'm French so please excuse me for any weird phrasing or mistakes...)

lucien-laborderie avatar May 14 '20 16:05 lucien-laborderie

Hi Lucien,

merci pour ton rapport.

Despite your successful fix, that alleged lag is worth some investigation: I would prefer a solid, generalized solution (sort of automatic calibration) to an arbitrary delay (1ms fit your case, what about other boards? maybe that's not enough/too much...).

In the meantime, feel free to share your fix forking this repo, or (if it's more practical for you) posting your relevant code snippet directly into this thread, thanks!

stechio avatar Jul 03 '20 12:07 stechio