![Microchip Technology PIC12F1501 Скачать руководство пользователя страница 100](http://html1.mh-extra.com/html/microchip-technology/pic12f1501/pic12f1501_manual_1785833100.webp)
2011-2015 Microchip Technology Inc.
DS40001609E-page 101
PIC16(L)F1508/9
10.4
User ID, Device ID and
Configuration Word Access
Instead of accessing program memory, the User ID’s,
Device ID/Revision ID and Configuration Words can be
accessed when CFGS =
1
in the PMCON1 register.
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
.
When read access is initiated on an address outside
the parameters listed in
, the
PMDATH:PMDATL register pair is cleared, reading
back ‘
0
’s.
TABLE 10-2:
USER ID, DEVICE ID AND CONFIGURATION WORD ACCESS (CFGS =
1
)
EXAMPLE 10-4:
CONFIGURATION WORD AND DEVICE ID ACCESS
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
* 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
; Select correct Bank
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
; Executed (See
)
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
Содержание PIC12F1501
Страница 307: ...PIC16 L F1508 9 DS40001609E page 308 2011 2015 Microchip Technology Inc NOTES...
Страница 392: ...2011 2015 Microchip Technology Inc DS40001609E page 393 PIC16 L F1508 9 1RWH 6 7 7 588 8 7...
Страница 399: ...PIC16 L F1508 9 DS40001609E page 400 2011 2015 Microchip Technology Inc NOTES...