atmega163l ATMEL Corporation, atmega163l Datasheet - Page 147

no-image

atmega163l

Manufacturer Part Number
atmega163l
Description
Atmega163 8-bit Avr Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
atmega163l-4AI
Manufacturer:
ATMEL
Quantity:
984
Programming the Flash
1142E–AVR–02/03
3. Set DATA to “1000 0000”. This is the command for Chip Erase.
4. Give WR a negative pulse. This starts the Chip Erase. RDY/BSY goes low.
5. Wait until RDY/BSY goes high before loading a new command.
The Flash is organized as 128 pages of 128 bytes each. When programming the Flash,
the program data is latched into a page buffer. This allows one page of program data to
be programmed simultaneously. The following procedure describes how to program the
entire Flash memory:
A. Load Command “Write Flash”
B. Load Address Low Byte
C. Load Data Low Byte
D. Latch Data Low Byte
E. Load Data High Byte
F. Latch Data High Byte
G. Repeat B through F 64 times to fill the page buffer.
To address a page in the Flash, seven bits are needed (128 pages). The five most sig-
nificant 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”.
1. Set XA1, XA0 to “10”. This enables command loading.
2. Set BS1 to “0”.
3. Set DATA to “0001 0000”. This is the command for Write Flash.
4. Give XTAL1 a positive pulse. This loads the command.
1. Set XA1, XA0 to “00”. This enables address loading.
2. Set BS1 to “0”. This selects low address.
3. Set DATA = Address Low Byte ($00 - $FF).
4. Give XTAL1 a positive pulse. This loads the address 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.
1. Set BS1 to “0”. This selects Low Data Byte.
2. Give PAGEL a positive pulse. This latches the data Low Byte.
1. Set BS1 to “1”. This selects High Data Byte.
2. Set XA1, XA0 to “01”. This enables data loading.
3. Set DATA = Data High Byte ($00 - $FF).
4. Give XTAL1 a positive pulse. This loads the data byte.
1. Set BS1 to “1”. This selects High Data Byte.
2. Give PAGEL a positive pulse. This latches the data High Byte.
(See Figure 82 for signal waveforms)
ATmega163(L)
147

Related parts for atmega163l