Canberry V 1.1 Canbus for Raspberry Pi
Canberry Pi V 1.1.1 is an extension board for Raspberry Pi. It is an Open Hardware Design. It has two functionalities: a can bus module and an onboard Real Time clock powered by a 12 mm battery. In figure is shown the Board on Raspberry PI.
The CanBus is based on MCP2515 SPI controller and the MCP2551 tranceiver. All functionalities are full integrated in standard linux kernel, so, they can be avaible on fly, or at last recompiling linux kernel to add canbus functionalities. Canberry Pi V 1.1 is a “restyling” of V 1.0. The new version contains the same can controller and tranceiver, but a different RTC. The RTC is the DS1307Z supported by the linux kernel.
The Canberry V 1.1 is in stock at the same price 19€.
Canberry V1.1 is out of production, you can buy the V2.1 or DualCanBus.
For order use the contact form.
How to prepare a SD Card with CAN kernel modules (only for expert Linux users)
Download Wheezy Raspbian 2014-09-09, but no kernel update is necessary, you must use the version 3.12.28+
After your raspberry has been booted, go to home directory:
add these lines to the script
insmod /lib/modules/3.12.28+/extra/spi-config.ko devices=\bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=20:pds32-0=16000000:pdu32-4=0X2002:force_release
ip link set can0 up type can bitrate 1000000
Run the script:
sudo sh can-start.sh
So the system is ready, then you can use standard canbus command to use the peripheral:
candump can0 -> to monitoring can bus traffic
cansend can0 7DF#0201050000000000 -> to send canbus commands
How to use RTC DS1307Z
It is possible to confugure the RTC IC with the terminal
- Login as root
- install i2c-tools apt-get install i2c-tools
- install libi2c-dev apt-get install libi2c-dev
- edit blacklist file nano /etc/modprobe.d/raspi-blacklist.conf
- Add # before blacklist spi-bcm2708
- Add # before blacklist i2c-bcm2708
- Edit nano /etc/modules
- Add rtc-ds1307
- Edit nano /etc/rc.local
- Add echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device (Rasp Pi Revision 1) or echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device (Rasp Pi Revision 2 and B+)
- Add hwclock -s
or with a compiled program. The DS1307Z is a device I2C, and then we must install i2c-tools and libi2c-dev before use it.