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


Browsing this Thread:   1 Anonymous Users






Re: 關於CAN 的一些問題....
#5
高級會員
高級會員


查看用戶資訊
多謝 typhoon 大哥,
我不太懂你意思,您可以幫我講解一下嗎!?

發表於: 2008/6/19 14:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於CAN 的一些問題....
#4
資深會員
資深會員


查看用戶資訊
如果堅持的話,這裡可以試試運氣

http://forum.microchip.com/tt.aspx?forumid=103

但單就"上面"來說,個人建議不要

發表於: 2008/6/17 18:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於CAN 的一些問題....
#3
高級會員
高級會員


查看用戶資訊
怎麼都沒有人回我呢!? 請大家幫忙看看吧...

發表於: 2008/6/16 14:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於CAN 的一些問題....
#2
高級會員
高級會員


查看用戶資訊
補充問一點,我看範例都沒有使用中斷來接收資料,但是我這顆Pic(18F2480) 好像有CAN 接收的中斷,不知道有人有使用過CAN的中斷來接收資料的嗎!?

發表於: 2008/6/12 9:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於CAN 的一些問題....
#1
高級會員
高級會員


查看用戶資訊
想請問一些問題 我使用的Pic 是 18F2480 我它裡面有提到有三種模式
- Mode 0 – Legacy mode
- Mode 1 – Enhanced Legacy mode with
DeviceNet support
- Mode 2 – FIFO mode with DeviceNet support
想請問這三種模式的意思是?我使用CAN Lib 能直接設定嗎?
另外 想請問filter 該怎麼設定呢?

///////////////////////CODE////////////////////
#define MESSAGE_ID1 0x200
#define RX_Filter0 0x002
#define RX_Filter1 0x000
#define RX_Filter2 0x00
#define RX_Filter3 0x00
#define RX_Filter4 0x00
#define RX_Filter5 0x00
#define RXB0_MASK 0x7ff // 0b111 1111 1100
#define RXB1_MASK 0x7ff
↑↑↑↑↑設定filter↑↑↑↑↑↑
CANInitialize( 2,8,3,3,1, CAN_CONFIG_LINE_FILTER_OFF &
CAN_CONFIG_SAMPLE_ONCE &
CAN_CONFIG_VALID_STD_MSG &
CAN_CONFIG_PHSEG2_PRG_ON ) ;
↑↑↑↑↑初始 CAN ↑↑↑↑↑
CANSetOperationMode(CAN_OP_MODE_CONFIG) ;
↑↑↑↑↑切換設定模式↑↑↑↑↑
CANSetMask(CAN_MASK_B1, 0x7ff, CAN_CONFIG_STD_MSG ) ; //設定B1 MASK
CANSetMask(CAN_MASK_B2, 0x7ff, CAN_CONFIG_STD_MSG ) ; //設定B2 MASK

CANSetFilter(CAN_FILTER_B1_F1, RX_Filter0 , CAN_CONFIG_STD_MSG) ; //RX_Filter0 = MyID
CANSetFilter(CAN_FILTER_B1_F2, 0x00000000 , CAN_CONFIG_STD_MSG) ;
CANSetFilter(CAN_FILTER_B2_F1, 0x00000000 , CAN_CONFIG_STD_MSG) ;
CANSetFilter(CAN_FILTER_B2_F2, 0x00000000 , CAN_CONFIG_STD_MSG) ;
CANSetFilter(CAN_FILTER_B2_F3, 0x00000000 , CAN_CONFIG_STD_MSG) ;
CANSetFilter(CAN_FILTER_B2_F4, 0x00000000 , CAN_CONFIG_STD_MSG) ;

CANSetOperationMode(CAN_OP_MODE_NORMAL) ;
////////////////////////////////////////////////
下圖是從 AN738 擷取下來的
縮圖
看起來 是有兩組filter RXM0 跟 RXM1 是MASK
但是之後經過filter的資料會分別存放RXB1 跟RXB0
可是 當我使用 CANReceiveMessage(&RX_ID1,RX_Data_Buf1,&RX_Data_Len1,&RX1_Message_Flag)
的時候,他是去哪邊抓資料呢?RXB1 or RXB0?
另外,filter 的 RX_Filter0 我看應該是設定自己的id 那剩下的filter呢?
是用來做什麼的? 請大家幫我解答...感恩!

發表於: 2008/6/11 17:09
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... ]

教育訓練中心

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