English
Language : 

MEGA128CAN Datasheet, PDF (323/413 Pages) ATMEL Corporation – Microcontroller WITH 128K BYTES OF ISP FLASH AND CAN CONTROLLER
AT90CAN128
AT90CAN128 Boot Loader
Parameters
ldi spmcsrval, (1<<RWWSRE) | (1<<SPMEN)
call Do_spm
rjmp Return
Do_spm:
; check for previous SPM complete
Wait_spm:
in temp1, SPMCSR
sbrc temp1, SPMEN
rjmp Wait_spm
; input: spmcsrval determines SPM action
; disable interrupts if enabled, store status
in temp2, SREG
cli
; check that no EEPROM write access is present
Wait_ee:
sbic EECR, EEWE
rjmp Wait_ee
; SPM timed sequence
out SPMCSR, spmcsrval
spm
; restore SREG (to enable interrupts if originally enabled)
out SREG, temp2
ret
In Table 119 through Table 121, the parameters used in the description of the Self-Pro-
gramming are given.
Table 119. Boot Size Configuration (Word Addresses)(1)
Boot
Size
Pages
Application
Flash Section
Boot
Loader
Flash
Section
End
Application
Section
Boot Reset
Address
(Start Boot
Loader
Section)
1
1
512
words
4
0x0000 -
0xFDFF
0xFE00 -
0xFFFF
0xFDFF
0xFE00
1
0
1024
words
8
0x0000 -
0xFBFF
0xFC00 -
0xFFFF
0xFBFF
0xFC00
0
1
2048
words
16
0x0000 -
0xF7FF
0xF800 -
0xFFFF
0xF7FF
0xF800
0
0
4096
words
32
0x0000 -
0xEFFF
0xF000 -
0xFFFF
0xEFFF
0xF000
Note: 1. The different BOOTSZ Fuse configurations are shown in Figure 154
Table 120. Read-While-Write Limit (Word Addresses)(1)
Section
Pages
Address
Read-While-Write section (RWW)
480
0x0000 - 0xEFFF
No Read-While-Write section (NRWW)
32
0xF000 - 0xFFFF
Note: 1. For details about these two section, see “NRWW – No Read-While-Write Section” on
page 312 and “RWW – Read-While-Write Section” on page 312.
4250E–CAN–12/04
323