AT90CAN128-16AE ATMEL Corporation, AT90CAN128-16AE Datasheet - Page 316

no-image

AT90CAN128-16AE

Manufacturer Part Number
AT90CAN128-16AE
Description
8-bit Avr Microcontroller With 128K Bytes of Isp Flash And CAN Controller.flash (Kbytes) 128 Vcc (V) 2.7-5.5 EEPROM (Kbytes) 4 SRAM (bytes) 4K CAN (mess. Obj.) 15
Manufacturer
ATMEL Corporation
Datasheet
Self-Programming the
Flash
316
AT90CAN128
RAMPZ - REGISTER
the address. Since this instruction addresses the Flash byte by byte, also the LSB (bit
Z0) of the Z-pointer is used.
Figure 152. Addressing the Flash During SPM
Note:
The program memory is updated in a page by page fashion. Before programming a
page with the data stored in the temporary page buffer, the page must be erased. The
temporary page buffer is filled one word at a time using SPM and the buffer can be filled
either before the Page Erase command or between a Page Erase and a Page Write
operation:
Alternative 1: fill the buffer before a Page Erase
Alternative 2: fill the buffer after Page Erase
If only a part of the page needs to be changed, the rest of the page must be stored (for
example in the temporary page buffer) before the erase, and then be rewritten. When
using alternative 1, the Boot Loader provides an effective Read-Modify-Write feature
which allows the user software to first read the page, do the necessary changes, and
then write back the modified data. If alternative 2 is used, it is not possible to read the
old data while loading since the page is already erased. The temporary page buffer can
be accessed in a random sequence. It is essential that the page address used in both
7
Fill temporary page buffer
Perform a Page Erase
Perform a Page Write
Perform a Page Erase
Fill temporary page buffer
Perform a Page Write
PROGRAM MEMORY
1. The different variables used in Figure 152 are listed in Table 120 on page 322.
PAGE
PROGRAM
COUNTER
1
PCMSB
15
0
ZPCMSB
15
within the FLASH
PAGE address
PCPAGE
(1)
ZPAGEMSB
PAGEMSB
INSTRUCTION WORD
PCWORD
PAGE
WORD address
within a PAGE
1
0
0
0
Z - REGISTER
PCWORD [PAGEMSB:0]:
00
01
02
PAGEEND
4250C–CAN–03/04

Related parts for AT90CAN128-16AE