DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AT90USB128X データシートの表示(PDF) - Atmel Corporation

部品番号
コンポーネント説明
メーカー
AT90USB128X
Atmel
Atmel Corporation Atmel
AT90USB128X Datasheet PDF : 28 Pages
First Prev 21 22 23 24 25 26 27 28
;**************************************************************************
**
flash_prg_page:
RCALL WAIT_SPMEN ;Wait for SPMEN flag cleared
MOV
R31,R17
MOV
R30,R16
;move adress to z pointer (R31=ZH R30=ZL)
OUT
RAMPZ, R18
LDI
R20,$05
;(1<<PGWRT) + (1<<SPMEN))
OUT SPMCSR,R20; argument 2 decides function (r18)
SPM
;Store program memory
RCALL WAIT_SPMEN ;Wait for SPMEN flag cleared
RCALL flash_rww_enable
RET
;*F************************************************************************
**
; NAME: flash_page_erase
;--------------------------------------------------------------------------
--
; PARAMS: R18:17:R16: The byte address of the page
;--------------------------------------------------------------------------
--
; PURPOSE: Launch the erase sequence of the target page
;--------------------------------------------------------------------------
--
; NOTE: This function does nt set the RWWSE bit after erase. Thus it does
not
; erase the hardware temporary temp buffer.
; This function is for bootloader usage
;--------------------------------------------------------------------------
--
; REQUIREMENTS:
;**************************************************************************
**
flash_page_erase:
RCALL WAIT_SPMEN ;Wait for SPMEN flag cleared
MOV
R31,R17
MOV
R30,R16
;move adress to z pointer (R31=ZH R30=ZL)
OUT
RAMPZ, R18
LDI
R20,$03
;(1<<PGERS) + (1<<SPMEN)))
OUT SPMCSR, R20; argument 2 decides function (r18)
SPM
;Store program memory
RCALL WAIT_SPMEN ;Wait for SPMEN flag cleared
;RCALL flash_rww_enable CAUTION DO NOT ACTIVATE HERE or
;
you will loose the entire page buffer content !!!
RET
22
7618C–AVR–07/08

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]