Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual
Page 460

460
8266A-MCU Wireless-12/09
ATmega128RFA1
Assembly Code Example
(
1
)
; If RWWSB is set, the RWW section is not ready yet
sbrs temp1, RWWSB
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
Notes:
"About Code Examples" on page 7
30.6.14 Boot Loader Parameters for 128kByte of Flash Memory
, the parameters used in the
description of the Self-Programming are given.
Table 30-5. Read-While-Write Limit with 128kByte of Flash Memory
Section
(1)
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 sections see
"NRWW – No Read-While-Write Section"