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


Browsing this Thread:   1 Anonymous Users






Re: 使用C18相關問題~~請各位先進指導
#4
新會員
新會員


查看用戶資訊
在PIC18F8720上面移植成功了uC/OS-II,并且在硬件板上运行稳定。解决了.tmpdata和MATH_DATA的保存问题。改天发上来。

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


Re: 使用C18相關問題~~請各位先進指導
#3
新會員
新會員


查看用戶資訊
Ryang,请问你有详细的说明嘛,我移植UC/OS-II,需要知道这些东西,因为切换任务的时候需要保存!

發表於: 2005/7/5 23:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用C18相關問題~~請各位先進指導
#2
版主
版主


查看用戶資訊
在 C18 裡有很多的公用函數例如: 加、減、乘、除、比較.... 等,在運算的過程中為了減少 RAM 的使用都儘量會用到一些共同RAM 區,這些區域稱為TempData 區域。而這個區域是由 Linker 安排的。

所以你在中斷又做了一些呼叫公用函數的動作就會使用到相同的 TempData , 如果你沒有在中斷函數內將 TempData 存起來那你就會找 Bug 找到哭。

在C18的 User's Guide 裡 第 2.9.2.4 ISR CONTEXT SAVING 的章節裡有詳細的提到這點,將其摘錄下來 如下說明:

.tmpdata --- Contains the compiler temporary variables for the non-interrupt service routine source.

If an interrupt service routine calls another function, the normal functions’ temporary data section (which is named .tmpdata) should be saved using a save= section(".tmpdata") qualifier on the interrupt pragma directive. For example:

#pragma interrupt high_interrupt_service_routine save=section(".tmpdata")

發表於: 2005/6/1 18:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


使用C18相關問題~~請各位先進指導
#1
新會員
新會員


查看用戶資訊
小弟最近使用c18 v2.42版本 mplab 7.01版本 來對18f6520來寫程式 發現一些問題
1.在timer中斷中,作乘除程式會錯誤,雖然語法正確,如果乘除程式約200us,中斷是500us應該沒關係吧,但是程式執行後還是會出錯誤

2.使用c語言開發程式當然是貪圖便利與乘除運算,然而不能在timer中作乘除,我相信,應該在主程式當中要做乘除運算,也應該有相當的機率會出錯

3.目前小弟的程式架構是使用switch(變數) case來建構,變數範圍只有0-8之間會產生,但是,神奇的事來囉!變數竟然會變成0-8以外的數值!而且每次都不一樣,但是並不是每次都會亂跳,是有時會亂跳

4.小弟的程式中,乘除用的非常的多,所以感覺c18 complier是非常的不穩定

綜合以上,請問各位先進對於2.的觀點覺得是否成立?

發表於: 2005/6/1 0:04
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... ]

教育訓練中心

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