atmega161-4pi ATMEL Corporation, atmega161-4pi Datasheet - Page 122

no-image

atmega161-4pi

Manufacturer Part Number
atmega161-4pi
Description
8-bit Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Programming the EEPROM
122
ATmega161(L)
The programming algorithm for the EEPROM Data memory is as follows (refer to “Pro-
gramming the Flash” for details on command, address and data loading):
1. A: Load Command “0001 0001”.
2. H: Load Address High Byte ($00 - $01)
3. B: Load Address Low Byte ($00 - $FF)
4. E: Load Data Low Byte ($00 - $FF)
L: Write Data Low Byte
1. Set BS to “0”. This selects low data.
2. Give WR a negative pulse. This starts programming of the data byte. RDY/BSY
3. Wait until to RDY/BSY goes high before programming the next byte.
The loaded command and address are retained in the device during programming. For
efficient programming, the following should be considered:
These considerations also apply to Flash, EEPROM and Signature bytes reading.
Figure 78. Programming the EEPROM Waveforms
RDY/BSY
RESET
PAGEL
XTAL1
DATA
goes low.
(See Figure 78 for signal waveforms.)
The command needs to be loaded only once when writing or reading multiple
memory locations.
Address High byte only needs to be loaded before programming a new 256-word
page in the EEPROM.
Skip writing the data value $FF, that is, the contents of the entire EEPROM after a
Chip Erase.
XA1
XA2
BS1
BS2
WR
OE
+12V
$11
ADDR. HIGH
ADDR. LOW
DATA LOW
1228D–AVR–02/07

Related parts for atmega161-4pi