Arduino MicroCAN Bus using MCP2551 and MCP2515 and/or SeeedStudio CAN Bus shield

I'm transfering a project from an Arduino UNO to a micro and trying to transfer from a seedstudio CAN Bus shield to similar chips on a breadboard. I am using seedstudio's CAN Bus library and running their example receive_check sketch to check my connections. I was getting the "can bus init failed" over serial. The sketch works with the UNO and shield, so my next guess was to try it with the micro and the shield. I had no success here. I know the micro breaks the SPI to different pins, but I can't see anywhere in the library which would lead me to believe I have to change anything. Seeedstudio's schematic is a bit hard to follow, but I have jumpers from the shield to the micro as follows: digital 10-13 to SS, MOSI, MISO, and SCK digital 2 to digital 2 5v and ground to 5v and ground

So seven jumpers.

Any suggestions?

It looks like you connected pin 10 on the shield to the slave select pin of the ICSP header. The seeed canbus library AFAIK does the slave select in software on pin 10. I believe the rest of your connections are right, but I think you need to connect pin 10 of shield to pin 10 of micro.

EternityForest: It looks like you connected pin 10 on the shield to the slave select pin of the ICSP header. The seeed canbus library AFAIK does the slave select in software on pin 10. I believe the rest of your connections are right, but I think you need to connect pin 10 of shield to pin 10 of micro.

According to the reference, the Uno does SS on pin 10 by default. Would the Seeedstudio lib be using the default SS pin as SS, but in an unconventional manner?

After reading through the SPI article a few more times I think the SS pin on the Micro which is brought out to pin 10 on the Uno is for the Arduino being a slave device. It looks like the Seeedstudio CAN Bus shield is using this pin as the output for the Arduino as a master device. They're using the same pin, but having it function differently. Since the Micro has the slave SS pin separate it could be used as a slave without taking up a digital I/O pin. In this case I need a digital output, so using one of the digital pins is necessary. Am I correct in this thinking?

I finally found in the Seedstudio CAN Bus library where it sets the SPI CS pin. It's in the mcp_can_dfs.h file, line 304. I can't wait to get home and continue working on this. Thanks for the help!

Hello everybody. I started to use CAN Bus SHIELD, from Sparkfun with an Arduino Uno. I use the examples sketches from Arduino learning and I update different libraries of CAN bus that I found in GitHub.com and Sparkfun.com , but every time that I tries to compile file, it shows me some errors:

ReciveDataSketch.ino:9:21: error: mcp_can.h: No such file or directory ReciveDataSketch:18: error: 'MCP_CAN' does not name a type ReciveDataSketch.ino: In function 'void setup()': ReciveDataSketch:26: error: 'CAN_OK' was not declared in this scope

thank you for your time!

If I unzip the seed zip directly from github, it goes into a folder named CAN_BUS_SHIELD-master or some such, and when I start arduino, it gives me an error that says the library can't be used because of a bad character in the name. If I then try to build the examples it fails with the same errors you get. If I rename the folder in the libraries folder to mcp_can, everything compiles successfully.