English
Language : 

PIC18FXXK80 Datasheet, PDF (20/52 Pages) Microchip Technology – Flash Microcontroller Programming Specification
PIC18FXXK80 FAMILY
TABLE 3-9: SINGLE ROW 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 7F
9C 7F
84 7F
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 TBLPTRU
CLRF TBLPTRH
CLRF TBLPTRL
Step 3: Enable erase and erase single row.
0000
0000
0000
88 7F
82 7F
00 00
BSF EECON1, FREE
BSF EECON1, WR
NOP – hold PGC high for time P9 and low for time P10.
Step 4: Repeat Step 3 with Address Pointer incremented by 64 until all rows are erased.
FIGURE 3-3:
SINGLE ROW ERASE CODE MEMORY FLOW
Start
Addr = 0
Configure
Device for
Row Erases
Addr = Addr + 64
Start Erase Sequence
and Hold PGC High
for Time P9
Hold PGC Low
for Time P10
No
All
rows
done?
Yes
Done
DS39972B-page 20
 2011 Microchip Technology Inc.