![Microchip Technology PIC12F1501 Скачать руководство пользователя страница 94](http://html1.mh-extra.com/html/microchip-technology/pic12f1501/pic12f1501_manual_1785833094.webp)
2011-2015 Microchip Technology Inc.
DS40001609E-page 95
PIC16(L)F1508/9
EXAMPLE 10-2:
ERASING ONE ROW OF PROGRAM MEMORY
; This row erase routine assumes the following:
; 1. A valid address within the erase row is loaded in ADDRH:ADDRL
; 2. ADDRH and ADDRL are located in shared data memory 0x70 - 0x7F (common RAM)
BCF
INTCON,GIE
; Disable ints so required sequences will execute properly
BANKSEL
PMADRL
MOVF
ADDRL,W
; Load lower 8 bits of erase address boundary
MOVWF
PMADRL
MOVF
ADDRH,W
; Load upper 6 bits of erase address boundary
MOVWF
PMADRH
BCF
PMCON1,CFGS
; Not configuration space
BSF
PMCON1,FREE
; Specify an erase operation
BSF
PMCON1,WREN
; Enable writes
MOVLW
55h
; Start of required sequence to initiate erase
MOVWF
PMCON2 ;
Write
55h
MOVLW 0AAh
;
MOVWF
PMCON2 ;
Write
AAh
BSF
PMCON1,WR
; Set WR bit to begin erase
NOP
; NOP instructions are forced as processor starts
NOP
; row erase of program memory.
;
; The processor stalls until the erase process is complete
; after erase processor continues with 3rd instruction
BCF
PMCON1,WREN
; Disable writes
BSF
INTCON,GIE
; Enable interrupts
Required
Sequenc
e
Содержание 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...