dsPIC30F4012 Datasheet

  • dsPIC30F4012

  • High-Performance, 16-bit Digital Signal Controllers

  • 2035.22KB

  • 238页

  • Microchip   Microchip

扫码查看芯片数据手册

上传产品规格书

PDF预览

dsPIC30F2010
6.6
Programming Operations
4.
A complete programming sequence is necessary for
programming or erasing the internal Flash in RTSP
mode. A programming operation is nominally 2 msec in
duration and the processor stalls (waits) until the oper-
ation is finished. Setting the WR bit (NVMCON<15>)
starts the operation, and the WR bit is automatically
cleared when the operation is finished.
Write 32 instruction words of data from data
RAM 鈥渋mage鈥?into the program Flash write
latches.
Program 32 instruction words into program
Flash.
a) Setup NVMCON register for multi-word,
program Flash, program and set WREN bit.
b) Write 鈥?5鈥?to NVMKEY.
c) Write 鈥楢A鈥?to NVMKEY.
d) Set the WR bit. This will begin program
cycle.
e) CPU will stall for duration of the program
cycle.
f) The WR bit is cleared by the hardware
when program cycle ends.
Repeat steps 1 through 5 as needed to program
desired amount of program Flash memory.
5.
6.6.1
PROGRAMMING ALGORITHM FOR
PROGRAM FLASH
The user can erase and program one row of program
Flash memory at a time. The general process is:
1.
Read one row of program Flash (32 instruction
words) and store into data RAM as a data
鈥渋mage鈥?
Update the data image with the desired new
data.
Erase program Flash row.
a) Setup NVMCON register for multi-word,
program Flash, erase and set WREN bit.
b) Write address of row to be erased into
NVMADRU/NVMDR.
c) Write 鈥?5鈥?to NVMKEY.
d) Write 鈥楢A鈥?to NVMKEY.
e) Set the WR bit. This will begin erase cycle.
f) CPU will stall for the duration of the erase
cycle.
g) The WR bit is cleared when erase cycle
ends.
6.
2.
3.
6.6.2
ERASING A ROW OF PROGRAM
MEMORY
Example 6-1 shows a code sequence that can be used
to erase a row (32 instructions) of program memory.
EXAMPLE 6-1:
ERASING A ROW OF PROGRAM MEMORY
write
; Setup NVMCON for erase operation, multi word
; program memory selected, and writes enabled
MOV
#0x4041,W0
;
;
MOV
W0
,
NVMCON
; Init pointer to row to be ERASED
MOV
#tblpage(PROG_ADDR),W0
;
;
MOV
W0
,
NVMADRU
MOV
#tbloffset(PROG_ADDR),W0
;
MOV
W0, NVMADR
;
DISI
#5
;
;
MOV
#0x55,W0
;
MOV
W0
,
NVMKEY
MOV
#0xAA,W1
;
;
MOV
W1
,
NVMKEY
BSET
NVMCON,#WR
;
NOP
;
NOP
;
Init NVMCON SFR
Initialize PM Page Boundary SFR
Intialize in-page EA[15:0] pointer
Intialize NVMADR SFR
Block all interrupts with priority <7
for next 5 instructions
Write the 0x55 key
Write the 0xAA key
Start the erase sequence
Insert two NOPs after the erase
command is asserted
2006 Microchip Technology Inc.
DS70118G-page 45

dsPIC30F4012相关型号PDF文件下载

您可能感兴趣的PDF文件资料

热门IC型号推荐

扫码下载APP,
一键连接广大的电子世界。

在线人工客服

买家服务:
卖家服务:
技术客服:

0571-85317607

网站技术支持

13606545031

客服在线时间周一至周五
9:00-17:30

关注官方微信号,
第一时间获取资讯。

建议反馈
返回顶部

建议反馈

联系人:

联系方式:

按住滑块,拖拽到最右边
>>
感谢您向阿库提出的宝贵意见,您的参与是维库提升服务的动力!意见一经采纳,将有感恩红包奉上哦!