
ST52F510/F513/F514
35/106
4.3.2 Random data reading.
To read a specified
memory location, the following procedure should
be used:
1.
The Programming mode is entered with the
sequence described in Section 4.2.1
2.
The SetPage command is sent, followed to
the page number where the data to be readis
located
3.
The ByteRead command is sent, followed by
an address inside the page
4.
The Master generates a Stop condition fol-
lowed by a Start condition
5.
The Slave Address with the R/W byteset to 1
(10100001) is sent. The device receives the
Slave Address and acknowledges it.
6.
The device sends the data to be read in the
serial data line SDA.
7.
The Master device doesn’t send the acknowl-
edge and generates a stop condition.
8.
To send the next command, the Master
should generate a Start condition followed by
the Slave Address with the R/W byte set to 0
(10100000).
Figure 4.4 Device Lock Procedure
4.4 Memory Lock
The Program/DataMemory space canbelocked to
inhibit the reading of contents and protect the
intellectual property.
To lock the device, the user must set all the bit of
the Lock Byte to ‘1’. The Lock Byte is located on
Page 48 (030h), Block3, byte 0inside theblock i.e.
byte 96 (060h) inside the page.
After writing255 (0FFh) into the LockByte, with the
procedure described in the Section 4.2.3, the
memory is locked and the only command allowed
are the following:
– GlobalErase this command, writing ‘0’ in all the
memory, also unlock the device.
– ReadData the only blockthat can be readis the
Block 3 in Page 48 (030h); this allows the read-
ing of the Lock Byte and the ID Code locations
(see Section 4.5).
– ReadStatus this command allows the detection
of an error condition in Programming mode op-
eration (see Section 4.6). It can also be used to
check if the device is locked.
Remark:
the Lock Byte is checked when entering
the Programming Mode. For this reason after
writing the Lock Byte, all the commands can be
carried out until the Programming mode is exited.
Device Lock Procedure
Device Lock and ID Code Writing Procedure
Device Lock Reading Procedure
S=Start, P=Stop, A=Acknowledge, NA=Non-acknowledge
From Slave to Master
From Master to Slave
.....
SetPage
A
00110000
A
ByteWrite
A
01100000
A
11111111
A
Command
.....
.....
SetPage
A
00110000
A
IncBlock
A
IncBlock
A
IncBlock
A
BlockWrite
A
.....
.....
11111111
A
ID Code 1
A
ID Code 2
A
.....
ID Code 31
A
Command
.....
.....
SetPage
A
00110000
A
ByteRead
A
01100000
A
P
S
1010000
1
A
.....
.....
Lock Byte NA
P
S
1010000
0
A
Command
.....