![]() So the master either ACKs or NACKs a read-in byte. ![]() The master will follow this up with a STOP condition Once the master has received the number of bytes it is expecting, it will send a NACK, signaling to the slave to halt communications and release the bus. At the end of every byte of data, the master will send an ACK to the slave, letting the slave know that it is ready for more data. The master will continue sending out the clockpulses, but will release the SDA line, so that the slave can transmit data. I have read the TI document over how I2C works Can we check this value with the value of the amount of bytes we requested? This function does return the amount of received bytes. ![]() How does this work when you are requesting bytes using Wire.requestFrom( address, 3 ) for example. You can use the return value of Wire.endTransmission() to test if the slave has acknowledged the message. If you write bytes to an I2C slave with the Wire library. So I want to tackle this problems by using the built in error detection of I2C, polling the inputs frequently (every 20ms or so) and by debouncing the received data in code by comparing the previous state to the current state of every input pin. I am expecting that certain transmissions may toss errors. I am going to use MCP23017 chips, and some of them will be cabled with a 1 meter max unshielded cable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |