11 I2C Controller (I2C)
11.3.6
Master Reads from Slave
Figure
11-9
shows the Master reading N-bytes of data from an Slave with a 7-bit address. At first, the Master
needs to send the address of the Slave, so cmd1 is a WRITE command. The byte that this command sends is
the slave address plus the R/W flag, which in this case is 1 and, therefore, indicates that this is going to be a
read operation. The Slave starts to send data to the Master if the addresses match. The Master will return ACK,
according to the ack_value in the READ command, upon receiving every byte. As can be seen from Figure 11-9,
READ is divided into two segments. The Master replies ACK to N-1 bytes in cmd2 and does not reply ACK to the
single byte READ command in cmd3, i.e., the last transmitted data. Users can configure it as they wish.
When storing the received data, Master will start from the first address in RAM. Byte0 (Slave address + 1-bit R/W
marker bit) will be overwritten.
When the END command is not used, the Master can receive up to (13*255) bytes of valid data. The cmd unit
is populated with RSTART + 1 WRITE + 13 READ + 1 STOP.
Figure
11-10
shows the Master reading data from a slave with a 10-bit address. This mode can be enabled
by setting I2C_SLAVE_ADDR_10BIT_EN bit and preparing data to be sent in the slave RAM. In the Master, two
bytes of RAM are used for a 10-bit address. Finally, the I2C _TRANS_START bit must be set to enable one
transaction.
Espressif Systems
Figure 11-9. Master Reads from Slave with 7-bit Address
Submit Documentation Feedback
297
ESP32 TRM (Version 5.2)
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?