Seeed Studios CAN-BUS Shield
A Controller-area Network bus (CAN-BUS) library for Seeed Studios CAN-BUS Shield incorporating Microchip's MCP2515 controller and MCP2551 transceiver
Hello World
Import programSeeed_CAN_Hello_World
This 'Hello World' program uses many of the SEEED_CAN library functions to display the VIN number stored in a GMLAN ECU then display all CAN messages on the CAN-BUS.
Library
Import librarySEEED_CAN
This library for Seeed Studio's CAN-BUS Shield has a similar API to mbed's LPC1768 CAN library making it easy to add CAN functionality to mbed systems that support Arduino type 'Shields. This Beta release of my CAN-BUS Library is largely working but lacks interrupt 'attach' functions.
Pinout
Datasheet
http://www.seeedstudio.com/wiki/CAN-BUS_ShieldNotes
Warning
You cannot use LED1 (the blue LED) on the FRDM-KL25Z mbed when the Seeed Studios CAN-BUS Shield is plugged in because the blue LED is also connected to SPI0's CLK pin. You will however see the blue LED flicker with CAN-BUS Shield (i.e. SPI0) activity.
Library Updated 12th November 2013
!!! The library's 'attach' functions NOW working !!!
As well as a number of extensions to the API - see Week 6's entry in my notebook page: Sophie's Seeed CAN-BUS Library Notebook
Once headers are attached to the FRDM-KL25Z the CAN-BUS Shield simply plugs in.
The CAN-BUS Shield's 'Chip Select' pin connects to FRDM-KL25Z's PTD0 pin but it is possible to change it so that it connects to PTD5 instead by modifying the Shield. The modification requires cutting the connection between 'CS' and 'D10' and soldering a new connection between 'CS' and 'D9'. Here's a close up photo of the area on the CAN-BUS Shield:
. My 'Hello World' program requires the CAN-BUS Shield to be connected to a GMLAN P-BUS (500 kbps) with an ECU connected, either directly as shown below or connected to a car's OBDII port (ignition must be turned on).
The program simply displays the VIN code read from the ECU then all messages on the CAN-BUS:
Development Notebook Page
If you want to read more details about the development of this library, the full write-up can be found at :