• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






關於mplab 使用 startup.as 做 reset 動作流程
#1
新會員
新會員


查看用戶資訊
目前我使用Mplab中選項 keep generated startup.as 生成後,按照Hi-Tech PICC v2.0.pdf 教學文件的第131頁,去修改 startup.as。在取消keep generated startup.as 。在編譯,去查看Program Memory 並沒有把startup.as載入進去 。不知道是否要勾選甚麼選項才會載入。

目前我把 mystartup() 放在main.c裡面
void mystartup( void )
{
PORTC = 0x00;
TRISC = 0x00;
#asm
clrf _STATUS
clrf _PORTB
bsf _STATUS,5
clrf _TRISB
movlw high start
movwf _PCLATH
goto ( start & 0x7FF )
#endasm
}

然後修改的startup.as 內容為
.....
.....
extern mystartup

psect reset_vec
reset_vec:
; No powerup routine
;global start

; jump to start
;goto start & 0x7FF | (reset_vec & not 0x7FF)

goto (mystartup & 0x7FF)


psect init
start
_exit
psect end_init
global start_initialization
.....
.....

我有嘗試把 startup.as 放入到 soruec中更著一起編譯但出現了********** Build failed! ********** 沒有任何提示哪裡錯誤

請哪位有用過的大大幫幫我,目前成是都完成了 只差這個還搞不定 跪求了

發表於: 2020/5/7 12:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於mplab 使用 startup.as 做 reset 動作流程
#2
版主
版主


查看用戶資訊
之前我有寫了一粉 XC8 的參考教材 (在教育訓練光碟下) XC8T v1.0 。在教材的 118 頁有 "開機初始執行環境" 的章節。
請參考一下 Page 118 ~ Page 124 這幾頁的說明,Linker 那邊也也些要勾選也參考一下 Page 121。


startup.as 是 XC8 的啟動模組,主要是用來:

- 設定 data psects 的初始資料
- 清除 bss psects (uninitialised data) 區域
- 載入RC振盪器的校正值(有內建RC振盪器者)
- 將程式控制權轉移至 main( )

如果要在一開機時就能先做 I/O 腳的電壓控制,請用 powerup.as 的組語加在 startup.as 之前。如貼圖:

Attach file:



jpg  (0.00 KB)


發表於: 2020/5/7 17:00
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... ]

教育訓練中心

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