You are here

READ Operation

Before reading data from the slave device, the master tells the slave which of the internal addresses it wants to read. Therefore, a read operation starts by writing to the slave.

To read from a slave device, the I2C master follows these steps:

  1. Sends a START (S) condition.

  2. Sends the I2C address of the slave device.

  3. Sends the WRITE (W) direction bit.

  4. Receives the acknowledgement (ACK) bit.

  5. Sends the internal address where it wants to read from.

  6. Receives the acknowledgement (ACK) bit.

  7. Sends the repeated START (Sr) condition.

  8. Sends the READ (R) direction bit.

  9. Receives the acknowledgement (ACK) bit.

  10. Receives data bytes and sends acknowledgement (ACK) bits to continue reading or a not acknowledgement (NACK) bit to stop reading.

  11. Sends the STOP (P) condition.

Read from internal address

To read data using internal address, call the DlnI2cMasterRead() function. It requires the slave device address (the slaveDeviceAddress parameter), the length of the internal address (the memoryAddressLength parameter) and the internal address (the memoryAddress parameter).

No votes yet

User login