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

PIC18F4431-I/P 参数 Datasheet PDF下载

PIC18F4431-I/P图片预览
型号: PIC18F4431-I/P
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚增强型闪存微控制器采用纳瓦技术,高性能PWM和A / D [28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High-Performance PWM and A/D]
分类和应用: 闪存微控制器
文件页数/大小: 392 页 / 3127 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F4431-I/P的Datasheet PDF文件第86页浏览型号PIC18F4431-I/P的Datasheet PDF文件第87页浏览型号PIC18F4431-I/P的Datasheet PDF文件第88页浏览型号PIC18F4431-I/P的Datasheet PDF文件第89页浏览型号PIC18F4431-I/P的Datasheet PDF文件第91页浏览型号PIC18F4431-I/P的Datasheet PDF文件第92页浏览型号PIC18F4431-I/P的Datasheet PDF文件第93页浏览型号PIC18F4431-I/P的Datasheet PDF文件第94页  
PIC18F2331/2431/4331/4431  
8.4.1  
FLASH PROGRAM MEMORY  
ERASE SEQUENCE  
8.4  
Erasing Flash Program Memory  
The minimum erase block is 32 words or 64 bytes.  
Larger blocks of program memory can be bulk erased  
only through the use of an external programmer or  
ICSP control. 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 the Table Pointer with the address of the  
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.  
2. Set the EECON1 register for the erase  
operation:  
- set the EEPGD bit to point to program memory;  
- clear the CFGS bit to access program memory;  
- set the WREN bit to enable writes;  
- set the FREE bit to enable the erase.  
3. Disable interrupts.  
The EECON1 register commands the erase operation.  
The EEPGD bit (EECON1<7>) must be set to point to  
the Flash program memory. The WREN bit  
(EECON1<2>) must be set to enable write operations.  
The FREE bit (EECON1<4>) is set to select an erase  
operation.  
4. Write 55h to EECON2.  
5. Write 0AAh to EECON2.  
6. Set the WR bit. This will begin the row erase  
cycle.  
For protection, the write initiate sequence using  
EECON2 must be used.  
7. The CPU will stall for the duration of the erase  
(about 2 ms using internal timer).  
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.  
8. Execute a NOP.  
9. Re-enable interrupts.  
EXAMPLE 8-2:  
ERASING A FLASH PROGRAM MEMORY ROW  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
CODE_ADDR_UPPER  
TBLPTRU  
CODE_ADDR_HIGH  
TBLPTRH  
CODE_ADDR_LOW  
TBLPTRL  
; load TBLPTR with the base  
; address of the memory block  
ERASE_ROW  
BSF  
BCF  
BSF  
BSF  
EECON1, EEPGD  
EECON1, CFGS  
EECON1, WREN  
EECON1, FREE  
INTCON, GIE  
55h  
EECON2  
0AAh  
EECON2  
EECON2, WR  
; point to Flash program memory  
; access Flash program memory  
; enable write to memory  
; enable Row Erase operation  
; disable interrupts  
BCF  
MOVLW  
MOVWF  
MOVLW  
MOVWF  
BSF  
; write 55H  
Required  
Sequence  
; write 0AAH  
; start erase (CPU stall)  
NOP  
BSF  
INTCON, GIE  
; re-enable interrupts  
DS39616D-page 90  
2010 Microchip Technology Inc.  
 复制成功!