Information
dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
DS70152H-page 44 © 2010 Microchip Technology Inc.
TABLE 5-7: SERIAL INSTRUCTION EXECUTION FOR WRITING CONFIGURATION REGISTERS
Command
(Binary)
Data
(Hex)
Description
Step 1: Exit the Reset vector.
0000
0000
0000
040200
040200
000000
GOTO 0x200
GOTO 0x200
NOP
Step 2: Initialize the write pointer (W7) for the TBLWT instruction.
0000 200007 MOV #0x0000, W7
Step 3: Set the NVMCON register to program one Configuration register.
0000
0000
24000A
883B0A
MOV #0x4000, W10
MOV W10, NVMCON
Step 4: Initialize the TBLPAG register.
0000
0000
200F80
880190
MOV #0xF8, W0
MOV W0, TBLPAG
Step 5: Load the Configuration register data to W6.
0000 2xxxx0 MOV #<CONFIG_VALUE>, W0
Step 6: Write the Configuration register data to the write latch and increment the write pointer.
0000
0000
0000
BB1B80
000000
000000
TBLWTL W0, [W7++]
NOP
NOP
Step 7: Initiate the write cycle.
0000
0000
0000
0000
0000
A8E761
000000
000000
000000
000000
BSET NVMCON, #WR
NOP
NOP
NOP
NOP
Step 8: Wait for the Configuration Register Write operation to complete and make sure WR bit is clear.
—
0000
0000
0000
0001
0000
0000
—
—
803B00
883C20
000000
<VISI>
040200
000000
—
Externally time ‘P20’ msec (see Section 8.0 “AC/DC Characteristics and
Timing Requirements”) to allow sufficient time for the Configuration Register
Write operation to complete.
MOV NVMCON, W0
MOV W0, VISI
NOP
Clock out contents of VISI register.
GOTO 0x200
NOP
Repeat until the WR bit is clear.
Step 9: Repeat steps 5-8 until all twelve Configuration registers are written.