• 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: 如何限定 startup 的位址??
#2
版主
版主


查看用戶資訊
因為有這一行 #pragma code _fw_entry = 0x1000 所以位址都會從0x1000以後開始,這裡的 _fw_entry 是指 Section 的名稱,並不是函數。所以單獨對 fw_entry ( ) 再做一次的位址宣告即可。


如果只是想設定C程式的起始位址可以用底下的方式:

1. 找出C18的啟動模組 c018i.c 出來 (C:\mcc18\src\traditional\startup) 將 #pragma code _entry_scn=0x000000 這行改成 C18 要執行的起始位址。

2. 將修改過的 c018i.c 加入 project 裏

3. 將 LKR 檔案裡的 c018i.0 加上 // c018i.o

4. 用組語寫bootloader放在0x00的位址,注意中斷的新位址的轉移。

發表於: 2007/6/1 12:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


如何限定 startup 的位址??
#1
新會員
新會員


查看用戶資訊
程式大概如上,不曉得為什麼,
_startup 等啟動模組都會跑到 0x1000 之後,
這樣我該怎麼處理阿?

#pragma code high_vector = 0x08
void high_interrupt(void)
{
    
_asm GOTO Timer0_ISR _endasm
}


#pragma code low_vector = 0x18    
void low_interrupt(void)
{
    
_asm GOTO INTP_ISR _endasm
}


main()
{

    
fw_entry();
}


#pragma code _intlow_entry = 0x1000

#pragma interruptlow INTP_ISR
void INTP_ISR(void)
{
        
// ....
}


#pragma code _inthigh_entry = 0x1200
#pragma interrupt Timer0_ISR
void Timer0_ISR(void)
{
        
// ....
}

#pragma code _fw_entry = 0x1400
void fw_entry ()
{
        
// ....
}


如果寫成底下,那 startup 就會跑到 0x1000 以上了,
只是這樣我沒辦法限定 fw_entry 的起始位址。

#pragma code _fw_entry = 0x1000

#pragma interruptlow INTP_ISR
void INTP_ISR(void)
{
        
// ....
}

#pragma interrupt Timer0_ISR
void Timer0_ISR(void)
{
        
// ....
}

void fw_entry ()
{
        
// ....
}

發表於: 2007/5/28 18:55
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... ]

教育訓練中心

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