AN1525 STMicroelectronics, AN1525 Datasheet - Page 2

no-image

AN1525

Manufacturer Part Number
AN1525
Description
I2C COMMUNICATION BETWEEN ST52X520 AND EEPROM
Manufacturer
STMicroelectronics
Datasheet
AN1525 - APPLICATION NOTE
3 HARDWARE DESCRIPTION
The electrical schematic of the circuit, which the proposed program refers to is shown in Figure 2. The
Pa0/SCL pin of the microcontroller is connected to the SCL line and the PA1/SDA pin is connected with
the SDA line for bus synchronization. The pushbutton is connected with pin PA7 (external interrupt, INT)
in order to select the reading and writing phase.
In this scheme, the E1 and E2 enable pins are set as Vss. In order to address up to a maximum of 4 mem-
ories, ST24C04 is required to dynamically drive the two E1 and E2 pins from other I/O pins of the micro-
controller. The other devices will be addressed by setting the corresponding bits of the Device Select
Code, which will be A0h for writing and A1h for reading. The first time the button is pressed, the microcon-
troller will start sending data in a sequence, beginning from the address that is indicated by the program
user. Once the button is pushed again, the microcontroller will request the memory to send the data that
was previously written.
2
Figure 2. ST52x520 EEPROM I
C SCHEMATICS
3.1 Page Write Mode
The program performs 8 byte memory writing, equal to the dimensions of the sequential writing page for
2
ST24C04. In PAGE WRITE mode, after having sent the START condition, the I
C peripheral of ST52x520
sends the Device Select Code with the RW bit reset to ‘0’ (see Figure 3) in the bus. The memory sends
an ACK and waits for the initial address writing location to be sent. Upon receipt of the address, the mem-
ory sends another ACK.
After the memory sends the ACK, ST52x520 will send the 8 bytes of data (maximum limit) to be written
on the memory. The memory will send an ACK after every byte and will automatically increment the last
three bits of the internal address counter. After the last byte has been sent and after having waited for the
last ACK, the microcontroller will send the STOP condition.
Figure 3. PAGE WRITE MODE
2/12

Related parts for AN1525