English
Language : 

AN971 Datasheet, PDF (3/7 Pages) STMicroelectronics – The goal of this application note is to present an practical example
I2C COMMUNICATION BETWEEN ST7 AND M24Cxx EEPROM
2 ST7 / M24CXX I2C COMMUNICATION APPLICATION
2.1 HARDWARE CONFIGURATION
The ST7 / M24Cxx I2C communication application hardware consists of a ST72264 microcon-
troller which communicates with an external M24C08 EEPROM through an I2C bus interface.
Figure 1. ST7 / EEPROM I2C Communications Application
ST72264
VDD
SCL
I2C
SDA
VSS
5V
2x100Ω
2x27KΩ
M24C08
SCL
SDA
E
Address=A0h
2.2 ST7 I2C PERIPHERAL BASIC DRIVERS
In this chapter all registers refer to the ST7 I2C peripheral (unless otherwise specified).
2.3 INITIALIZE THE I2C PERIPHERAL
In this application the initialization of the ST7 I2C peripheral is done completely by software
without taking into account the hardware reset status.
First the Control Register (CR) is cleared and the Data (DR) and Status (SR1,SR2) registers
are touched to clear any pending events.
Then, the peripheral is enabled through the Control Register (CR). This action needs to write
twice in the register due to the fact that the Control Register (CR) bits can be set only when the
PE enable bit is already set. To allow the peripheral to acknowledge the received data the
ACK bit of the Control Register (CR) is set.
As the ST24C08 EEPROM is specified with a maximum I2C clock speed at 100KHz, the ST7
I2C peripheral is set to this speed (CCR=26h) in the application.
3/7