;
;
return to RWW section
verify that RWW section is safe to read
Return:
in
temp1, SPMCSR
sbrs
temp1, RWWSB
If RWWSB is set, the RWW section is not
ready yet
ret
;
re-enable the RWW section
ldi
call
rjmp
spmcrval, (1<<RWWSRE) | (1<<SPMEN)
Do_spm
Return
Do_spm:
;
Wait_spm:
in
check for previous SPM complete
temp1, SPMCSR
sbrc
temp1, SPMEN
rjmp
;
;
in
cli
;
Wait_spm
input: spmcrval determines SPM action
disable interrupts if enabled, store status
temp2, SREG
check that no EEPROM write access is present
Wait_ee:
sbic
rjmp
;
out
spm
;
EECR, EEPE
Wait_ee
SPM timed sequence
SPMCSR, spmcrval
restore SREG (to enable interrupts if originally enabled)
SREG, temp2
out
ret
24.7.14 ATmega16/32/64/M1/C1 - 16K - Flash Boot Loader Parameters
In Table 24-7 through Table 24-9 on page 252, the parameters used in the description of the self programming are given.
Table 24-7. Boot Size Configuration, ATmega16/32/64/M1/C1 (16K Product)
Boot
Loader
Flash
Boot Reset
Address (Start
Boot Loader
Section)
Application
Flash
Section
End
Application
Section
Boot
BOOTSZ1
BOOTSZ0
Size(2)
Pages
Section
256
words
0x0000 -
0x1EFF
0x1F00 -
0x1FFF
1
1
4
0x1EFF
0x1DFF
0x1BFF
0x17FF
0x1F00
0x1E00
0x1C00
0x1800
512
words
0x0000 -
0x1DFF
0x1E00 -
0x1FFF
1
0
0
0
1
0
8
1024
words
0x0000 -
0x1BFF
0x1C00 -
0x1FFF
16
32
2048
words
0x1800 -
0x1FFF
0x0000 - 0x17FF
Notes: 1. The different BOOTSZ fuse configurations are shown in Figure 24-2 on page 243.
2. 1 word equals 2 bytes.
ATmega16/32/64/M1/C1 [DATASHEET]
251
7647O–AVR–01/15