PiPlanter 2 | Interfacing a Mikroelektronika CANSPI and an Arduino

The CANSPI board is a nice integration of the MCP2515 CAN Bus Controller and the MCP2551 CAN Bus Transceiver. To interface with these boards I’m using an Arduino Nano and the Seeed Studio CAN Bus Shield Library.

Here are some photos of the configuration, including the switch position on the CANSPI being used:

The wiring diagram goes as follows:

There are two parts of Arduino code, the sender and the receiver. The following code sends a sample piece of CAN data. Attach a potentiometer to A0, and twist it to see the differences in data in the receive code:

The following prints all CAN data received to the serial monitor:

Twist the potentiometer and see the change in data to see that it’s all working:

Thanks for reading!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone, but proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

2 Comments

  1. Hey,
    I am using Atmega2560. I am using P5,P6,P7(MOSI,MISO,SCK). I am also using seedstudio library for the newer can-shield version. My CS (D9), I have not connected INT to any pin. I have the same code. But it does not work for me. Does it matter, what pin selection I make?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.