• 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: C30 CAN的Identifier及Data Length如何得到?
#2
管理員
管理員


查看用戶資訊
你好,

C30 的 CAN Library 寫得並不像 18F 的 AN738 那麼容易用 !
所以再使用上必須要自己完成一些小工作.

1. 使用 CAN1IsRxReady(buff_no) 或 CAN2IsRxReady(buff_no) 來得知在 CAN 模組中是否有哪一個 Buffer 已經有資料進入了 . 例如 :

2. 若 Rx1_Status = CAN1IsRxReady(1) ; 得到的結果為 1 , 表示 CAN1 的 Buffer1 已收到有效資料 ! 此時先將C1RX1SID & C1RX1EID 讀出後再利用 CAN1ReceiveMessage ( rx_data , 5 , 1 ) 將資料讀至 rx_data .

第二個參數 "5" 是表示期望讀入的 Byte 數 . 第三個參數則指定要讀 Buffer0 or Buffer1.

3. 若是長度需要先知道 , 則要先讀取 C1RX0DLC or C1RX1DLC (如果用的是 CAN1 Module )

Regards,

發表於: 2006/5/11 18:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


C30 CAN的Identifier及Data Length如何得到?
#1
新會員
新會員


查看用戶資訊
在C18中Identifier可由指令CANReceiveMessage中的unsigned long *id 得到,在C30中CAN1ReceiveMessage中沒有unsigned long *id ,Identifier要用何指令得到?
在DS51456C-page92中的最後1行 Code Example:
CAN1ReceiveMessage(rx_data, 5, 0);指令中的5為datalen,0為MsgFlag, datalen 與 MsgFlag 是指令的條件值,還是指令執行完後,結果儲存的地方?

發表於: 2006/5/10 18:41
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... ]

教育訓練中心

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