欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC16F873A-I/SP 参数 Datasheet PDF下载

PIC16F873A-I/SP图片预览
型号: PIC16F873A-I/SP
PDF下载: 下载PDF文件 查看货源
内容描述: 40分之28引脚增强型闪存微控制器 [28/40-pin Enhanced FLASH Microcontrollers]
分类和应用: 闪存微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 222 页 / 3815 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16F873A-I/SP的Datasheet PDF文件第34页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第35页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第36页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第37页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第39页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第40页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第41页浏览型号PIC16F873A-I/SP的Datasheet PDF文件第42页  
PIC16F87XA  
An example of the complete four-word write sequence  
is shown in Example 3-4. The initial address is loaded  
into the EEADRH:EEADR register pair; the four words  
of data are loaded using indirect addressing.  
EXAMPLE 3-4:  
WRITING TO FLASH PROGRAM MEMORY  
; This write routine assumes the following:  
;
; 1. A valid starting address (the least significant bits = ‘00’)is loaded in ADDRH:ADDRL  
; 2. The 8 bytes of data are loaded, starting at the address in DATADDR  
; 3. ADDRH, ADDRL and DATADDR are all located in shared data memory 0x70 - 0x7f  
;
BSF  
BCF  
STATUS,RP1  
STATUS,RP0  
ADDRH,W  
EEADRH  
ADDRL,W  
EEADR  
DATAADDR,W  
FSR  
INDF,W  
EEDATA  
FSR,F  
INDF,W  
EEDATH  
;
; Bank 2  
; Load initial address  
;
;
MOVF  
MOVWF  
MOVF  
MOVWF  
MOVF  
MOVWF  
MOVF  
MOVWF  
INCF  
MOVF  
MOVWF  
INCF  
BSF  
BSF  
BSF  
BCF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
;
; Load initial data address  
;
; Load first data byte into lower  
;
; Next byte  
; Load second data byte into upper  
;
;
; Bank 3  
; Point to program memory  
; Enable writes  
; Disable interrupts (if using)  
; Start of required write sequence:  
; Write 55h  
LOOP  
FSR,F  
STATUS,RP0  
EECON1,EEPGD  
EECON1,WREN  
INTCON,GIE  
55h  
EECON2  
AAh  
EECON2  
EECON1,WR  
;
; Write AAh  
; Set WR bit to begin write  
; Any instructions here are ignored as processor  
; halts to begin write sequence  
; processor will stop here and wait for write complete  
; after write processor continues with 3rd instruction  
; Disable writes  
; Enable interrupts (if using)  
; Bank 2  
; Increment address  
; Check if lower two bits of address are ‘00’  
; Indicates when four words have been programmed  
;
; Exit if more than four words,  
; Continue if less than four words  
NOP  
NOP  
BCF  
BSF  
BCF  
INCF  
MOVF  
ANDLW  
XORLW  
BTFSC  
GOTO  
EECON1,WREN  
INTCON,GIE  
STATUS,RP0  
EEADR,F  
EEADR,W  
0x03  
0x03  
STATUS,Z  
LOOP  
DS39582A-page 36  
Advance Information  
2001 Microchip Technology Inc.  
 复制成功!