Microchip Technology MCU PIC10F322T-I/OT SOT-23-6 MCP PIC10F322T-I/OT データシート

製品コード
PIC10F322T-I/OT
ページ / 210
PIC10(L)F320/322
DS41585A-page 68
Preliminary
 2011 Microchip Technology Inc.
9.4
User ID, Device ID and 
Configuration Word Access
Instead of accessing program memory, the User ID’s,
Device ID/Revision ID and Configuration Word can be
accessed when CFGS = 1 in the PMCON1 register.
This is the region that would be pointed to by
PC<13> = 1, but not all addresses are accessible.
Different access may exist for reads and writes. Refer
to 
When read access is initiated on an address outside
the parameters listed in 
PMDATH:PMDATL register pair is cleared, reading
back ‘0’s.
TABLE 9-2:
USER ID, DEVICE ID AND CONFIGURATION WORD ACCESS (CFGS = 1)
EXAMPLE 9-4:
CONFIGURATION WORD AND DEVICE ID ACCESS
Address
Function
Read Access
Write Access
2000h-2003h
User IDs
Yes
Yes
2006h
Device ID/Revision ID
Yes
No
2007h
Configuration Word
Yes
No
* This code block will read 1 word of program memory at the memory address:
*
PROG_ADDR_LO (must be 00h-08h) data will be returned in the variables;
*
PROG_DATA_HI, PROG_DATA_LO
BANKSEL
PMADRL
; not required on devices with 1 Bank of SFRs
MOVLW
PROG_ADDR_LO
MOVWF
PMADRL
; Store LSB of address
CLRF
PMADRH
; Clear MSB of address
    
BSF
PMCON1,CFGS
; Select Configuration Space 
BCF
INTCON,GIE
; Disable interrupts
BSF
PMCON1,RD
; Initiate read
NOP
NOP
; Ignored (See 
BSF
INTCON,GIE
; Restore interrupts
MOVF
PMDATL,W
; Get LSB of word
MOVWF
PROG_DATA_LO
; Store in user location
MOVF
PMDATH,W
; Get MSB of word
MOVWF
PROG_DATA_HI
; Store in user location