English
Language : 

PIC18LF2X Datasheet, PDF (15/44 Pages) Microchip Technology – 28/40/44-Pin, Low-Power, High-Performance Microcontrollers with XLP Technology
PIC18(L)F2X/4XK50
TABLE 3-3: ERASE CODE MEMORY CODE SEQUENCE
4-bit
Command
Data Payload
Core Instruction
Step 1: Direct access to code memory and enable writes.
0000
0000
0000
8E A6
9C A6
84 A6
BSF EECON1, EEPGD
BCF EECON1, CFGS
BSF EECON1, WREN
Step 2: Point to first row in code memory.
0000
0000
0000
6A F8
6A F7
6A F6
CLRF
CLRF
CLRF
TBLPTRU
TBLPTRH
TBLPTRL
Step 3: Enable erase and erase single row.
0000
0000
0000
0000
88 A6
82 A6
00 00
00 00
BSF EECON1, FREE
BSF EECON1, WR
NOP
NOP Erase starts on the 4th clock of this instruction
Step 4: Poll WR bit. Repeat until bit is clear.
0000
0000
0000
0010
50 A6
6E F5
00 00
<MSB><LSB>
MOVF EECON1, W, 0
MOVWF TABLAT
NOP
Shift out data(1)
Step 5: Hold PGC low for time P10.
Step 6: Repeat Step 3 with Address Pointer incremented by 64 until all rows are erased.
Step 7: Disable writes.
0000
94 A6
BCF EECON1, WREN
Note 1: See Figure 4-4 for details on shift out data timing.
 2012 Microchip Technology Inc.
DS41630B-page 15