English
Language : 

PIC16F193X Datasheet, PDF (333/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F193X/LF193X
23.4 Configuration Word and Device ID
Access
Instead of accessing program memory or EEPROM
data memory, the User ID’s, Device ID/Revision ID and
Configuration Words can be accessed when
CFGS = 1. This is the region that would be pointed to
by PC<15> = 1, but not all addresses are accessible.
Different access may exist for reads and writes. Refer
to Table 23-1.
When read access is initiated on an unallowed
address, the EEDATH:EEDATL registers are cleared.
Writes can be disabled via the WRT Configuration bits.
Refer to the Configuration Word 2 register.
TABLE 23-1: PFM AND FUSE ACCESS VIA EECON1/EEDATH:EEDATL REGISTERS
(WHEN CFGS = 1)
Address
Function
Read Access
Write Access
8000h-8003h
User IDs
Yes
Yes
8006h
Device ID/Revision ID
Yes
No
8007h-8008h
Configuration Words 1 and 2
Yes
No
EXAMPLE 23-3: CONFIGURATION WORD AND DEVICE ID ACCESS
* This code block will read 1 word of program
* memory at the memory address:
PROG_ADDR_HI : PROG_ADDR_LO
* data will be returned in the variables;
* PROG_DATA_HI, PROG_DATA_LO
BANKSEL
MOVLW
MOVWF
MOVLW
MOVWL
EEADRL
PROG_ADDR_LO
EEADRL
PROG_ADDR_HI
EEADRH
; Select Bank 2
;
; Store LSB of address
;
; Store MSB of address
BCF
EECON1,CFGS
; Deselect Configuration Space
BSF
EECON1,EEPGD
; Select Program Memory
BCF
INTCON,GIE
; Disable interrupts
BSF
EECON1,RD
; Initiate read
NOP
; Executed (Figure 23-1)
NOP
; Ignored (Figure 23-1)
BSF
INTCON,GIE
; Restore interrupts
MOVF
MOVWF
MOVF
MOVWF
EEDATL,W
PROG_DATA_LO
EEDATH,W
PROG_DATA_HI
; Get LSB of word
; Store in user location
; Get MSB of word
; Store in user location
© 2008 Microchip Technology Inc.
Preliminary
DS41364A-page 331