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("");
}