dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
Storing the programming executive to executive
6.0
PROGRAMMING THE
PROGRAMMING EXECUTIVE
TO MEMORY
memory is similar to normal programming of code
memory. Namely, the executive memory must first be
erased, and then the programming executive must be
programmed 64 words at a time. This control flow is
summarized in Table 6-1.
6.1
Overview
If it is determined that the programming executive is not
present in executive memory (as described in
Section 3.2 “Confirming the Presence of the Pro-
gramming Executive”), it must be programmed into
executive memory using ICSP, as described in
Section 5.0 “Device Programming – ICSP”.
TABLE 6-1:
PROGRAMMING THE PROGRAMMING EXECUTIVE
Command
(Binary)
Data
(Hex)
Description
Step 1: Exit Reset vector and erase executive memory.
0000
0000
0000
0000
000000
000000
040200
000000
NOP
NOP
GOTO
NOP
0x200
Step 2: Initialize the NVMCON to erase a page of executive memory.
0000
0000
24072A
883B0A
MOV
MOV
#0x4042, W10
W10, NVMCON
Step 3: Initiate the erase cycle, wait for erase to complete and make sure WR bit is clear.
0000
0000
0000
-
A8E761
000000
000000
-
BSET
NOP
NOP
NVMCON, #15
Externally time ‘P12’ msec (see Section TABLE 8-1: “AC/DC
Characteristics and Timing Requirements”) to allow suffi-
cient time for the Page Erase operation to complete.
0000
0000
0000
0001
807600
887840
000000
<VISI>
MOV
MOV
NOP
NVMCON, W0
W0, VISI
Clock out contents of VISI register. Repeat until the WR bit
is clear.
Step 4: Repeat Step 3 four times to erase all four pages of executive memory.
Step 5: Initialize the NVMCON to program 64 instruction words.
0000
0000
24001A
883B0A
MOV
MOV
#0x4001, W10
W10, NVMCON
Step 6: Initialize TBLPAG and the write pointer (W7).
0000
0000
0000
0000
200800
880190
EB0380
000000
MOV
MOV
CLR
NOP
#0x80, W0
W0, TBLPAG
W7
DS70152D-page 68
Preliminary
© 2007 Microchip Technology Inc.