English
Language : 

PIC18LF24K Datasheet, PDF (125/594 Pages) –
PIC18(L)F26/45/46K40
11.1.1 TABLE READS AND TABLE WRITES
In order to read and write program memory, there are
two operations that allow the processor to move bytes
between the program memory space and the data RAM:
• Table Read (TBLRD)
• Table Write (TBLWT)
The program memory space is 16 bits wide, while the
data RAM space is eight bits wide. Table reads and
table writes move data between these two memory
spaces through an 8-bit register (TABLAT).
The table read operation retrieves one byte of data
directly from program memory and places it into the
TABLAT register. Figure 11-1 shows the operation of a
table read.
The table write operation stores one byte of data from
the TABLAT register into a write block holding register.
The procedure to write the contents of the holding
registers into program memory is detailed in Section
11.1.6 “Writing to Program Flash Memory”.
Figure 11-2 shows the operation of a table write with
program memory and data RAM.
Table operations work with byte entities. Tables
containing data, rather than program instructions, are
not required to be word aligned. Therefore, a table can
start and end at any byte address. If a table write is being
used to write executable code into program memory,
program instructions will need to be word aligned.
FIGURE 11-1:
TABLE READ OPERATION
Instruction: TBLRD*
Table Pointer(1)
TBLPTRU TBLPTRH TBLPTRL
Program Memory
Table Latch (8-bit)
TABLAT
Program Memory
(TBLPTR)
Note 1: Table Pointer register points to a byte in program memory.
FIGURE 11-2:
TABLE WRITE OPERATION
Instruction: TBLWT*
Table Pointer(1)
TBLPTRU TBLPTRH TBLPTRL
Program Memory
Holding Registers
Table Latch (8-bit)
TABLAT
Program Memory
(TBLPTR<MSBs>)
Note
1: During table writes the Table Pointer does not point directly to program memory. The LSBs of TBLPRTL
actually point to an address within the write block holding registers. The MSBs of the Table Pointer deter-
mine where the write block will eventually be written. The process for writing the holding registers to the
program memory array is discussed in Section 11.1.6 “Writing to Program Flash Memory”.
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 125