Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 9194

MicroPython • Re: Unable to get I2C working

$
0
0
Just to provide an update - which has provided more questions!
Over the weekend, the parts I needed arrived, and I built a minimal solution, and testing this morning, it worked - I was able to detect the I2C (I didn't try anything else).
I then thought I would retry with a known working sensor board with the "old" circuit, and it doesn't work.
I deleted the boot.py and main.py files from the device, and tried again, and after the I2C fails, it still seems to be running the old code after failing the minimal code!
I also tried reducing the SDA and SCL lead lengths by maybe 1cm, and reduced the clock speed from 100kHz to 10kHz, without any success.
I may try effectively starting with a fresh PicoW - by reflashing the boot image.
I am puzzled as to why the minimal code will run other code that was removed.
I have added a soft reset at the end of my code to obviate this.
On the working board, the distance from the PicoW port and the device is about 2cm; and on the non-working board about 4-5cm.
I am now wondering if resident libraries are causing a conflict.
Both setups are using the same PicoW pins for power and similar breadboards - one is larger, as I have more "features" on it!
I guess tests I could perform include trying the "working" configuration on a larger breadboard, then slowly reintroduce the additional libraries, ...
Sorry this isn't a simple "it now all works" option, but as I find out more, I will update in case it helps anyone else!

Statistics: Posted by DinghySailor — Mon Mar 24, 2025 10:15 am



Viewing all articles
Browse latest Browse all 9194

Trending Articles