English
Language : 

PIC18FXXK80 Datasheet, PDF (21/52 Pages) Microchip Technology – Flash Microcontroller Programming Specification
PIC18FXXK80 FAMILY
3.2 Code Memory Programming
Programming code memory is accomplished by first
loading data into the write buffer and then initiating a
programming sequence. The write and erase buffer
sizes, shown in Table 3-10, can be mapped to any
location of the same size beginning at 000000h. The
actual memory write sequence takes the contents of
this buffer and programs the proper amount of code
memory that contains the Table Pointer.
The programming duration is externally timed and is
controlled by PGC. After a Start Programming
command is issued (4-bit command, ‘1111’), a NOP is
issued, where the 4th PGC is held high for the duration
of the programming time, P9.
After PGC is brought low, the programming sequence
is terminated. PGC must be held low for the time
specified by Parameter P10 to allow high-voltage
discharge of the memory array.
The code sequence to program a PIC18FXXK80 family
device is shown in Table 3-11. The flowchart, shown in
Figure 3-6, depicts the logic necessary to completely
write a PIC18FXXK80 family device. The timing
diagram that details the Start Programming command,
and Parameters P9 and P10 is shown in Figure 3-4.
Note:
The TBLPTR register must point to the
same region when initiating the program-
ming sequence as it did when the write
buffers were loaded.
TABLE 3-10: WRITE AND ERASE
BUFFER SIZES
All Devices
Write Buffer Size Erase Buffer
in Bytes
Size in Bytes
PIC18FXXK80
64
64
FIGURE 3-4:
TABLE WRITE AND START PROGRAMMING INSTRUCTION TIMING (‘1111’)
PGC
12 3 4
12 34 56
P5
15 16
123
P5A
P9(1)
P10
4
123
PGD 1 1 1 1
4-Bit Command
nnnn nn
nn
0000
16-Bit Data Payload
4-bit Command Programming Time
PGD = Input
000
16-Bit
Data Payload
Note 1: Use P9A for User ID and Configuration Word programming.
 2011 Microchip Technology Inc.
DS39972B-page 21