This is an old revision of the document!
PiCAN
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