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

PIC16LF1947-E/MR 参数 Datasheet PDF下载

PIC16LF1947-E/MR图片预览
型号: PIC16LF1947-E/MR
PDF下载: 下载PDF文件 查看货源
内容描述: [64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt XLP Technology]
分类和应用: 微控制器
文件页数/大小: 440 页 / 4740 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第113页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第114页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第115页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第116页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第118页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第119页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第120页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第121页  
PIC16F/LF1946/47  
EXAMPLE 11-5:  
WRITING TO FLASH PROGRAM MEMORY  
; This write routine assumes the following:  
; 1. The 16 bytes of data are loaded, starting at the address in DATA_ADDR  
; 2. Each word of data to be written is made up of two adjacent bytes in DATA_ADDR,  
;
stored in little endian format  
; 3. A valid starting address (the least significant bits = 000) is loaded in ADDRH:ADDRL  
; 4. ADDRH and ADDRL are located in shared data memory 0x70 - 0x7F  
;
BCF  
INTCON,GIE  
EEADRH  
ADDRH,W  
EEADRH  
ADDRL,W  
EEADRL  
; Disable ints so required sequences will execute properly  
; Bank 3  
; Load initial address  
;
;
;
BANKSEL  
MOVF  
MOVWF  
MOVF  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
LOW DATA_ADDR ; Load initial data address  
FSR0L  
HIGH DATA_ADDR ; Load initial data address  
;
FSR0H  
;
EECON1,EEPGD  
EECON1,CFGS  
EECON1,WREN  
EECON1,LWLO  
; Point to program memory  
; Not configuration space  
; Enable writes  
BCF  
BSF  
BSF  
; Only Load Write Latches  
LOOP  
MOVIW  
MOVWF  
MOVIW  
MOVWF  
FSR0++  
EEDATL  
FSR0++  
EEDATH  
; Load first data byte into lower  
;
; Load second data byte into upper  
;
MOVF  
EEADRL,W  
0x07  
0x07  
STATUS,Z  
START_WRITE  
; Check if lower bits of address are '000'  
; Check if we're on the last of 8 addresses  
;
; Exit if last of eight words,  
;
XORLW  
ANDLW  
BTFSC  
GOTO  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
55h  
EECON2  
0AAh  
EECON2  
EECON1,WR  
; Start of required write sequence:  
; Write 55h  
;
; Write AAh  
; Set WR bit to begin write  
NOP  
; Any instructions here are ignored as processor  
; halts to begin write sequence  
NOP  
; Processor will stop here and wait for write to complete.  
; After write processor continues with 3rd instruction.  
INCF  
GOTO  
EEADRL,F  
LOOP  
; Still loading latches Increment address  
; Write next latches  
START_WRITE  
BCF  
EECON1,LWLO  
; No more loading latches - Actually start Flash program  
; memory write  
MOVLW  
55h  
EECON2  
0AAh  
EECON2  
EECON1,WR  
; Start of required write sequence:  
; Write 55h  
;
MOVWF  
MOVLW  
MOVWF  
BSF  
; 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.  
NOP  
NOP  
; after write processor continues with 3rd instruction  
; Disable writes  
; Enable interrupts  
BCF  
BSF  
EECON1,WREN  
INTCON,GIE  
2010 Microchip Technology Inc.  
Preliminary  
DS41414A-page 115  
 复制成功!