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

PIC16F818-I/P 参数 Datasheet PDF下载

PIC16F818-I/P图片预览
型号: PIC16F818-I/P
PDF下载: 下载PDF文件 查看货源
内容描述: 二十零分之一十八引脚增强型闪存微控制器采用纳瓦技术 [18/20-Pin Enhanced Flash Microcontrollers with nanoWatt Technology]
分类和应用: 闪存微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 176 页 / 2941 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16F818-I/P的Datasheet PDF文件第29页浏览型号PIC16F818-I/P的Datasheet PDF文件第30页浏览型号PIC16F818-I/P的Datasheet PDF文件第31页浏览型号PIC16F818-I/P的Datasheet PDF文件第32页浏览型号PIC16F818-I/P的Datasheet PDF文件第34页浏览型号PIC16F818-I/P的Datasheet PDF文件第35页浏览型号PIC16F818-I/P的Datasheet PDF文件第36页浏览型号PIC16F818-I/P的Datasheet PDF文件第37页  
PIC16F818/819  
An example of the complete four-word write sequence  
is shown in Example 3-5. The initial address is loaded  
into the EEADRH:EEADR register pair; the four words  
of data are loaded using indirect addressing, assuming  
that  
a row erase sequence has already been  
performed.  
EXAMPLE 3-5:  
WRITING TO FLASH PROGRAM MEMORY  
; This write routine assumes the following:  
; 1. The 32 words in the erase block have already been erased.  
; 2. A valid starting address (the least significant bits = '00') is loaded into EEADRH:EEADR  
; 3. This example is starting at 0x100, this is an application dependent setting.  
; 4. The 8 bytes (4 words) of data are loaded, starting at an address in RAM called ARRAY.  
; 5. This is an example only, location of data to program is application dependent.  
; 6. word_block is located in data memory.  
BANKSEL EECON1  
;prepare for WRITE procedure  
;point to program memory  
;allow write cycles  
BSF  
BSF  
BCF  
EECON1, EEPGD  
EECON1, WREN  
EECON1, FREE  
;perform write only  
BANKSEL word_block  
MOVLW  
MOVWF  
.4  
word_block  
;prepare for 4 words to be written  
;Start writing at 0x100  
;load HIGH address  
BANKSEL EEADRH  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
0x01  
EEADRH  
0x00  
EEADR  
;load LOW address  
BANKSEL ARRAY  
MOVLW  
MOVWF  
ARRAY  
FSR  
;initialize FSR to start of data  
LOOP  
BANKSEL EEDATA  
MOVF  
MOVWF  
INCF  
MOVF  
MOVWF  
INCF  
INDF, W  
EEDATA  
FSR, F  
INDF, W  
EEDATH  
FSR, F  
;indirectly load EEDATA  
;increment data pointer  
;indirectly load EEDATH  
;increment data pointer  
;required sequence  
BANKSEL EECON1  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
0x55  
EECON2  
0xAA  
EECON2  
EECON1, WR  
;set WR bit to begin write  
NOP  
;instructions here are ignored as processor  
NOP  
BANKSEL EEADR  
INCF  
EEADR, f  
;load next word address  
BANKSEL word_block  
DECFSZ  
GOTO  
word_block, f  
loop  
;have 4 words been written?  
;NO, continue with writing  
BANKSEL EECON1  
BCF  
BSF  
EECON1, WREN  
INTCON, GIE  
;YES, 4 words complete, disable writes  
;enable interrupts  
2004 Microchip Technology Inc.  
DS39598E-page 31