English
Language : 

PIC18F44J50-I Datasheet, PDF (107/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers
PIC18F46J50 FAMILY
7.3 Reading the Flash Program
Memory
The TBLRD instruction is used to retrieve data from
program memory and places it into data RAM. Table
reads from program memory are performed one byte at
a time.
TBLPTR points to a byte address in program space.
Executing TBLRD places the byte pointed to into
TABLAT. In addition, TBLPTR can be modified
automatically for the next table read operation.
The internal program memory is typically organized by
words. The LSb of the address selects between the high
and low bytes of the word.
Figure 7-4 illustrates the interface between the internal
program memory and the TABLAT.
FIGURE 7-4:
READS FROM FLASH PROGRAM MEMORY
Program Memory
(Even Byte Address) (Odd Byte Address)
Instruction Register
(IR)
FETCH
TBLPTR = xxxxx1
TBLPTR = xxxxx0
TBLRD
TABLAT
Read Register
EXAMPLE 7-1: READING A FLASH PROGRAM MEMORY WORD
READ_WORD
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
CODE_ADDR_UPPER
TBLPTRU
CODE_ADDR_HIGH
TBLPTRH
CODE_ADDR_LOW
TBLPTRL
TBLRD*+
MOVF TABLAT, W
MOVWF WORD_EVEN
TBLRD*+
MOVF TABLAT, W
MOVWF WORD_ODD
; Load TBLPTR with the base
; address of the word
; read into TABLAT and increment
; get data
; read into TABLAT and increment
; get data
 2011 Microchip Technology Inc.
DS39931D-page 107