Datasheet

349
ATmega16U4/32U4 [DATASHEET]
Atmel-7766J-USB-ATmega16U4/32U4-Datasheet_04/2016
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, SPMCSR
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, EEPE
rjmp Wait_ee
; SPM timed sequence
out SPMCSR, spmcrval
spm
; restore SREG (to enable interrupts if originally enabled)
out SREG, temp2
ret
27.7.14 Boot Loader Parameters
The parameters used in the description of the Self-Programming are given throughout the following tables.
Note: 1. The different BOOTSZ Fuse configurations are shown in Figure 27-2 on page 338
Table 27-8. Boot Size Configuration (Word Addresses)
(1)
Device
BOOTSZ1
BOOTSZ0
Boot Size
Pages
Application
Flash Section
Boot Loader
Flash Section
End
Application
Section
Boot
Reset Address
(Start Boot
Loader Section)
ATmega32U4
1 1 256 words 4 0x0000 - 0x3EFF 0x3F00 - 0x3FFF 0x3EFF 0x3F00
1 0 512 words 8 0x0000 - 0x3DFF 0x3E00 - 0x3FFF 0x3DFF 0x3E00
0 1 1024 words 16 0x0000 - 0x3BFF 0x3C00 - 0x3FFF 0x3BFF 0x3C00
0 0 2048 words 32 0x0000 - 0x37FF 0x3800 - 0x3FFF 0x37FF 0x3800
ATmega16U4
1 1 256 words 4 0x0000 - 0x1EFF 0x1F00 - 0x1FFF 0x1EFF 0x1F00
1 0 512 words 8 0x0000 - 0x1DFF 0x1E00 - 0x1FFF 0x1DFF 0x1E00
0 1 1024 words 16 0x0000 - 0x1BFF 0x1C00 - 0x1FFF 0x1BFF 0x1C00
0 0 2048 words 32 0x0000 - 0x17FF 0x1800 - 0x1FFF 0x17FF 0x1800