Re: FLASH MEMORY 問題
|
||||
---|---|---|---|---|
版主
|
最簡的的方式使用嵌入式組合語言(in-Line Assembly)
如何使用要看 C30 User's Guide 或參考 H 檔裡利用 In-Line Assembly 所建立的 Macro 方法。 語法 : asm(“assembly text”);
發表於: 2008/1/15 15:16
|
|||
|
Re: FLASH MEMORY 問題
|
||||
---|---|---|---|---|
中級會員
|
感謝版主回答
那麼再請問:使用24H的MCU, 以C為開發平台,如何在C中加入一組語? 謝謝!
發表於: 2008/1/15 15:13
|
|||
|
FLASH MEMORY 問題
|
||||
---|---|---|---|---|
中級會員
|
請問高手
小弟目前在寫PIC24H系列的FLASH MEMORY ERASE/WRITE 其中遇到一個問題,如下是 24HJ256GP610 SPEC P.58中的範例: "TBLWTL W0, [W0]" TBLWITL => 根本無這個暫存器 這段我要如何用C描述呢? -------------------------------; Set up NVMCON for block erase operation ---MOV #0x4042,W0-----; ---MOV W0,NVMCON------; Initialize NVMCON -------------------------------; Init pointer to row to be ERASED ---MOV #tblpage(PROG_ADDR),W0 ; ---MOV W0,TBLPAG ------; Initialize PM Page Boundary SFR -------------------------------; Initialize in-page EA<15:0> pointer ---MOV #tbloffset(PROG_ADDR), W0 ---TBLWTL W0,[W0]-------; Set base address of erase block ---DISI #5-------------------; Block all interrupts with priority <7 -------------------------------; 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-----------------------; Insert two NOPs after the erase ---NOP-----------------------; command is asserted
發表於: 2008/1/15 12:02
|
|||
|