Repeatable hardware I2C EIO errors with multiple boards #15461
Replies: 3 comments 6 replies
-
Pull-up on SDA/SCL lines? |
Beta Was this translation helpful? Give feedback.
-
A couple of observations. machine.I2C() is initialised with 400kbitb/s (50kbyte/s). Maybe try a slower 100k speed and check whether that's sufficient. (slower is more forgiving, especially in a dirty/noisy environment) machine.I2C() requires (according to docs) a Pin object, not a GPIO number. |
Beta Was this translation helpful? Give feedback.
-
Norbert, Thank you very much for your input! When I get in from my trip I'll give your suggestions a try and see if things improve! JimOn Jul 13, 2024 23:15, Norbert ***@***.***> wrote:
A couple of observations.
machine.I2C() is initialised with 400kbitb/s (50kbyte/s). Maybe try a slower 100k speed and check whether that's sufficient. (slower is more forgiving, especially in a dirty/noisy environment)
machine.I2C() requires (according to docs) a Pin object, not a GPIO number.
Try to setup Pin() before handing them over to machine.I2C().
In addition, using mem32[] and PADS_BASE, one can vary individual slewrate and drive as well.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello all, this is my first post here, but I am not new to the PICO or Python. I am a freelance/hobby Python developer, a commercial pilot and an electronics hobbyist. I've been attempting to tie all this together by designing a model aircraft autopilot with a Raspberry Pi PICO and MicroPython (I know I have unrealistic expectations but it's about pushing boundaries). I've been very successful with individual sensors, servos, GPS, LORA, and TOF sensors but every time I attempt to tie the I2C boards together I run into unresolvable but erratic EIO errors. After the initial EIO error, re-plugging in an I2C device always results in EIO errors on every device connected. Devices are ALWAYS detectable on the bus, but when using
writeto_mem
they throw an EIO error. It seems as though letting everything sit, then connecting a single device the next day and running, for example, the BerryIMU library, there are no EIO errors. But then, if I change the pin configuration at all, EIO errors start and don't resolve even after power cycles. Here are my questions:Is it possible to configure machine.Pin incorrectly prior to instantiating an I2C class or does I2C reconfigure the Pins as required for operation?
At one point during testing I reversed the SCL and SDA lines on the 5v side of a Pololu logic level shifter. This understandably caused EIO errors but I don't imagine that this may have caused any hardware damage. I'm not, however, ruling it out. On my custom circuit board (see the circuit below) I have 2 Pololu voltage regulators. One for 3.3v and one for 5v. I tied the 3v3 rail on the PICO to the 3v3 voltage regulator output. I'm wondering if this too may have damaged any components. HOWEVER, I purchased a new PICO and individually connected an I2C device that was never in the original circuit (A simple OLED screen) and it too experiences occasional EIO errors. Hooking it up to a Raspberry Pi Zero results in no errors. I'm convinced I'm doing something wrong with my MicroPython code, but I can't be 100% certain. Here is code that ALWAYS results in EIO errors...
Here's my circuit:
Any help steering me in the right direction would be awesome!
-Jim Hunt
Beta Was this translation helpful? Give feedback.
All reactions