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_SDA1, PIN_WIRE_SCL1);

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

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.



RESOLVED - found a clue in the Forum that helped.

My device is connected as follows:

1 -> 1.8 Volts to my device
4 -> Ground to my device

4 -> SDA of my device

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.


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