Table of Contents

PiCAN

pican.jpg

candev.jpg

pican_rev_b.jpg

The PiCAN is a reimplementation of the interface found here.

Headers

JP1-1 JP1-2 JP1-3
CANL CANH GND
JP2-1 JP2-2 JP2-3
GPIO14
TXD
GPIO15
RXD
GND
P1-3 P1-2 P1-1
GPIO14 GND 5V

Install

Append the following to boot/config.txt and reboot.

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835

dmesg

CAN device driver interface
mcp251x spi0.0 can0: MCP2515 successfully initialized.

Configure

ip link set can0 up type can bitrate 250000
ip link set can0 txqueuelen 1024
ip -s -d link show can0

Termination

There is a termination resistor closed with JP3.

Test

apt install can-utils

Host 1

candump can0

Host 2

cansend can0 123#DEADBEEF
cangen can0

Pinout

pican_std.jpg

pican_odb2.jpg

DB9 male socket

1 2 3 4 5
 6 7 8 9

STANDARD        OBDII
2 CAN L         2 GND          SJ1
3 GND           3 CAN H        SJ2
7 CAN H         5 CAN L        SJ3

Solder bridges must be created to select the function of the socket.

Resources

Product page

Schematic