Datasheet
257
2466T–AVR–07/10
ATmega16(L)
sbrs temp1, RWWSB ; If RWWSB is set, the RWW section is not
; ready yet
ret
; re-enable the RWW section
ldi spmcrval, (1<<RWWSRE) | (1<<SPMEN)
call Do_spm
rjmp Return
Do_spm:
; check for previous SPM complete
Wait_spm:
in temp1, SPMCR
sbrc temp1, SPMEN
rjmp Wait_spm
; input: spmcrval 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 SPMCR, spmcrval
spm
; restore SREG (to enable interrupts if originally enabled)
out SREG, temp2
ret
ATmega16 Boot
Loader Parameters
In Table 100 through Table 102, the parameters used in the description of the self programming
are given.
Note: 1. The different BOOTSZ Fuse configurations are shown in Figure 125
Note: 1. For details about these two section, see “NRWW – No Read-While-Write Section” on page
247 and “RWW – Read-While-Write Section” on page 247
Table 100. Boot Size Configuration
(1)
BOOTSZ1 BOOTSZ0
Boot
Size Pages
Application
Flash
Section
Boot
Loader
Flash
Section
End
Application
section
Boot Reset
Address
(start Boot
Loader
Section)
11
128
words
2
$0000 -
$1F7F
$1F80 -
$1FFF
$1F7F $1F80
10
256
words
4
$0000 -
$1EFF
$1F00 -
$1FFF
$1EFF $1F00
01
512
words
8
$0000 -
$1DFF
$1E00 -
$1FFF
$1DFF $1E00
00
1024
words
16
$0000 -
$1BFF
$1C00 -
$1FFF
$1BFF $1C00
Table 101. Read-While-Write Limit
(1)
Section Pages Address
Read-While-Write section (RWW) 112 $0000 - $1BFF
No Read-While-Write section (NRWW) 16 $1C00 - $1FFF