English
Language : 

PIC18LF2XK22 Datasheet, PDF (12/42 Pages) Microchip Technology – Flash Memory Programming Specification
PIC18(L)F2XK22/4XK22
2.7 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.7.1 4-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
Table 2-6.
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-7. The 4-bit
command is shown Most Significant bit (MSb) first. The
command operand, or “Data Payload”, is shown
<MSB><LSB>. Figure 2-16 demonstrates how to
serially present a 20-bit command/operand to the
device.
2.7.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-6: COMMANDS FOR
PROGRAMMING
Description
Core Instruction
(Shift in16-bit instruction)
Shift out TABLAT register
Table Read
Table Read, post-increment
Table Read, post-decrement
Table Read, pre-increment
Table Write
Table Write, post-increment by 2
Table Write, start programming,
post-increment by 2
Table Write, start programming
4-Bit
Command
0000
0010
1000
1001
1010
1011
1100
1101
1110
1111
TABLE 2-7: SAMPLE COMMAND
SEQUENCE
4-Bit
Data
Command Payload
Core Instruction
1101
3C 40 Table Write,
post-increment by 2
FIGURE 2-16:
TABLE WRITE, POST-INCREMENT TIMING DIAGRAM (1101)
PGC
PGD
P2
P2A
1234
P2B
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1234
P5
P5A
P4
P3
1011
0 00 000 10 001 1110 0
nnnn
4-bit Command
0
4
C
16-bit Data Payload
3
Fetch Next 4-bit Command
PGD = Input
DS41398B-page 12
Advance Information
 2010 Microchip Technology Inc.