• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   3 Anonymous Users






Re: FLASH MEMORY 問題
#4
版主
版主


查看用戶資訊
最簡的的方式使用嵌入式組合語言(in-Line Assembly)
如何使用要看 C30 User's Guide 或參考 H 檔裡利用 In-Line Assembly 所建立的 Macro 方法。
語法 : asm(“assembly text”);

發表於: 2008/1/15 15:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: FLASH MEMORY 問題
#3
中級會員
中級會員


查看用戶資訊
感謝版主回答

那麼再請問:使用24H的MCU,
以C為開發平台,如何在C中加入一組語?

謝謝!

發表於: 2008/1/15 15:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: FLASH MEMORY 問題
#2
版主
版主


查看用戶資訊
TBLWTL 是指令,不是暫存器,TBLWTL & TBLETH 是 Table Write Low byte / High byte

這是一段設定 NVMCON 暫存器針對 Flash or EEPROM 的動作設定及解鎖功能(Unlock) 這段因為有時序順序的關係,動作必須做完解鎖動作才能啟動 Flash erase 的動作,一般都是用組語來完成的,這解鎖動作無法用C完成,會造成時序不對無法解鎖。

發表於: 2008/1/15 14:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


FLASH MEMORY 問題
#1
中級會員
中級會員


查看用戶資訊
請問高手

小弟目前在寫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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------