Debugging the Adafruit I2C SeeSaw Rotary Encoder

Hi,

I'm attempting to communicate between the Adafruit I2C Rotary Encoder with Neopixel and an Arduino Nano Connect RP2040 running the Arduino core.

Using some standard I2C scanning code I find my rotary encoders at addresses 0x60 & 0x6A.

The default Arduino code returns no device detected: https://learn.adafruit.com/adafruit-i2c ... ll#arduino

I have managed to trace the failing code to Adafruit_seesaw::begin to the following code block:

this->read(SEESAW_STATUS_BASE, SEESAW_STATUS_HW_ID, &c, 1);

if ((c == SEESAW_HW_ID_CODE_SAMD09) || (c == SEESAW_HW_ID_CODE_TINY8X7)) {    
    found = true;    
    _hardwaretype = c;
}

Where:

SEESAW_STATUS_BASE = 0
SEESAW_STATUS_HW_ID = 1
SEESAW_HW_ID_CODE_SAMD09 = 85
SEESAW_HW_ID_CODE_TINY8X7 = 135

But the _hardwaretype returned (c) is "4"

I was hoping this might be immediately obvious to someone.

If not, can anyone advise on where I should be looking to discover more about hardware types and what this "4" represents?

Also, where to find more information on SEESAW_STATUS_BASE being "0" and SEESAW_STATUS_HW_ID being "1"?

Many (many!) thanks for any help.

More links please !

Arduino Nano Connect RP2040 : https://store.arduino.cc/products/arduino-nano-rp2040-connect.
It has a few I2C devices already onboard: security chip and IMU.

Adafruit I2C Rotary Encoder with Neopixel: https://www.adafruit.com/product/4991.

The Seesaw library: https://github.com/adafruit/Adafruit_Seesaw.
The .begin() function that is mentioned is in Adafruit_seesaw.cpp line 48.
The defines that are mentioned are in Adafruit_seesaw.h.

Disconnect everything from the Arduino board and run a I2C scanner sketch. You will find the onboard I2C devices. Verify that the Seesaw modules have a different address and connect only one to the Arduino board and try to see it with the I2C scanner.

1 Like

Thank you! I should have included those links too. Apologies.

I have detected the two devices with an I2C scanner sketch at addresses 0x60 and 0x6A.

I have also tried with only a single encoder attached and it made no difference, unfortunately.

Stepping through the code, everything seems to be successful up until the .begin() function you (kindly!) provided links to, with the values outlined in the OP.

Thanks again!

According to the schematic, there is a ATSAMD processor, running in Slave mode.

Do you power the modules with 3.3V ?
I think the I2C Scanner should see it. Perhaps the I2C bus is not connected properly.

If you use the Raspberry Pi RP2040 in Arduino mode, then I assume that the Arduino API is on top of Mbed. That means the pins for the I2C bus are defined by Mbed.

Can you show a photo ? So I can check which pins are used and how long the wires are ?

You can tell which pins you use for SDA and SCL and then I can ask: Why ? :nerd_face:
The Arduino documentations says A4 and A5, but then you must be sure that you have Arduino on top of Mbed. I have seen other pins for the Raspberry Pi Pico.

1 Like

They are running from the 3.3v and A4 & A5 (or so I think). But I've been informed elsewhere (adafruit discord) that:

0x60 is the ATECC608A crypto IC, and 0x6A is the LSM6DSOX 6-axis IMU.

So, you're quite right I think - I'll need to check my wiring as I've been barking up the wrong trees.

Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.