At89ls53, Instruction set, Serial programming algorithm – Rainbow Electronics AT89LS53 User Manual
Page 20: Serial programming instruction

AT89LS53
4-268
Instruction Set
Notes:
1. DATA polling is used to indicate the end of a write cycle which typically takes less than 10 ms at 2.7V.
2. “x” = don’t care.
Instruction
Input Format
Operation
Byte 1
Byte 2
Byte 3
Programming Enable
1010 1100
0101 0011
xxxx xxxx
Enable serial programming interface after RST goes
high.
Chip Erase
1010 1100
xxxx x100
xxxx xxxx
Chip erase the 12K memory array.
Read Code Memory
low addr
xxxx xxxx
Read data from Code memory array at the selected
address. The 6 MSBs of the first byte are the high order
address bits. The low order address bits are in the
second byte. Data are available at pin MISO during the
third byte.
Write Code Memory
low addr
data in
Write data to Code memory location at selected
address. The address bits are the 6 MSBs of the first
byte together with the second byte.
Write Lock Bits
1010 1100
xxxx xxxx
Write lock bits.
Set LB1, LB2 or LB3 = “0” to program lock bits.
LB
1
LB
2
LB
3
Serial Programming Algorithm
To program and verify the AT89LS53 in the serial program-
ming mode, the following sequence is recommended:
1.
Power-up sequence:
Apply power between V
CC
and GND pins.
Set RST pin to “H”.
If a crystal is not connected across pins XTAL1 and
XTAL2, apply a 3 MHz to 12 MHz clock to XTAL1 pin
and wait for at least 10 milliseconds.
2.
Enable serial programming by sending the Pro-
gramming Enable serial instruction to pin MOSI/
P1.5. The frequency of the shift clock supplied at
pin SCK/P1.7 needs to be less than the CPU clock
at XTAL1 divided by 40.
3.
The Code array is programmed one byte at a time
by supplying the address and data together with the
appropriate Write instruction. The selected memory
location is first automatically erased before new
data is written. The write cycle is self-timed and typ-
ically takes less than 2.5 ms at 5V and less than 10
ms at 2.7V.
4.
Any memory location can be verified by using the
Read instruction which returns the content at the
selected address at serial output MISO/P1.6.
5.
At the end of a programming session, RST can be
set low to commence normal operation.
Power-off sequence (if needed):
Set XTAL1 to “L” (if a crystal is not used).
Set RST to “L”.
Turn V
CC
power off.
Serial Programming Instruction
The Instruction Set for Serial Programming follows a 3-byte
protocol and is shown in the following table:
A12 A11
A10
A9
A8
A13
01
A1
2
A1
1
A1
0
A9
A8
A1
3
10
x x111