For specific I2C address access

Hello.
I am trying to access an external sensor via I2C using an arduino Nano33Iot.

When I access the address (0x6a), I get an I2C ACK even if the sensor is not connected. (Also confirmed by oscilloscope)
(This also happens when I run the Arduino Nano33 Iot board by itself.)
What could be the cause of this?

If I change to any other address, the I2C ACK processing stops. (ACK was not returned at addresses 0x5a, 0x6b, 0c6c)

No change occurred with or without SDA Pullup.

#include <Arduino.h>
#include <Wire.h>

#define I2C_ADR 0x6a
//#define I2C_ADR 0x6e

uint8_t CMD_STR    [2] = { 0x00,0x10};
uint8_t CMD_GET    [2] = { 0x04,0x05};
uint8_t CMD_GETRAW [2] = { 0x03,0xd2};
void setup() {
  Serial.begin(115200);
  while (!Serial) { }
  Wire.begin(); // 
  Serial.println("I2C TEST");
  delay(1000);
}

void loop() {
  //i2c_wr(CMD_GET);
  //delay(1);
  i2c_rd( 10);
  delay(1000);
}

void i2c_wr ( uint8_t* wdat){
  Wire.beginTransmission(I2C_ADR);        //call the circuit by its ID number.
  Wire.write(wdat[0]);
  Wire.write(wdat[1]);
  Wire.endTransmission();  

  Serial.print("I2C WR:");
  Serial.print(wdat[0],HEX);
  Serial.print(" ");
  Serial.print(wdat[1],HEX);
  Serial.println();
   
}

void i2c_rd ( uint8_t rsize){
  uint8_t tmp=0;
  Wire.requestFrom(I2C_ADR, rsize);//RD
  for (int i=0; i < rsize; i++){
    while (Wire.available() == 0 ){}
    tmp = Wire.read();//
    Serial.print( tmp,HEX);
    Serial.print(" ");
  }
  Serial.println("");
}

You seem to confuse ACK and NACK.

Run an I2C scanner before you start your own experiments.

Use the value returned by requestFrom(). It will be 0 in case of errors (NACK).

It has a crypto chip and a acceleration/gyro sensor on the I2C bus. The Nina WiFi module is also on the I2C bus, I didn't know that it was actually visible on the bus.

Which sensor do you want to connect ?

By the way, there is no need to wait for something after the Wire.requestFrom(). The function is blocking. When it returns, the I2C bus session has completely finished.

You don't have to include <Arduino.h>, you can remove that line.

Thank you very much.

There was a conflict with the address of the gyro sensor.
I had mistakenly thought that the board by itself had nothing on it.

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