External I2C Arduino Wire

I have a RAK5010 that was updated to run Arduino with my custom firmware based on details and sample code from here:

Arduino on Rak5010! - Cellular Boards / RAK5010 - RAKwireless Forum

It’s working very well and I’ve been able to customize everything for my needs. Now I need to connect to an external I2C device and need a nudge in the right direction.

I’m using P0.19 for SDA and P0.20 for SCL and I’m getting power from J9, pin 1. (1.8v) and ground from pin 4.

Once I find the device, I’m certain I’ll be able to get what I need from it, however I’m not able to find the I2C device. My attempt is to just modify the code for my Sketch to use different pins and enumerate the I2C bus.

#define PIN_WIRE_SDA (14)
#define PIN_WIRE_SCL (13)
#define PIN_WIRE_SDA1 (19)
#define PIN_WIRE_SCL1 (20)

  Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL);
  //Wire.setPins(PIN_WIRE_SDA1, PIN_WIRE_SCL1);

  Wire.begin();
  for (int addr = 1; addr < 128; addr++)
  {
    Wire.beginTransmission(addr);
    if ( 0 == Wire.endTransmission() )
    {
      SerialMon.print("Found: 0x");
      SerialMon.print(addr, HEX);
      SerialMon.println();
    }
  }

Pins 14/13 are connected to the internal I2C devices and I find 4 devices. When I switch to Pins 19/20 I cannot find my device.

Shouldn’t it just be switching those two pins? I have a standard I2C device that works in another project just like I would expect. Yes, I’ve tried other pins and get the same results.

Thoughts?

Thanks

RESOLVED - found a clue in the Forum that helped.

My device is connected as follows:

J9
1 → 1.8 Volts to my device
4 → Ground to my device

J10
4 → SDA of my device

J12
2 → SCL of my device

What was missing is the VREF voltage, so I connected J9, Pin 4 to J12 Pin 1 to setup a reference voltage of 1.8volts and I was able to find and control the device.

2 Likes

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