English
Language : 

AN1045 Datasheet, PDF (1/16 Pages) STMicroelectronics – ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
AN1045
APPLICATION NOTE
ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
by Microcontroller Division Applications Team
INTRODUCTION
The goal of this application note is to implement an I2C communications software interface for
devices which have no I2C peripheral. The software of this application performs I2C master
transmitter and master receiver functions. The master chosen here is a ST72324 and the
slave is an EEPROM (M24C08).
The program described in this application note is in C language, a program in assembly lan-
guage is also available in the software library (see ST7 CD ROM on Internet).
1 CHARACTERISTICS
The main characteristics of this I2C software are:
s bit addressing
s Master Transmitter/Receiver
s Several data bytes sent and received (3 in this application)
s Fscl = 62.5 kHz
s Acknowledge management
s Error management (AF)
The I2C synchronous communication needs only two signals: SCL (Serial clock line) and SDA
(Serial data line). The corresponding port pins used are PA7 for SCL and PA6 for SDA.
These two pins are configured as floating input (to have a high level applied on the pin or to re-
ceive data) or as output open drain (to have a low level applied on the pin or to output data).
Please refer to the ST7 datasheet for more details about port configuration.
AN1045/0803
1/16
1