
PIC18F2XJXX/4XJXX FAMILY
DS39687E-page 8
2009 Microchip Technology Inc.
FIGURE 2-7:
EXITING
PROGRAM/VERIFY MODE
2.5
Serial Program/Verify Operation
The PGC pin is used as a clock input pin and the PGD
pin is used for entering command bits and data
input/output during serial operation. Commands and
data are transmitted on the rising edge of PGC, latched
on the falling edge of PGC and are Least Significant bit
(LSb) first.
2.5.1
FOUR-BIT COMMANDS
All instructions are 20 bits, consisting of a leading 4-bit
command followed by a 16-bit operand, which depends
on the type of command being executed. To input a
command, PGC is cycled four times. The commands
needed for programming and verification are shown in
Depending on the 4-bit command, the 16-bit operand
represents 16 bits of input data or 8 bits of input data
and 8 bits of output data.
Throughout this specification, commands and data are
presented as illustrated in
Table 2-4. The 4-bit command
is shown Most Significant bit (MSb) first. The command
operand, or “Data Payload”, is shown <MSB><LSB>.
Figure 2-8 demonstrates how to serially present a 20-bit
command/operand to the device.
2.5.2
CORE INSTRUCTION
The core instruction passes a 16-bit instruction to the
CPU core for execution. This is needed to set up
registers as appropriate for use with other commands.
TABLE 2-3:
COMMANDS FOR
PROGRAMMING
TABLE 2-4:
SAMPLE COMMAND
SEQUENCE
FIGURE 2-8:
TABLE WRITE, POST-INCREMENT TIMING (1101)
MCLR
P16
PGD
PGD = Input
PGC
VDD
VIH
P17
Description
4-Bit
Command
Core Instruction
(Shift in 16-bit instruction)
0000
Shift out TABLAT register
0010
Table Read
1000
Table Read, Post-Increment
1001
Table Read, Post-Decrement
1010
Table Read, Pre-Increment
1011
Table Write
1100
Table Write, Post-Increment by 2
1101
Table Write, Start Programming,
Post-Increment by 2
1110
Table Write, Start Programming
1111
4-Bit
Command
Data
Payload
Core Instruction
1101
3C 40
Table Write,
post-increment by 2
12
3
4
PGC
P5
PGD
PGD = Input
56
7
8
1
234
P5A
9
10 11
13
15
16
14
12
Fetch Next 4-Bit Command
10
1
12
3
4
nn
n
P3
P2
P2A
00
0
10
0
1
0
04
C
3
P4
4-Bit Command
16-Bit Data Payload
P2B