English
Language : 

ATMEGA165V_09 Datasheet, PDF (244/336 Pages) ATMEL Corporation – 8-bit Microcontroller with 16K Bytes In-System Programmable Flash
ATmega165/V
ATmega165 Boot Loader
Parameters
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, EEWE
rjmp Wait_ee
; SPM timed sequence
out SPMCSR, spmcrval
spm
; restore SREG (to enable interrupts if originally enabled)
out SREG, temp2
ret
In Table 96 through Table 98, the parameters used in the description of the Self-Pro-
gramming are given.
Table 96. Boot Size Configuration(1)
2573G–AVR–07/09
1
1
128
2
0x0000 - 0x1F80 - 0x1F7F 0x1F80
words
0x1F7F 0x1FFF
1
0
256
4
0x0000 - 0x1F00 - 0x1EFF 0x1F00
words
0x1EFF 0x1FFF
0
1
512
8
0x0000 - 0x1E00 - 0x1DFF 0x1E00
words
0x1DFF 0x1FFF
0
0
1024
16
0x0000 - 0x1C00 - 0x1BFF 0x1C00
words
0x1BFF 0x1FFF
Note: 1. The different BOOTSZ Fuse configurations are shown in Figure 109
Table 97. Read-While-Write Limit(1)
Section
Read-While-Write section (RWW)
No Read-While-Write section (NRWW)
Pages
112
16
Address
0x0000 - 0x1BFF
0x1C00 - 0x1FFF
Note: 1. For details about these two section, see “NRWW – No Read-While-Write Section” on
page 233 and “RWW – Read-While-Write Section” on page 233.
244