atmega323l ATMEL Corporation, atmega323l Datasheet - Page 190

no-image

atmega323l

Manufacturer Part Number
atmega323l
Description
Atmega323 8-bit Avr Microcontroller With 32k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Enter Programming Mode
Chip Erase
Programming the Flash
190
ATmega323(L)
Table 66. Command Byte Bit Coding
The following algorithm puts the device in Parallel Programming mode:
1. Apply 4.5 - 5.5V between V
2. Set RESET and BS1 pins to “0” and wait at least 100 ns.
3. Apply 11.5 - 12.5V to RESET. Any activity on BS1 within 100 ns after +12V has
The Chip Erase command will erase the Flash and EEPROM memories and the Lock
bits. The Lock bits are not reset until the Program memory has been completely erased.
The Fuse bits are not changed. A Chip Erase must be performed before the Flash is
reprogrammed.
Load Command “Chip Erase”
1. Set XA1, XA0 to “10”. This enables command loading.
2. Set BS1 to “0”.
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 256 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
been applied to RESET, will cause the device to fail entering programming mode.
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.
Command Byte
1000 0000
0100 0000
0010 0000
0001 0000
0001 0001
0000 1000
0000 0100
0000 0010
0000 0011
Command Executed
Chip Erase
Write Fuse bits
Write Lock bits
Write Flash
Write EEPROM
Read Signature Bytes
Read Fuse and Lock bits
Read Flash
Read EEPROM
CC
and GND.
1457G–AVR–09/03

Related parts for atmega323l