I can get the CAN shield to work on my UNO no problem but i can’t get it to work on my Mega 2560. Physically i’ve wired the SPI lines to the CAN-Bus shield at the same pin locations as the UNO, but i can’t find where to change the SPI pins in software? I’ve tried SPI.h and it’s labeled fine on pins_arduino.h but i don’t think it’s looking at the correct pins_arduin.h.
Does anyone know how to get the CAN-BUS shield code to look at the correct SPI pins?
OK, finally figured it out after following the code line by line. It was in the mcp_can_dfs.h file and wasn’t readily apparent because of the way it was worded\coded.
As you can see above, the SPICS is worded funny, i would have made the variable SPI_CS to make it clear. A little underscore goes a long way. As you can see in the code, i changed the CS pin to 53 here.
Hi ,
Actually , the Can-Bus Shield is using D10 - D13 pin as SPI port , but they are not connect to SPI pin , so if you want to use it with mega , you need to jump D10 - D13 to SPI pin . That is also a defect of this shield i think , i will give this info to the designer .
Does anyone know how to get the Recieve sketch to work from the Seecuduino wiki site? i can transmit no probs but when i try and recieve , as soon as i open the serial monitor it crashes the BUS
Hi All, been trying to get the CAN Shield working with the Mega 1280
I connected the pins as described, and changed the SPICS from 10 to 53, but i get the message CAN init Fail on the serial monitor when i run the sketch.
Appart from the 5V and Gnd pins, is there anything else required to jumper over ?
Did you make sure your CAN bus wiring is correct? You need a 120 ohm terminating resistor at both ends of the bus. If it’s a pre-existing bus then they should already be there, but you need to make sure you set the baud rate correctly.