English
Language : 

ATA6614Q_14 Datasheet, PDF (248/311 Pages) ATMEL Corporation – 32K Flash Microcontroller with LIN Transceiver, 5V Regulator and Watchdog
Rdloop:
lpm
ld
cpse
rjmp
sbiw
brne
r0, Z+
r1, Y+
r0, r1
Error
loophi:looplo, 1
Rdloop
;use subi for PAGESIZEB<=256
;
;
Return:
in
sbrs
ready
ret
;
ldi
rcall
rjmp
return to RWW section
verify that RWW section is safe to read
temp1, SPMCSR
temp1, RWWSB
; If RWWSB is set, the RWW section is not
yet
re-enable the RWW section
spmcrval, (1<<RWWSRE) | (1<<SELFPRGEN)
Do_spm
Return
Do_spm:
;
Wait_spm:
in
sbrc
rjmp
;
;
in
cli
;
Wait_ee:
sbic
rjmp
;
out
spm
;
out
ret
check for previous SPM complete
temp1, SPMCSR
temp1, SELFPRGEN
Wait_spm
input: spmcrval determines SPM action
disable interrupts if enabled, store status
temp2, SREG
check that no EEPROM write access is present
EECR, EEPE
Wait_ee
SPM timed sequence
SPMCSR, spmcrval
restore SREG (to enable interrupts if originally enabled)
SREG, temp2
248 ATA6614Q [DATASHEET]
9240H–AUTO–10/14