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

PIC18F2320-I/SP 参数 Datasheet PDF下载

PIC18F2320-I/SP图片预览
型号: PIC18F2320-I/SP
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚高性能,增强型闪存微控制器与10位A / D和纳瓦技术 [28/40/44-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology]
分类和应用: 闪存微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 388 页 / 6899 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F2320-I/SP的Datasheet PDF文件第76页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第77页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第78页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第79页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第81页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第82页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第83页浏览型号PIC18F2320-I/SP的Datasheet PDF文件第84页  
PIC18F2220/2320/4220/4320  
EXAMPLE 6-3:  
WRITING TO FLASH PROGRAM MEMORY  
MOVLW  
D'64  
; number of bytes in erase block  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
COUNTER  
BUFFER_ADDR_HIGH  
FSR0H  
BUFFER_ADDR_LOW  
FSR0L  
CODE_ADDR_UPPER  
TBLPTRU  
CODE_ADDR_HIGH  
TBLPTRH  
CODE_ADDR_LOW  
TBLPTRL  
; point to buffer  
; Load TBLPTR with the base  
; address of the memory block  
; 6 LSB = 0  
READ_BLOCK  
TBLRD*+  
MOVFW  
; read into TABLAT, and inc  
; get data  
TABLAT  
MOVWF  
DECFSZ COUNTER  
POSTINC0  
; store data and increment FSR0  
; done?  
GOTO  
READ_BLOCK  
; repeat  
MODIFY_WORD  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
DATA_ADDR_HIGH  
FSR0H  
DATA_ADDR_LOW  
FSR0L  
NEW_DATA_LOW  
POSTINC0  
NEW_DATA_HIGH  
INDF0  
; point to buffer  
; update buffer word and increment FSR0  
; update buffer word  
ERASE_BLOCK  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BCF  
BSF  
BSF  
BSF  
BCF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
CODE_ADDR_UPPER  
TBLPTRU  
CODE_ADDR_HIGH  
TBLPTRH  
CODE_ADDR_LOW  
TBLPTRL  
EECON1,CFGS  
EECON1,EEPGD  
EECON1,WREN  
EECON1,FREE  
INTCON,GIE  
55h  
; load TBLPTR with the base  
; address of the memory block  
; 6 LSB = 0  
; point to PROG/EEPROM memory  
; point to Flash program memory  
; enable write to memory  
; enable Row Erase operation  
; disable interrupts  
; Required sequence  
; write 55H  
EECON2  
AAh  
EECON2  
EECON1,WR  
; write AAH  
; start erase (CPU stall)  
NOP  
BSF  
INTCON,GIE  
; re-enable interrupts  
WRITE_BUFFER_BACK  
MOVLW  
8
; number of write buffer groups of 8 bytes  
; point to buffer  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
COUNTER_HI  
BUFFER_ADDR_HIGH  
FSR0H  
BUFFER_ADDR_LOW  
FSR0L  
PROGRAM_LOOP  
MOVLW  
MOVWF  
8
; number of bytes in holding register  
COUNTER  
WRITE_WORD_TO_HREGS  
MOVFW  
MOVWF  
TBLWT+*  
POSTINC0  
TABLAT  
; get low byte of buffer data and increment FSR0  
; present data to table latch  
; short write  
; to internal TBLWT holding register, increment  
TBLPTR  
DECFSZ COUNTER  
GOTO WRITE_WORD_TO_HREGS  
; loop until buffers are full  
DS39599C-page 78  
2003 Microchip Technology Inc.  
 复制成功!