beautypg.com

3 command format, Figure 23-2 – Rainbow Electronics AT89LP216 User Manual

Page 67

background image

67

3621A–MICRO–6/06

AT89LP216 [Preliminary]

Figure 23-2. AT89LP216 Memory Organization

23.3

Command Format

Programming commands consist of an opcode byte, two address bytes, and zero or more data
bytes. In addition, all command packets must start with a two-byte preamble of AAH and 55H.
The preamble increases the noise immunity of the programming interface by making it more dif-
ficult to issue unintentional commands.

Figure 23-3 on page 68

shows a simplified flow chart of

a command sequence.

A sample command packet is shown in

Figure 23-4 on page 68

. The SS pin defines the packet

frame. SS must be brought low before the first byte in a command is sent and brought back high
after the final byte in the command has been sent. The command is not complete until SS
returns high. Command bytes are issued serially on MOSI. Data output bytes are received seri-
ally on MISO. Packets of variable length are supported by returning SS high when the final
required byte has been transmitted. In some cases command bytes have a don’t care value.
Don’t care bytes in the middle of a packet must be transmitted. Don’t care bytes at the end of a
packet may be ignored.

Page oriented instructions always include a full 16-bit address. The higher order bits select the
page and the lower order bits select the byte within that page. The AT89LP216 allocates 5 bits
for byte address and 6 bits for page address. The page to be accessed is always fixed by the
page address as transmitted. The byte address specifies the starting address for the first data
byte. After each data byte has been transmitted, the byte address is incremented to point to the
next data byte. This allows a page command to linearly sweep the bytes within a page. If the
byte address is incremented past the last byte in the page, the byte address will roll over to the
first byte in the same page. While loading bytes into the page buffer, overwriting previously
loaded bytes will result in data corruption.

For a summary of available commands, see

Table 23-2 on page 69

.

Page 0

Page 1

Page 63

Page 62

Page 0

Page 0

Page 0

User Fuse Row

User Signature Array

Atmel Signature Array

Code Memory

Page 1

00

1F

0000

07FF