• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: TBLRDH 跟 TBLRDL 讀到的是PM 的資料嗎?
#3
高級會員
高級會員


查看用戶資訊
恩~可是我讀出來變得怪怪的~
我在這段
//Setup user reset vector
//USER_PROG_RESET is 0x100
sourceAddr.Val = USER_PROG_RESET;
userReset.Val = ReadLatch(sourceAddr.word.HW, sourceAddr.word.LW);

//Prevent bootloader lockout - if no user reset vector, reset to BL start
if(userReset.Val == 0xFFFFFF)
{userReset.Val = BOOT_ADDR_LOW;}
userResetRead = 0;

我自己看 Program Memory 100的位址應該是 0xFFFFFF 沒錯滑鼠移過去也是顯示0x00FFFFFF
但是他讀出來 卻是 0xFFFF0000
傳出前
縮圖
傳出後
縮圖

除了這個問題外 為什麼直接看RAM 會看不到資料呢? 看到都是R
縮圖

發表於: 2008/3/28 17:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: TBLRDH 跟 TBLRDL 讀到的是PM 的資料嗎?
#2
版主
版主


查看用戶資訊
TBLPAG = page;
==>設定 Flash Program memory 的 PAGE,即 24-bit位址裡的最高8-bit address.

temp.word.LW = __builtin_tblrdl(addrLo);
temp.word.HW = __builtin_tblrdh(addrLo);
==> 這是用 C30所提供的內建 __builtin 功能設定剩下的 16-bit Address,並將目前 16-bit + 8-bit(Page) 共24-bit所到的 Flash 讀出 32-bit ROM Data (但這32-bit 裡的資料只有24-bit有效,最高8-bit永遠為零)

return temp.Val;
==> 回傳 24-bit ROM Data

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


TBLRDH 跟 TBLRDL 讀到的是PM 的資料嗎?
#1
高級會員
高級會員


查看用戶資訊
抱歉 因為看datasheet 有點看不太懂
在24F BootLoader code 其中的Memory.c 檔 有個Function是

DWORD ReadLatch(WORD page, WORD addrLo)
{
DWORD_VAL temp;

TBLPAG = page;

temp.word.LW = __builtin_tblrdl(addrLo);
temp.word.HW = __builtin_tblrdh(addrLo);

return temp.Val;
}
Program Memory 的位址是24bit
Program Memory 的資料也是24bit (兩個位址)
TBLPAG 是放高8 bit 傳進來的 addrLo是放後面的16bit
而 __builtin_tblrdl 是去讀取指定位址的低16bit
__builtin_tblrdh 是去讀取指定位址的高8bit
上面敘述是這樣沒錯嗎? 因為真的不太確定...

發表於: 2008/3/28 10:10
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... ]

教育訓練中心

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