SLAA908A September 2019 – September 2021 MSP430FR2032 , MSP430FR2032 , MSP430FR2033 , MSP430FR2033 , MSP430FR2153 , MSP430FR2153 , MSP430FR2155 , MSP430FR2155 , MSP430FR2310 , MSP430FR2310 , MSP430FR2311 , MSP430FR2311 , MSP430FR2353 , MSP430FR2353 , MSP430FR2355 , MSP430FR2355 , MSP430FR2422 , MSP430FR2422 , MSP430FR2433 , MSP430FR2433 , MSP430FR2475 , MSP430FR2475 , MSP430FR2476 , MSP430FR2476 , MSP430FR4131 , MSP430FR4131 , MSP430FR4132 , MSP430FR4132
In this example, another MSP430FR2311 is used as the I2C slave device, and the I2C slave program is loaded internally You can download the slave program for reference, and you need to add RX interrupts and buffers for correct operation. The slave address is 0x48. When receiving a write command sent by the host device, the data is stored in the buffer area. When receiving a read command sent by the host device, the slave device sends incremental data starting at 0x00.
Figure 6-1 shows the serial port command sent by the I2C master to write data and read the data.
In the write example, the UART data command writes 8 bytes to the I2C slave. The command is composed of these bytes:
In the read example, the UART data command reads 8 bytes from I2C slave.
Figure 6-2 shows the waveform of the I2C write data. From the figure, we can see the start bit, slave address, write command, write data and the end bit in SDA line.
Figure 6-3 shows the waveform of the I2C read data. From the figure, we can see the start bit, slave address, read command, read data and the end bit in SDA line.