Ok. That all sounds great.
I'm not totally sure that the Pico's internal pull-ups are suitable for i2c. They might be marginal. Good enough for this application, but will fail weirdly when you want to add something else. Obviously, if the QMK firmware gets the chip working reliably then they are fine, but long term I'd suggest physical external resistors.
And since one piece of software works properly then clearly the problem is in the other software. Sounds a bit trite, but there you go. Maybe your code turns off the pull-ups, thus allowing noise on the i2c bus to make unpredictable things happen.
One other thing you could try is to discard every library and write your own test routine. All you have to do is set up i2c and write some data. It can be hard coded to just turn on a couple of LEDs, but it's often a good idea to have a tiny application that only performs a simple test in an obvious way.
I'm not totally sure that the Pico's internal pull-ups are suitable for i2c. They might be marginal. Good enough for this application, but will fail weirdly when you want to add something else. Obviously, if the QMK firmware gets the chip working reliably then they are fine, but long term I'd suggest physical external resistors.
And since one piece of software works properly then clearly the problem is in the other software. Sounds a bit trite, but there you go. Maybe your code turns off the pull-ups, thus allowing noise on the i2c bus to make unpredictable things happen.
One other thing you could try is to discard every library and write your own test routine. All you have to do is set up i2c and write some data. It can be hard coded to just turn on a couple of LEDs, but it's often a good idea to have a tiny application that only performs a simple test in an obvious way.
Statistics: Posted by ame — Thu Jul 24, 2025 5:41 am