Hi all,
I need an advise for the following case with unusual behaviour for I2C buses.
Used HW. Jetson Nano with SparkFun Pi Wedge (40pin breakout board), RPi3 for verification.
Used SW: Ubuntu 18.04 LTS, Melexis library for MLX90640 IR camera.
Test: read from IR camera (MLX90640) control register with address 0x800D. Expected value is default value, 0x1901. IR camera I2C device address 0x33.
Verification test: RPi3 with Pi Wedge and IR camera, test passed, the logic analyzer and scope screenshots for the same I2C transaction is first two parts in image (sorry, I have permission for upload only one image).
IR camera is functional.
Test with Jetson Nano and DS1307 I2C RTC (read register 0x00), passed, I2C bus, wiring is OK.
Test with Jetson Nano, I2C-1 (100kHz bus): test fail, I2C transaction not finished. The logic analyzer and scope screenshot for the same transaction is a 3rd and forth parts on image.
The scope shows a lot of noise on the bus.
This result is identical with different values for the I2C pull up resistors.
Test with Jetson Nano, I2C-0 (400kHz bus): test fail, I2C transaction not finished
The logic analyzer and scope screenshot for the same transaction is last two parts on image.
The code snippet for run this transaction (the same for RPi3 and Jetson Nano):
char buf[1664];
struct i2c_msg i2c_messages[2];
struct i2c_rdwr_ioctl_data i2c_messageset[1];
i2c_messages[0].addr = slaveAddr;
i2c_messages[0].flags = 0;
i2c_messages[0].len = 2;
i2c_messages[0].buf = (I2C_MSG_FMT*)cmd;
i2c_messages[1].addr = slaveAddr;
i2c_messages[1].flags = I2C_M_RD | I2C_M_NOSTART;
i2c_messages[1].len = 2;
i2c_messages[1].buf = (I2C_MSG_FMT*)buf;
i2c_messageset[0].msgs = i2c_messages;
i2c_messageset[0].nmsgs = 2;
if (ioctl(i2c_fd, I2C_RDWR, &i2c_messageset) < 0) {
printf("I2C Read Error!\n");
return -1;
}
Thanks for yours attention!