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

PIC18F8620-I/PT 参数 Datasheet PDF下载

PIC18F8620-I/PT图片预览
型号: PIC18F8620-I/PT
PDF下载: 下载PDF文件 查看货源
内容描述: 八十〇分之六十四引脚高性能1 Mbit的增强型闪存微控制器与A / D [64/80-Pin High Performance 1 Mbit Enhanced FLASH Microcontrollers with A/D]
分类和应用: 闪存微控制器和处理器外围集成电路PC时钟
文件页数/大小: 366 页 / 6797 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F8620-I/PT的Datasheet PDF文件第64页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第65页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第66页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第67页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第69页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第70页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第71页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第72页  
PIC18FXX20  
5.4.1  
FLASH PROGRAM MEMORY  
ERASE SEQUENCE  
5.4  
Erasing FLASH Program Memory  
The minimum erase block is 32 words or 64 bytes. Only  
through the use of an external programmer, or through  
ICSP control, can larger blocks of program memory be  
bulk erased. Word erase in the FLASH array is not  
supported.  
The sequence of events for erasing a block of internal  
program memory location is:  
1. Load table pointer with address of row being  
erased.  
When initiating an erase sequence from the micro-  
controller itself, a block of 64 bytes of program memory  
is erased. The Most Significant 16 bits of the  
TBLPTR<21:6> point to the block being erased.  
TBLPTR<5:0> are ignored.  
The EECON1 register commands the erase operation.  
The EEPGD bit must be set to point to the FLASH pro-  
gram memory. The WREN bit must be set to enable  
write operations. The FREE bit is set to select an erase  
operation.  
For protection, the write initiate sequence for EECON2  
must be used.  
A long write is necessary for erasing the internal  
FLASH. Instruction execution is halted while in a long  
write cycle. The long write will be terminated by the  
internal programming timer.  
2. Set the EECON1 register for the erase operation:  
• set EEPGD bit to point to program memory;  
• clear the CFGS bit to access program memory;  
• set WREN bit to enable writes;  
• set FREE bit to enable the erase.  
3. Disable interrupts.  
4. Write 55h to EECON2.  
5. Write AAh to EECON2.  
6. Set the WR bit. This will begin the row erase  
cycle.  
7. The CPU will stall for duration of the erase  
(about 2 ms using internal timer).  
8. Execute a NOP.  
9. Re-enable interrupts.  
EXAMPLE 5-2:  
ERASING A FLASH PROGRAM MEMORY ROW  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
CODE_ADDR_UPPER  
TBLPTRU  
; load TBLPTR with the base  
; address of the memory block  
CODE_ADDR_HIGH  
TBLPTRH  
CODE_ADDR_LOW  
TBLPTRL  
ERASE_ROW  
BSF  
BCF  
BSF  
BSF  
EECON1,EEPGD  
EECON1,CFGS  
EECON1,WREN  
EECON1,FREE  
INTCON,GIE  
55h  
EECON2  
AAh  
EECON2  
EECON1,WR  
; point to FLASH program memory  
; access FLASH program memory  
; enable write to memory  
; enable Row Erase operation  
; disable interrupts  
BCF  
Required  
Sequence  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
; write 55H  
; write AAH  
; start erase (CPU stall)  
NOP  
BSF  
INTCON,GIE  
; re-enable interrupts  
DS39609A-page 66  
Advance Information  
2003 Microchip Technology Inc.