
2009 Microchip Technology Inc.
DS39636D-page 79
PIC18F2X1X/4X1X
EXAMPLE 6-1:
READING A FLASH PROGRAM MEMORY WORD
TABLE 6-2:
REGISTERS ASSOCIATED WITH READING PROGRAM FLASH MEMORY
MOVLW
CODE_ADDR_UPPER
; Load TBLPTR with the base
MOVWF
TBLPTRU
; address of the word
MOVLW
CODE_ADDR_HIGH
MOVWF
TBLPTRH
MOVLW
CODE_ADDR_LOW
MOVWF
TBLPTRL
READ_WORD
TBLRD*+
; read into TABLAT and increment
MOVF
TABLAT, W
; get data
MOVWF
WORD_EVEN
TBLRD*+
; read into TABLAT and increment
MOVF
TABLAT, W
; get data
MOVF
WORD_ODD
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Valueson
Page
TBLPTRU
—
bit 21
Program Memory Table Pointer Upper Byte
(TBLPTR<20:16>)
TBPLTRH
Program Memory Table Pointer High Byte (TBLPTR<15:8>)
TBLPTRL
Program Memory Table Pointer Low Byte (TBLPTR<7:0>)
TABLAT
Program Memory Table Latch
Legend: — = unimplemented, read as ‘0’. Shaded cells are not used during Flash access.