Difference between revisions of "EMAC CAN Interface"

From wiki.emacinc.com
Jump to: navigation, search
(Created page with "{{ subst:Pgtempl | initials={{subst::Templateimpl:getinitials}} | project=OE 5.0 | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boa...")
 
Line 1: Line 1:
{{todo| NotStarted (01.18.2016-10:45->KY+)| Kyoungmeyer | project=OE 5.0,KY,NotStarted }}
+
{{todo| InProgress (01.18.2016-10:45->KY+)|Klint Youngmeyer| project=OE 5.0,KY,InProgress }}
 
{{#seo:
 
{{#seo:
 
|title=EMAC CAN Interface
 
|title=EMAC CAN Interface
Line 10: Line 10:
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
<span style="background:#00FF00;color:#FF0000;font-size:300%">'''''Put the page description text here.'''''</span>
+
The CAN interface is a vehicle bus standard that allows communication between a controller and various sensors. EMAC produces several boards capable of communicating on a CAN bus. For more information about which products support the CAN bus, see the [[EMAC_HW|hardware]] page.
  
 
__TOC__
 
__TOC__
Line 18: Line 18:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:bg | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 
{{:Templateimpl:bg | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 
+
CAN (controller area network) is a multi-master serial bus for communicating between "nodes" over a two-wire interface. The wires are generally a 120 ohm twisted pair. Each CAN node has the ability to communicate with every other node, one at a time.
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:geninfo | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
+
<!--{{:Templateimpl:geninfo | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 
+
-->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:using | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 
{{:Templateimpl:using | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 +
The CAN bus is able to be accessed from the command line, or using a C API on EMAC products (with CAN support).
 +
===CAN Bus Setup===
 +
Before using the CAN interface on an EMAC device, two commands must be run. These commands could be scripted to be run at startup.
 +
{{note|The settings in the first command may need to be changed according to the application in question.}}
 +
 +
{{cli | ip link set can0 type can bitrate 125000 triple-sampling on | hostname=ipac9x25}}
 +
<br />
 +
{{cli | ip link set can0 up | hostname=ipac9x25}}
  
 +
===Command Line CAN===
 +
The command line tools included with EMAC OE 5 are part of the <code>canutils</code> package. The tools included in this package are:
 +
* <code>canconfig</code>
 +
* <code>candump</code>
 +
* <code>canecho</code>
 +
* <code>cansend</code>
 +
* <code>cansequence</code>
 +
Of these five, the most used are <code>cansend</code> and <code>candump</code>.
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:examples | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
+
<!--{{:Templateimpl:examples | initials=KY | title=EMAC CAN Interface | desc=This page describes how to use the CAN interface on EMAC boards. | project=OE 5.0 }}
 
+
-->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /******************************************    Conclusion      ******************************************/ -->
 
<!-- /******************************************    Conclusion      ******************************************/ -->

Revision as of 14:03, 18 January 2016

TODO: {{#todo: InProgress (01.18.2016-10:45->KY+)|Klint Youngmeyer|OE 5.0,KY,InProgress}}

The CAN interface is a vehicle bus standard that allows communication between a controller and various sensors. EMAC produces several boards capable of communicating on a CAN bus. For more information about which products support the CAN bus, see the hardware page.

Background

CAN (controller area network) is a multi-master serial bus for communicating between "nodes" over a two-wire interface. The wires are generally a 120 ohm twisted pair. Each CAN node has the ability to communicate with every other node, one at a time.

EMAC CAN Interface

The CAN bus is able to be accessed from the command line, or using a C API on EMAC products (with CAN support).

CAN Bus Setup

Before using the CAN interface on an EMAC device, two commands must be run. These commands could be scripted to be run at startup.



NOTE
The settings in the first command may need to be changed according to the application in question.


root@ipac9x25:~# ip link set can0 type can bitrate 125000 triple-sampling on


root@ipac9x25:~# ip link set can0 up

Command Line CAN

The command line tools included with EMAC OE 5 are part of the canutils package. The tools included in this package are:

  • canconfig
  • candump
  • canecho
  • cansend
  • cansequence

Of these five, the most used are cansend and candump.

Conclusion

Further Information

Where to Go Next
Pages with Related Content