English
Language : 

PIC16F87-E Datasheet, PDF (33/228 Pages) Microchip Technology – 18/20/28-Pin Enhan lashMicrocontrollers with nanoWatt Technology
PIC16F87/88
EXAMPLE 3-4: ERASING A FLASH PROGRAM MEMORY ROW
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
ERASE_ROW
BANKSEL
BSF
BSF
BSF
;
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BCF
BCF
BSF
EEADRH
ADDRH, W
EEADRH
ADDRL, W
EEADR
EECON1
EECON1, EEPGD
EECON1, WREN
EECON1, FREE
INTCON, GIE
55h
EECON2
AAh
EECON2
EECON1, WR
EECON1, FREE
EECON1, WREN
INTCON, GIE
; Select Bank of EEADRH
;
; MS Byte of Program Address to Erase
;
; LS Byte of Program Address to Erase
; Select Bank of EECON1
; Point to PROGRAM memory
; Enable Write to memory
; Enable Row Erase operation
; Disable interrupts (if using)
;
; Write 55h
;
; Write AAh
; Start Erase (CPU stall)
; Any instructions here are ignored as processor
; halts to begin Erase sequence
; processor will stop here and wait for Erase complete
; after Erase processor continues with 3rd instruction
; Disable Row Erase operation
; Disable writes
; Enable interrupts (if using)
 2005 Microchip Technology Inc.
DS30487C-page 31