14.3.2.3 Use Model 3: I2C Loopback Mode

I2C_0 and I2C_1 are internally connected in Loopback mode, as shown in the following figure. The MSS_I2CLOOPBACK bit of the LOOPBACK_CR System register is used to enable the Loopback mode.

Following are the steps to configure I2C_0 and I2C_1 in Loopback mode to verify the data transfer between I2C peripherals.

  • Enable the I2C_0 and I2C_1 in the MSS configurator of the Libero SoC design project.
  • Initialize I2C_0 and I2C_1 in the SoftConsole application.
  • Set the MSS_I2CLOOPBACK bit of the LOOPBACK_CR System register in the SoftConsole application. For further details, see 14 Inter-Integrated Circuit Peripherals.
  • Use I2C read and write APIs from the MSS I2C driver to send and receive the data. While using APIs from the MSS I2C driver, ensure that either I2C_0 or I2C_1 is in Master mode.
  • The data traffic from I2C_0 is looped back to I2C_1, and vice versa.
Figure 14-11. I2C Loopback Block Diagram