PIC18F2420-I/SOC01 Microchip, PIC18F2420-I/SOC01 Datasheet - Page 307

no-image

PIC18F2420-I/SOC01

Manufacturer Part Number
PIC18F2420-I/SOC01
Description
28 pin, 16 kb flash, 3804 ram, 25 i/o...
Manufacturer
Microchip
Datasheet
TBLRD
Syntax:
Operands:
Operation:
Status Affected: None
Encoding:
Description:
Words:
Cycles:
© 2008 Microchip Technology Inc.
Q Cycle Activity:
operation
Decode
Q1
No
Table Read
TBLRD ( *; *+; *-; +*)
None
if TBLRD *,
(Prog Mem (TBLPTR)) → TABLAT,
TBLPTR – No Change;
if TBLRD *+,
(Prog Mem (TBLPTR)) → TABLAT,
(TBLPTR) + 1 → TBLPTR;
if TBLRD *-,
(Prog Mem (TBLPTR)) → TABLAT,
(TBLPTR) – 1 → TBLPTR;
if TBLRD +*,
(TBLPTR) + 1 → TBLPTR,
(Prog Mem (TBLPTR)) → TABLAT
This instruction is used to read the contents
of Program Memory (P.M.). To address the
program memory, a pointer called Table
Pointer (TBLPTR) is used.
The TBLPTR (a 21-bit pointer) points to
each byte in the program memory. TBLPTR
has a 2-Mbyte address range.
The TBLRD instruction can modify the value
of TBLPTR as follows:
• no change
• post-increment
• post-decrement
• pre-increment
1
2
(Read Program
No operation
operation
0000
Memory)
TBLPTR<0> = 0:Least Significant Byte
TBLPTR<0> = 1:Most Significant Byte of
Q2
No
0000
operation
operation
Q3
No
No
of Program Memory
Word
Program Memory
Word
0000
(Write TABLAT)
No operation
operation
PIC18F2420/2520/4420/4520
nn=0 *
Q4
No
10nn
=1 *+
=2 *-
=3 +*
TBLRD
Example1:
Example2:
Before Instruction
After Instruction
Before Instruction
After Instruction
TABLAT
TBLPTR
MEMORY (00A356h)
TABLAT
TBLPTR
TABLAT
TBLPTR
MEMORY (01A357h)
MEMORY (01A358h)
TABLAT
TBLPTR
Table Read (Continued)
TBLRD
TBLRD
*+ ;
+* ;
=
=
=
=
=
=
=
=
=
=
=
DS39631E-page 305
55h
00A356h
34h
34h
00A357h
AAh
01A357h
12h
34h
34h
01A358h

Related parts for PIC18F2420-I/SOC01