About software I2C communication with MSP430
[Copy link]
When the MSP430 is used as a slave device and the host simulates the I2C software to communicate with the MSP430, it is important to release the SCLK immediately after sending 8 bits of data. This is because the MSP430 will pull the SCLK low during a busy process and release the SCLK only when it is idle. Therefore, the host should first give the SCLK to the MSP430, and then send the clock to receive the ACK after reading that the SCLK is released by the MSP430.
The same is true for when the host reads data from the MSP430. After each byte of data is read, the host should release SCLK and wait for the MSP430 to release SCLK before sending an ACK to the MSP430.
The above paragraph is misunderstood. When reading data from MSP430, there is no need to release SCLK. Instead, it is necessary to delay for a while after reading 8 bytes each time and then send ACK to wait for MSP430 to complete the processing.
When the host reads data from MSP430, each time it reads a byte, the host must send an ACK to MSP430 to notify MSP430 that it has received the entire byte and can send the next byte. When the host finishes reading the last byte, it should not send ACK but NO_ACK. Because by sending NO_ACK, MSP430 knows that the host has finished reading the data and will stop sending data.
|