I'm looking at Figure 5-11
I think I was confusing what they label as "receive byte" and "read byte". Rather ambiguous.
A0..2 have pull-ups as already noted. This is consistent with the scanner output.
The current , full sketch:
#include <Wire.h>
#define I2C_SLAVE_ADDR 0x1F // 0x1F << 1 = 0x3E
void setup() {
Serial.begin(115200);
Serial.write("Arduino I2C v0\r\n");
Wire.begin(); // init TWI lib
init_I2C();
}
void init_I2C() {
byte status=0;
byte res=0;
Wire.beginTransmission(I2C_SLAVE_ADDR);
if ( Wire.endTransmission() !=0 ) {
Serial.println("slave 0x1F not responding\r\n Halting.");
while (1) ;
}
Serial.println("send request - get case status byte");
Wire.beginTransmission(I2C_SLAVE_ADDR);
Wire.write((byte)0xD8); // set status register address
res=Wire.endTransmission(false);
if (res != 0 ) {
Serial.print("endTransmission error ");
Serial.println(res);
}
Wire.requestFrom(I2C_SLAVE_ADDR,1); //read case status byte
if ( Wire.available() == 0 ) {
Serial.println("No data on bus\r\n");
} else {
status=Wire.read() ;
Serial.print("status = "); Serial.println(status,HEX);
}
// next cmd
Serial.println("send request 2 - get module status byte");
Wire.beginTransmission(I2C_SLAVE_ADDR);
Wire.write((byte)0x98); // set status register address
res=Wire.endTransmission(false);
if (res != 0 ) {
Serial.print("endTransmission error ");
Serial.println(res);
}
Wire.requestFrom(I2C_SLAVE_ADDR,1); //read case status byte
if ( Wire.available() == 0 ) {
Serial.println("No data on bus\r\n");
} else {
status=Wire.read() ;
Serial.print("status = "); Serial.println(status,HEX);
}
} // end init_I2C()
void loop() {
while (1) ;
}
The output from that is :
Arduino I2C v0
send request - get case status byte
endTransmission error 3
status = 0
send request 2 - get module status byte
status = 0
language ref says that return value means:
3:received NACK on transmit of data
Odd, since the iMP doc says:
Command Error [Ref#1, 4.1]
This protocol does not support NACKing the command code or data bytes as they are being received.