English
Language : 

PIC18FXXK80 Datasheet, PDF (23/52 Pages) Microchip Technology – Flash Microcontroller Programming Specification
PIC18FXXK80 FAMILY
3.2.1 PROGRAMMING
A maximum of 64 bytes can be programmed into the
block referenced by TBLPTR<21:6>. The panel that
will be written will automatically be enabled based on
the value of the Table Pointer.
TABLE 3-11: WRITE CODE MEMORY CODE SEQUENCE FOR PROGRAMMING
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 row to be written.
0000
0000
0000
0000
0000
0000
0E <Addr[21:16]> MOVLW <Addr[21:16]>
6E F8
MOVWF TBLPTRU
0E <Addr[15:8]> MOVLW <Addr[15:8]>
6E F7
MOVWF TBLPTRH
0E <Addr[7:0]> MOVLW <Addr[7:0]>
6E F6
MOVWF TBLPTRL
Step 3: Load write buffer for panel. Repeat for all but the last two bytes. Any unused locations should be filled with
FFFFh.
1101
.
.
<MSB><LSB>
.
.
Write 2 bytes and post-increment address by 2.
.
Repeat 31 times.
Step 4: Load write buffer for last two bytes.
.
1111
0000
.
<MSB><LSB>
00 00
.
Write 2 bytes and start programming
NOP - hold SCLK high for time P9, low for time P10
To continue writing data, repeat Steps 3 and 4, where the Address Pointer is incremented by 64 at each iteration of
the loop.
 2011 Microchip Technology Inc.
DS39972B-page 23