can
匯流排配置
在linux
系統中,
can匯流排介面
裝置作為網路裝置
被系統進行統一
管理。在控制
台下,
can匯流排
的配置和以
太網的配置使用相同的
命令。在控制台
上輸入命令:
ifconfig –a
可以得到以下結果:
can0 link encap:unspec hwaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
noarp mtu:16 metric:1
rx packets:0 errors:0 dropped:0 overruns:0 frame:0
tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
rx bytes:0 (0.0 b) tx bytes:0 (0.0 b) interrupt:18
eth0 link encap:ethernet hwaddr 00:50:c2:22:3b:0e
up broadcast multicast mtu:1500 metric:1
rx packets:0 errors:0 dropped:0 overruns:0 frame:0
tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
rx bytes:0 (0.0 b) tx bytes:0 (0.0 b)
eth1 link encap:ethernet hwaddr 00:50:c2:22:3b:60
up broadcast multicast mtu:1500 metric:1
rx packets:0 errors:0 dropped:0 overruns:0 frame:0
tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
rx bytes:0 (0.0 b) tx bytes:0 (0.0 b)
interrupt:41 base address:0xe000 lo link encap:local loopback
inet addr:127.0.0.1 mask:255.0.0.0 inet6 addr: ::1/128 scope:host
up loopback running mtu:16436 metric:1
rx packets:256 errors:0 dropped:0 overruns:0 frame:0
tx packets:256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 rx bytes:19952 (19.9 kb) tx bytes:19952 (19.9 kb)
在上面的
結果中,
eth0
和eth1
裝置為以
太網介面,
can0裝置為
can匯流排介面。接
下來使用ip命
令來配置
can匯流排的位速
率:ip link set can0 type cantq 125 prop-seg 6phase-seg1 7 phase-seg2 2 sjw 1
也可以使用
ip命令直接設
定位速率:
ip link set can0 type can bitrate 125000 當設
置完成後,可以通過下面的
命令查詢
can0裝置的
引數設定
:ip -details link show can0 當設
置完成後,可以使用下面的
命令使能
can0裝置
:ifconfig can0 up 使用下
面的命令取消
can0
裝置使能
:ifconfig can0 down
can匯流排學習(一) 初識can匯流排
can匯流排最初由德國bosch公司為汽車檢測 控制系統而設計的。1993年can成為國際標準iso11898 高速應用 和iso1119 低速應用 can的規範從can1.2規範 標準格式 發展為相容can1.2規範的can2.0規範 can2.0a為標準格式,can2.0b為擴充套件格式 目前應...
初學CAN匯流排
初學can 匯流排,之前用的是 rs485 485 中沒有匯流排仲裁的概念,如果匯流排上有十個節點,要事先算好每組資料的傳送用時,調好時間延遲,逐個排隊傳送。而 can匯流排可以把多個節點的資料都送到本站的 can晶元,並處於準備狀態,等待匯流排空閒時,向匯流排傳送資料,由匯流排仲裁哪乙個節點優先傳...
CAN匯流排協議
can control controller area network 是控制 器 區域網的簡稱 can是一種有效支援分布式控制或實時控制的序列通訊網路,最初由德國bosch公司80年代用於汽車內部測試和控制儀器之間的資料通訊。目前can 匯流排規範已被國際標準化組織iso制訂為國際標準iso118...