dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
6.0
PROGRAMMING THE
PROGRAMMING EXECUTIVE
TO MEMORY
Overview
Storing the programming executive to executive
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
If it is determined that the programming executive is not
present in executive memory (as described in
Section 3.2 鈥淐onfirming the Presence of the Pro-
gramming Executive鈥?,
it must be programmed into
executive memory using ICSP, as described in
Section 5.0 鈥淒evice Programming 鈥?ICSP鈥?
TABLE 6-1:
Command
(Binary)
PROGRAMMING THE PROGRAMMING EXECUTIVE
Data
(Hex)
Description
Step 1:
Exit Reset vector and erase executive memory.
0000
0000
0000
0000
0000
0000
0000
0000
0000
-
000000
000000
040200
000000
24072A
883B0A
A8E761
000000
000000
-
NOP
NOP
GOTO
NOP
MOV
MOV
0x200
Step 2:
Initialize the NVMCON to erase a page of executive memory.
#0x4042, W10
W10, NVMCON
Step 3:
Initiate the erase cycle, wait for erase to complete and make sure WR bit is clear.
BSET
NVMCON, #15
NOP
NOP
Externally time 鈥楶12鈥?msec (see
Section TABLE 8-1: 鈥淎C/DC
Characteristics and Timing Requirements鈥?
to allow suffi-
cient time for the Page Erase operation to complete.
MOV
NVMCON, W0
MOV
W0, VISI
NOP
Clock out contents of VISI register. Repeat until the WR bit
is clear.
0000
0000
0000
0001
807600
887840
000000
<VISI>
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
0000
0000
0000
0000
24001A
883B0A
200800
880190
EB0380
000000
MOV
MOV
MOV
MOV
CLR
NOP
#0x4001, W10
W10, NVMCON
#0x80, W0
W0, TBLPAG
W7
Step 6:
Initialize TBLPAG and the write pointer (W7).
DS70152D-page 68
Preliminary
漏
2007 Microchip Technology Inc.