Write Process
When the MCU performs write operations, it first sends the 7-bit address code of the device and the Write direction "0" (a total of 8 bits, that is, one byte ), after sending the message, the SDA line is released and 9th clock signals are generated on the SCL line. After confirming that the selected memory device is its own address, a response signal is generated on the SDA line. After receiving the response, the MCU can transmit the data.
When transmitting data, the microcontroller first sends the first address of a byte written to the device's storage zone. After receiving the response from the memory device, the microcontroller sends each Data byte one by one, however, after each byte is sent, the system waits for a response. After the data to be written is transmitted, the microcontroller should send a termination signal to end the write operation. Format of data written into n Bytes:
Read Process
The microcontroller first sends the device's 7-bit address code and the Write direction bit "0" ("pseudo write"). After sending the code, the SDA line is released and 9th clock signals are generated on the SCL line. The selected memory device generates a response signal on the SDA line after confirming that it is its own address. Then, send a byte to read the first address of the device's storage area. After receiving the response, the microcontroller must repeat the start signal and send the device address and read direction ("1 "), after receiving the device response, you can read the data bytes. Each time you read one byte, the microcontroller must reply to the response signal. When the last byte of data is read, the microcontroller should return a "non-response" (high level), and send a termination signal to end the reading operation.