English
Language : 

PIC16F753 Datasheet, PDF (30/238 Pages) Microchip Technology – 14/16-Pin, Flash-Based 8-Bit CMOS Microcontrollers
PIC16F753/HV753
3.4 Reading the Flash Program
Memory
To read a program memory location, the user must
write two bytes of the address to the PMADRL and
PMADRH registers, and then set control bit RD
(PMCON1<0>). Once the read control bit is set, the
program memory Flash controller will use the second
instruction cycle after to read the data. This causes the
second instruction immediately following the “BSF
PMCON1,RD” instruction to be ignored. The data is
available in the very next cycle in the PMDATL and
PMDATH registers; it can be read as two bytes in the
following instructions. PMDATL and PMDATH regis-
ters will hold this value until another read or until it is
written to by the user (during a write operation).
EXAMPLE 3-1: FLASH PROGRAM READ
BANKSEL
MOVLW
MOVWF
MOVLW
MOVWF
BANKSEL
BSF
PM_ADR
; Change STATUS bits RP1:0 to select bank with PMADRL
MS_PROG_PM_ADDR ;
PMADRH
; MS Byte of Program Address to read
LS_PROG_PM_ADDR ;
PMADRL
; LS Byte of Program Address to read
PMCON1
; Bank to containing PMCON1
PMCON1, RD
; PM Read
NOP
; First instruction after BSF PMCON1,RD executes normally
NOP
BANKSEL PMDATL
MOVF
PMDATL, W
MOVF
PMDATH, W
; Any instructions here are ignored as program
; memory is read in second cycle after BSF PMCON1,RD
;
; Bank to containing PMADRL
; W = LS Byte of Program PMDATL
; W = MS Byte of Program PMDATL
DS40001709A-page 30
Preliminary
 2013 Microchip Technology Inc.