-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
52 lines (52 loc) · 2.43 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://zhubeilife.github.io</id>
<title>Share</title>
<updated>2019-05-29T08:34:48.671Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<link rel="alternate" href="https://zhubeilife.github.io"/>
<link rel="self" href="https://zhubeilife.github.io/atom.xml"/>
<subtitle>温故而知新</subtitle>
<logo>https://zhubeilife.github.io/images/avatar.png</logo>
<icon>https://zhubeilife.github.io/favicon.ico</icon>
<rights>All rights reserved 2019, Share</rights>
<entry>
<title type="html"><![CDATA[How to Use PCAN Device]]></title>
<id>https://zhubeilife.github.io/post/how-to-use-pcan-device</id>
<link href="https://zhubeilife.github.io/post/how-to-use-pcan-device">
</link>
<updated>2019-05-29T08:32:46.000Z</updated>
<content type="html"><![CDATA[<h1 id="stm32-can-device">STM32 CAN Device</h1>
<h2 id="set-can-bit-time">Set Can bit time</h2>
<p>http://www.bittiming.can-wiki.info/#bxCAN</p>
<h1 id="how-to-use-pcan-device">How to use PCAN Device</h1>
<h2 id="installation">Installation</h2>
<p>After Installation, run 'sudo modprobe pcan' to load the driver module</p>
<h2 id="usage">USAGE</h2>
<h3 id="monitor-the-pcan-device">Monitor the PCAN Device</h3>
<ul>
<li>'cat /proc/pcan' to see all the PCAN device</li>
<li>'lspcan -T -t -i' can see info of PCAN device</li>
<li>'lspcan -T -t -s -f' can refresh the screen every second with a detailed view
of statistics clllected form all the PCAN device</li>
<li>'candump -t a canX' to monitor the data</li>
</ul>
<h3 id="open-socket-can-device">OPEN Socket Can Device</h3>
<pre><code class="language-bash"># Open PCAN-USB or PCAN-USB-FD as normal CAN 2.0 module
sudo ip link set can0 up type can bitrate 1000000
# Open PCAN-USB-FD as FD with Nominal Bit rate and Data Bit rate
sudo ip link set canX up type can bitrate 1000000 dbitrate 2000000 fd on
# Or Just setting the interface down or up using, must install net-tools to use ifconfig
ifconfig canX down
ifconfig canX up
</code></pre>
<h3 id="send">Send</h3>
<pre><code class="language-bash"># Transmit a CAN message with ID 0x123 on canX with 4 data bytes 00 11 22 33
cansend canX 123#00112233
# Transmit the same message with CAN FD (##) on canX, select the data bitrate
#for the data bytes(BRS flags = 1)
cansend can1 123##100112233
</code></pre>
]]></content>
</entry>
</feed>