The goal of this application note is to present an practical example of communication using the I2C peripheral of the ST7. It shows a basic single master communication between a ST7 microcontroller and an M24Cxx I2C bus EEPROM. The purpose is to implement, from the ST7 through the I2C interface, a write and a read to the external EEPROM without error management.
The ST7 I2C peripheral allows multi master and slave communication with bus error management. In this application, only single master mode is used without error management. As polling mode is the most difficult mode to implement, the application is based on this mode, but it can be easily adapted for interrupt management.
The I2C synchronous communication needs only two signals: SCL (Serial clock line) and SDA (Serial data line). The corresponding port pins have to be configured as floating inputs.