Hello,
I ran into a bug in the atm128 i2c driver. It sends the slave address even
if it's not a START condition. This is probably normally not a big deal
since you can write data in one operation with both START and STOP
conditions, which works correctly. But if you try to write the data in
chunks without restarting, then you get the address in the consecutive data
writes, which I believe is not correct.
In "tos/chips/atm128/Atm128FIF2CMasterPacketP.nc", inside of
I2CPacket.write(), on line 248, it sends the slave address if it's not a
I2C_START condition and length of packet is greater than 0:
if (flags & I2C_START) {
call I2C.setStart(TRUE);
// call WriteDebugLeds.led0On();
state = I2C_STARTING;
}
else if (len > 0) {
state = I2C_DATA;
* call I2C.write(((packetAddr & 0x7f) << 1) | ATM128_I2C_SLA_WRITE);*
}
I believe it should just go ahead and write the data instead:
if (flags & I2C_START) {
call I2C.setStart(TRUE);
// call WriteDebugLeds.led0On();
state = I2C_STARTING;
}
else if (len > 0) {
state = I2C_DATA;
*call I2C.write(packetPtr[index]);*
* index++;*
}
Does that sound right or am I missing something?
-- Anderson Nascimento
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help