PIC24FV16KM204 FAMILY
DS33030A-page 72
Advance Information
2013 Microchip Technology Inc.
EXAMPLE 5-5:
INITIATING A PROGRAMMING SEQUENCE – ASSEMBLY LANGUAGE CODE
EXAMPLE 5-6:
INITIATING A PROGRAMMING SEQUENCE – ‘C’ LANGUAGE CODE
DISI
#5
; Block all interrupts
for next 5 instructions
MOV
#0x55, W0
MOV
W0, NVMKEY
; Write the 55 key
MOV #0xAA, W1
;
MOV
W1, NVMKEY
; Write the AA key
BSET
NVMCON, #WR
; Start the erase sequence
NOP
; 2 NOPs required after setting WR
NOP
;
BTSC
NVMCON, #15
; Wait for the sequence to be completed
BRA $-2
;
// C example using MPLAB C30
asm("DISI #5");
// Block all interrupts for next 5 instructions
__builtin_write_NVM();
// Perform unlock sequence and set WR
Summary of Contents for PIC24FV16KM204 FAMILY
Page 312: ...PIC24FV16KM204 FAMILY DS33030A page 312 Advance Information 2013 Microchip Technology Inc ...
Page 313: ... 2013 Microchip Technology Inc Advance Information DS33030A page 313 PIC24FV16KM204 FAMILY ...
Page 315: ... 2013 Microchip Technology Inc Advance Information DS33030A page 315 PIC24FV16KM204 FAMILY ...
Page 316: ...PIC24FV16KM204 FAMILY DS33030A page 316 Advance Information 2013 Microchip Technology Inc ...
Page 317: ... 2013 Microchip Technology Inc Advance Information DS33030A page 317 PIC24FV16KM204 FAMILY ...
Page 322: ...PIC24FV16KM204 FAMILY DS33030A page 322 Advance Information 2013 Microchip Technology Inc ...