Atmega163(l) – Rainbow Electronics ATmega163L User Manual
Page 127

ATmega163(L)
127
4.
Give XTAL1 a positive pulse. This loads the address low byte.
C. Load Data Low Byte
1.
Set XA1, XA0 to ‘01’. This enables data loading.
2.
Set DATA = Data low byte ($00 - $FF).
3.
Give XTAL1 a positive pulse. This loads the data byte.
D. Latch Data Low Byte
1.
Set BS1 to ‘0’. This selects low data byte.
2.
Give PAGEL a positive pulse. This latches the data low byte.
(See Figure 82 for signal waveforms)
E. Load Data High Byte
1.
Set XA1, XA0 to ‘01’. This enables data loading.
2.
Set DATA = Data high byte ($00 - $FF).
3.
Give XTAL1 a positive pulse. This loads the data byte.
F. Latch Data High Byte
1.
Set BS1 to ‘1’. This selects high data byte.
2.
Give PAGEL a positive pulse. This latches the data high byte.
G. Repeat B through F 64 times to fill the page buffer.
To address a page in the Flash, 7 bits are needed (128 pages). The 5 most significant bits are read from address high byte
as described in section ‘H’ below. The two least significant page address bits however, are the two most significant bits
(bit7 and bit6) of the latest loaded address low byte as described in section ‘B’.
H. Load Address High byte
1.
1. Set XA1, XA0 to ‘00’. This enables address loading.
2.
Set BS1 to '1'. This selects high address.
3.
Set DATA = Address high byte ($00 - $0F/$1F).
4.
Give XTAL1 a positive pulse. This loads the address high byte.
I. Program Page
1.
Give WR a negative pulse. This starts programming of the entire page of data. RDY/BSYgoes low.
2.
Wait until RDY/BSY goes high.
(See Figure 83 for signal waveforms)
J. End Page Programming
1.
Set XA1, XA0 to ‘10’. This enables command loading.
2.
Set DATA to ‘0000 0000’. This is the command for No Operation.
3.
Give XTAL1 a positive pulse. This loads the command, and the internal write signals are reset.
K. Repeat A through J 128 times or until all data has been programmed.