Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use CAN Bus"

From ESS-WIKI
Jump to: navigation, search
Line 83: Line 83:
 
<tt>CAN0_D+&nbsp;</tt>connect to <tt>CAN1_D+</tt>
 
<tt>CAN0_D+&nbsp;</tt>connect to <tt>CAN1_D+</tt>
  
<tt>CAN0_D-&nbsp;</tt>connect to <tt>CAN1_D-</tt><tt></tt><tt></tt>
+
<tt>CAN0_D-&nbsp;</tt>connect to <tt>CAN1_D-</tt>
 
<pre># ip link set can0 up type can bitrate 125000
 
<pre># ip link set can0 up type can bitrate 125000
 
# ip link set can1 up type can bitrate 125000</pre>
 
# ip link set can1 up type can bitrate 125000</pre>
<tt></tt>
+
 
 +
 
 +
 
 
==== <tt>Test</tt> ====
 
==== <tt>Test</tt> ====
 
<pre>#candump can0 &
 
<pre>#candump can0 &
Line 96: Line 98:
 
can0 []
 
can0 []
 
</pre>
 
</pre>
 
===  ===
 

Revision as of 06:57, 26 January 2017

Pin Define

ROM-3420

CAN0(CAN bus 0) CAN1(CAN bus 1)
 Pin  Signal  Pin Signal
 1  -  2  -
 3  CAN0_D-  4  -
 5  CAN0_D+  6  -
 7  -   8  -
 9  GND  10  -

 ROM-7421

CAN0(CAN bus 0)
 Pin  Signal  Pin  Signal
 1  -  2  CAN0_D-
 3
 4  -
 5  GND
 6  GND
 7  CAN0_D+   8  -
 9    10  -


Configuration/Test

Configuration

Connect CAN0 to CAN1

CAN0_D+ connect to CAN1_D+

CAN0_D- connect to CAN1_D-

# ip link set can0 up type can bitrate 125000
# ip link set can1 up type can bitrate 125000


Test

#candump can0 &

#cansend can1 -i 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

CAN0 retrieves the data

interface = can0, family = 29, type = 3, proto = 1
can0 []