KB2040 does see I2C devices

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Burgin
 
Posts: 6
Joined: Sun Nov 13, 2022 7:44 am

KB2040 does see I2C devices

Post by Burgin »

I'm using a KB2040 controller, the only connections are USB-C and a Stemma I2C device, either Adafruit Rotary Encoder or SHT40.

Using Arduino IDE 2.0.3 and have the Raspberry PI Pico/RP2040 by Earle F Philhower version 2.7.0.

I'm using an unmodified Adafruit Testbed sketch, which gives this output.

08:17:23.124 -> Adafruit I2C Scanner
08:17:23.124 ->
08:17:23.124 ->
08:17:23.124 -> Default port (Wire) I2C scan:
08:17:23.155 -> Secondary port (Wire1) I2C scan:
08:17:26.159 ->
08:17:26.159 ->
08:17:26.159 -> Default port (Wire) I2C scan:
08:17:26.191 -> Secondary port (Wire1) I2C scan:
08:17:29.232 ->

So I've tried both controllers, different I2C devices which also use different cables.
The power led on the SHT40 and Rotatry Encoder modules illuminate.

I also connected up the devices to an Arduino Uno and run the same sketch and I see several of the devices respond
08:31:40.942 ->
08:31:40.942 -> Default port (Wire) I2C scan: 0x0, 0x36, 0x3C, 0x44,
08:31:43.936 ->
08:31:43.936 ->
08:31:43.936 -> Default port (Wire) I2C scan: 0x0, 0x36, 0x3C, 0x44,
08:31:46.974 ->

So I suspect it's software configuration issue in the setup of I2C, but that's just a guess.

Anyone have any experience or thoughts to share that might help me?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: KB2040 does see I2C devices

Post by adafruit_support_mike »

To check are you using exactly the same cables and devices in both cases?

Debugging is all about details, and "shouldn't make any difference" changes often do.

User avatar
Burgin
 
Posts: 6
Joined: Sun Nov 13, 2022 7:44 am

Re: KB2040 does see I2C devices

Post by Burgin »

I've built an additional test rig using an Arduino Nano 33 IOT. I used the STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers to connect the I2C ports from the Nano to an Adafruit Qwiic / Stemma QT 5 Port Hub with the SHT40 and Rotary encoders plugged into the hub.

The same code on the Nano sees all the devices. When I then replace the QT to Headers with a QT to QT and plug into the KB2040, I get nothing. I also verified the QT to QT cable works by using it on the Hub to SHT40 link to test.

So I'm pretty sure the issue is on the KB2040 side, but like I said I have two of them so I don't think it is a hardware issue, as much as I think it might still be a software configuration issue. The lights on the Encode and SHT40 come on so they are getting power thru the QT cables.

From reading I understand the KB2040 has 2 I2C ports and can be mapped to various pins. I guess I am assuming that in the framework they I2C0 is being mapped to the pins not he STEMMA QT connector.

It is scanning for two I2C ports, so maybe I could connect up to the other port? Not sure what pins that is actually on.

User avatar
Burgin
 
Posts: 6
Joined: Sun Nov 13, 2022 7:44 am

Re: KB2040 does see I2C devices

Post by Burgin »

I did some additional testing with my test rig. Turns out one of the KB2040 does work, the other does not.
During my previous testing I obviously used the working one during a setup error and the non working one for most of other testing after convincing myself that both exhibit the same behavior.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: KB2040 does see I2C devices

Post by adafruit_support_mike »

Comparison tests are good evidence, thank you.

When did you get the board that doesn't work?

User avatar
Burgin
 
Posts: 6
Joined: Sun Nov 13, 2022 7:44 am

Re: KB2040 does see I2C devices

Post by Burgin »

It was a free item from order Order #2978665-1481275770 on Dec 13th.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: KB2040 does see I2C devices

Post by adafruit_support_mike »

That's within our 30 day return/replace window, thanks.

Send a note containing a link to this page and your order number to [email protected]. The folks there will get you a replacement.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”