R-Car/Boards/CAN

From eLinux.org
< R-Car
Revision as of 14:24, 21 July 2015 by Cogente (talk | contribs)
Jump to: navigation, search

This page provides information on CAN bus support on R-Car evaluation boards.

For general information regarding CAN bus operation refer to Wikipedia article.

Hardware

Cable

Typical pinout of DB9 CAN connector

Commonly used CAN bus connector is DB-9 female (socket) for cables and DB-9 male (plug) for devices. In some cases power can be provided via the connector.

General rule is that both ends of the CAN bus should be terminated with matching resistors. Typical value is 120 Ohm.

Porter board
Pins of CAN connector on Renesas R-Car M2 Porter board

Use a cable with XHP-3 and DB-9 connectors. Mating terminals are SXH-001T-P0.6. You may need a crimper tool.

Minimum number of wires consist of three:

Porter JP6 Pins Signal DB-9 pins
1 CAN_H* 7
2 CAN_L* 2
3 GND 6

[*] CAN_H and CAN_L signals form a differential pair. These wires should be twisted.


Break-out box

CAN break-out box from National Instruments

If you need to temporarily connect multiple devices to the bus, usage of a break-out box as shown on the picture is highly recommended.

Termination should only be enabled on the break-out box and at the end of very long cables.

Porter board

JP10 should be left open if a break-out box is used.



OBD-II

In order to connect to OBD-II interface use a cable from PEAK Systems [1].

Porter board

CAN termination resistor must be switched off (JP10 left open) when connecting to OBD-II.

Software

Yocto build

To build Yocto image with CAN bus support for Porter board, follow this procedure carfully:

  1. Do all steps specified on R-Car/Boards/Yocto and stop before executing bitbake core-image-weston or bitbake core-image-x11
  2. Edit $WORK/build/conf/local.conf with your favorite text editor, and add at the end:
    IMAGE_INSTALL_append = "can-utils iproute2" 
    
  3. Complete all steps on R-Car/Boards/Yocto.