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


Browsing this Thread:   1 Anonymous Users






Re: RS485通訊問題
#2
管理員
管理員


查看用戶資訊
你好,

看起來你在高優先及低優先中斷都用到了陣列的處理 ! 在 MPLAB C18 只剩下 FSR0 來做陣列的處理 , 雖然新版的文件提及 C18 Compiler 會處理相關的 Context saving. 但是很多背景下看不見的動做不太容易查覺 !

你可以試試以下兩種方式 :

1. 將 MPLAB C18 的最佳化 Disable
>> 使用 Project -> Build Options -> ....

2. 不要使用 TBL[n] 的資料來做掃描 , 可以利用另一個旗標或變數來判斷到底要將 LATB 和 0x20 或 0x30 做 OR 的動作 !
例如
if ( ScanIndex ==0)
{
LATB |= 0x20 ;
ScanIndex = 1 ;
}
else
{
LATB |= 0x30 ;
ScanIndex = 0 ;
}

最後 , 請確定對 PORTB 的輸出及運算都使用 LATB

Regards,

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


RS485通訊問題
#1
高級會員
高級會員


查看用戶資訊
help me…
我的程式有兩層中斷
高優先中斷為usart接收,將data放入陣列中
低優先中斷為timer3,做scan key及display 7'segment LED
其中低優先中斷如執行下列指令時
LATB &=0xcf;
LAB |=TBL[n]; //TBL[]=0x20 or 0x30
不定時它會變更PORTBbits.RB1為high,(PORTBbits.RB1是75176的R/T pin)也就把我的usart接收給關掉了。想請教可能原因為何?

發表於: 2007/1/12 10:11
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... ]

教育訓練中心

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