English
Language : 

PIC18FXXK80 Datasheet, PDF (30/52 Pages) Microchip Technology – Flash Microcontroller Programming Specification
PIC18FXXK80 FAMILY
4.0 READING THE DEVICE
4.1 Read Code Memory, ID Locations
and Configuration Bits
Code memory is accessed, one byte at a time, via the
4-bit command, ‘1001’ (table read, post-increment).
The contents of memory pointed to by the Table Pointer
(TBLPTRU:TBLPTRH:TBLPTRL) are serially output on
PGD.
The 4-bit command is shifted in, LSb first. The read is
executed during the next 8 clocks, then shifted out on
PGD during the last 8 clocks, LSb to MSb. A delay of
P6 must be introduced after the falling edge of the 8th
PGC of the operand to allow PGD to transition from an
input to an output. During this time, PGC must be held
low (see Figure 4-1). This operation also increments
the Table Pointer by one, pointing to the next byte in
code memory for the next read.
This technique will work to read any memory in the
000000h to 3FFFFFh address space, so it also applies
to reading the ID and Configuration registers.
TABLE 4-1: READ CODE MEMORY SEQUENCE
4-Bit
Command
Data Payload
Step 1: Set Table Pointer.
0000
0000
0000
0000
0000
0000
0E <Addr[21:16]>
6E F8
0E <Addr[15:8]>
6E F7
0E <Addr[7:0]>
6E F6
MOVLW Addr[21:16]
MOVWF TBLPTRU
MOVLW <Addr[15:8]>
MOVWF TBLPTRH
MOVLW <Addr[7:0]>
MOVWF TBLPTRL
Step 2: Read memory and then shift out on PGD, LSb to MSb.
1001
00 00
TBLRD *+
Core Instruction
FIGURE 4-1:
TABLE READ, POST-INCREMENT INSTRUCTION TIMING (‘1001’)
PGC
1234
12 3 45 6 78
9 10 11 12 13 14 15 16
1 2 34
P5
P6
P5A
P14
PGD 1 0 0 1
PGD = Input
LSb 1 2 3 4 5 6 MSb n n n n
Shift Data Out
PGD = Output
Fetch Next 4-Bit Command
PGD = Input
DS39972B-page 30
 2011 Microchip Technology Inc.