Control Nicla from an Asset Tracker/Samd51 through eslov/I2C ... Example not working for me

Hello,

The goal is to control the Nicla Sense ME (acting as slave) via an Asset Tracker/Samd51 (acting as master) via the I2C bus.

I'm trying the example: "Control Nicla from an arduino board through eslov" seen on this page:
nicla-sense-me-fw

When I run it I don't see any data. I can see nothing in the Arduino IDE serial monitor (unless I plug both of the boards into a COM port).

These are the boards I have:
samd51
MicroMod Asset Tracker Carrier Board
Nicla Sense ME

I used the Arduino IDE 2.0.1 to compile and upload the programs to the boards.

I have the two boards connected by the qwiic connector from the Asset Tracker. The Asset Tracker/Samd51 are powered by a USB cable plugged into my computer. The Nicla Sense ME is powered by the qwiic connector from the Asset Tracker (I checked the connections for power/ground/SDA and SCL with my multimeter).

I compiled and uploaded the App.ino sketch to the Nicla Sense ME (using a COM port). Here is the code:

#include "Arduino.h"
#include "Arduino_BHY2.h"

// Set DEBUG to true in order to enable debug print
#define DEBUG false

void setup()
{
#if DEBUG
  Serial.begin(115200);
  BHY2.debug(Serial);
#endif

  BHY2.begin(NICLA_I2C);
}

void loop()
{
  // Update and then sleep
  BHY2.update(100);
}

And I compiled and uploaded the accelerometer.ino code to the Asset Tracker board. Here is the code:

#include "Arduino.h"
#include "Arduino_BHY2Host.h"

SensorXYZ accel(SENSOR_ID_ACC);

void setup()
{
  // debug port
  Serial.begin(115200);
  while(!Serial);

  BHY2Host.begin();

  accel.begin();
}

void loop()
{
  static auto printTime = millis();
  Serial.println("loop()");
  BHY2Host.update();

  if (millis() - printTime >= 1000) {
    printTime = millis();
    Serial.println(String("Acceleration values: ") + accel.toString());
  }
}

Does anyone have any ideas on this? I'm fairly new to programming devices like this.

Thanks for any help.

Regards,
...John

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the related discussion here:

1 Like

An update.

I found that when I had the Nicla Sense plugged into the COM port everything worked, i.e. I2C communicated. This is a mystery to me, because we want to power the Nicla Sense through the Asset Tracker's qwiic cable.