at90pwm81-16se ATMEL Corporation, at90pwm81-16se Datasheet - Page 256

no-image

at90pwm81-16se

Manufacturer Part Number
at90pwm81-16se
Description
8-bit Avr Microcontroller With 8k Bytes In- System Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
22.7.4
256
AT90PWM81
Programming the Flash
The Flash is organized in pages, see
data is latched into a page buffer. This allows one page of program data to be programmed simultane-
ously. 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. Load Data High Byte
E. Latch Data
F. Repeat B through E until the entire buffer is filled or until all data within the page is loaded.
While the lower bits in the address are mapped to words within the page, the higher bits address the pages
within the FLASH. This is illustrated in
required to address words in the page (pagesize < 256), the most significant bit(s) in the address low byte
are used to address the page when performing a Page Write.
G. Load Address High byte
H. Program Page
I. Repeat B through H until the entire Flash is programmed or until all data has been programmed.
1.
2.
3.
4.
1.
2.
3.
4.
1.
2.
3.
1.
2.
3.
4.
1.
2.
1.
2.
3.
4.
1.
2.
Set XA1, XA0 to “10”. This enables command loading.
Set BS1 to “0”.
Set DATA to “0001 0000”. This is the command for Write Flash.
Give XTAL1 a positive pulse. This loads the command.
Set XA1, XA0 to “00”. This enables address loading.
Set BS1 to “0”. This selects low address.
Set DATA = Address low byte (0x00 - 0xFF).
Give XTAL1 a positive pulse. This loads the address low byte.
Set XA1, XA0 to “01”. This enables data loading.
Set DATA = Data low byte (0x00 - 0xFF).
Give XTAL1 a positive pulse. This loads the data byte.
Set BS1 to “1”. This selects high data byte.
Set XA1, XA0 to “01”. This enables data loading.
Set DATA = Data high byte (0x00 - 0xFF).
Give XTAL1 a positive pulse. This loads the data byte.
Set BS1 to “1”. This selects high data byte.
Give PAGEL a positive pulse. This latches the data bytes. (See
waveforms)
Set XA1, XA0 to “00”. This enables address loading.
Set BS1 to “1”. This selects high address.
Set DATA = Address high byte (0x00 - 0xFF).
Give XTAL1 a positive pulse. This loads the address high byte.
Give WR a negative pulse. This starts programming of the entire page of data. RDY/BSY goes
low.
Wait until RDY/BSY goes high (See
Table 22-11 on page
Figure 22-2 on page
Figure 22-3
for signal waveforms).
254. When programming the Flash, the program
257. Note that if less than eight bits are
Figure 22-3
for signal
7734M–AVR–03/10

Related parts for at90pwm81-16se