atmega163l ATMEL Corporation, atmega163l Datasheet - Page 142

no-image

atmega163l

Manufacturer Part Number
atmega163l
Description
Atmega163 8-bit Avr Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
atmega163l-4AI
Manufacturer:
ATMEL
Quantity:
984
142
ATmega163(L)
Wrloop:
Rdloop:
Return:
Do_spm:
Wait_ee:
Wait_spm:
; re-enable the Application Section
; transfer data from RAM to Flash page buffer
; execute page write
; re-enable the Application Section
; read back and check, optional
; return to Application Section
; verify that Application Section is safe to read
; re-enable the Applicaiton Section
; input: spmcrval determines SPM action
; check that no EEPROM write access is running
; SPM timed sequence
; check for SPM complete
ldi
call
ldi
ldi
ld
ld
ldi
call
adiw
sbiw
brne
subi
sbci
ldi
call
ldi
call
ldi
ldi
subi
sbci
lpm
ld
cpse
jmp
sbiw
brne
in
sbrs
ret
ldi
call
rjmp
sbic
rjmp
out
spm
.dw $FFFF
nop
in
spmcrval, (1<<ASRE) + (1<<SPMEN)
Do_spm
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
r0, Y+
r1, Y+
spmcrval, (1<<SPMEN)
Do_spm
ZH:ZL, 2
loophi:looplo, 2
Wrloop
ZL, low(PAGESIZEB)
ZH, high(PAGESIZEB)
spmcrval, (1<<PGWRT) + (1<<SPMEN)
Do_spm
spmcrval, (1<<ASRE) + (1<<SPMEN)
Do_spm
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
YL, low(PAGESIZEB)
YH, high(PAGESIZEB)
r0, Z+
r1, Y+
r0, r1
Error
loophi:looplo, 1
Rdloop
temp1, SPMCR
temp1, ASB
spmcrval, (1<<ASRE) + (1<<SPMEN)
Do_spm
Return
EECR, EEWE
Wait_ee
SPMCR, spmcrval
temp1, SPMCR
;restore pointer
;use subi for PAGESIZEB<=256
; If ASB is set, the AS is not ready yet
; ensure proper pipelining
; of next instruction
;init loop variable
;not required for PAGESIZEB<=256
;use subi for PAGESIZEB<=256
;restore pointer
;not required for PAGESIZEB<=256
;init loop variable
;not required for PAGESIZEB<=256
1142E–AVR–02/03

Related parts for atmega163l