AN1525 STMicroelectronics, AN1525 Datasheet - Page 9

no-image

AN1525

Manufacturer Part Number
AN1525
Description
I2C COMMUNICATION BETWEEN ST52X520 AND EEPROM
Manufacturer
STMicroelectronics
Datasheet
AN1525 - APPLICATION NOTE
Figure 13. INITIALIZATION BLOCKS
4.2.3 Reading Block.
If, on the other hand, the operation set by the pushbutton is that of reading (FLAG, bit b0=1) the program
flow is different: before reading a memory location, as represented in Figure 4, a dummy write must be
performed. Meaning that, writing mode must be set with the RW bit of the Device Select Code reset to ‘0’,
the address where to begin reading must be sent, a START condition must be sent, the Device Select
Code (this time with the RW bit set to ‘1’) must be resent and reading may begin.
After the START condition has been sent in the Main Program Window, the microcontroller generates an
2
interrupt that will service the I
C routine. After each START, bit 0 of the SR1 register is set to ‘1’ and the
conditional expression specified in the SB block will become true. The operations performed by the pro-
gram from this point on are those described in paragraph 4.2.1: common steps in reading and writing
where a description is provided on how the program sends to the memory the initial address where to be-
gin reading.
Once the BTF10 block condition is performed, seeing that bit0 of register FLAG is set to ‘1’, the program
will perform the reading block represented by Figure 14.
Figure 14. READ FLOW BLOCKS
9/12

Related parts for AN1525