Sparkfun CAN BUS Shield connected to arduino uno R3 won't initialize

'''#include <Canbus.h>

void setup() {
Serial.begin(9600);
if(Canbus.init(CANSPEED_500))
{
Serial.println("CAN Init OK");
}
else
{
Serial.println("Can't init CAN")
}
}'''

I wrote this code and connected the sparkfun can bus shield and arduino R3 to the ports 5V,GND,10,11,12,13 as told in this link : Sparkfun CAN-BUS Shield Won't Init - #3 by timbotech7

But the CAN BUS shield is not getting initialized. Any favourable solution will be highly entertained.

What does Sparkfun say about their shield not working?

may be worth trying the mcp_can library
it comes with various examples File>Examples>mcp_can

Edit: just ran your program of post #1 on a Uno with a CAN-BUS_Shield_V1.2 and it initialises the can OK, e.g.

CAN Init OK

looks like a wiring fault

note: your program of post #1 has a ; missing off the end of line

Serial.println("Can't init CAN")

Can you show your wiring please ? It would be much helpful

The test of post #3 was carried out using a can-bus-shield-v2 directly plugged into a UNO using the standard SPI pins 10 thru 13
it worked OK

CAN Init OK

however, today I tested your program of post #1 using a MCP2515 can module connected to a UNO (using the standard SPI pins 10 thru 13 wiring as shown in reference)
it fails

Can't init CAN

looks as though the <Canbus.h> has a problem with the MCP2515 can module

Test using the mcp_can library the MCP2515 can module works OK, e.g. running File>Examples>mcp_can>CAN_send

Entering Configuration Mode Successful!
Setting Baudrate Successful!
Initialized MCP2515
Message Sent Successfully!
Message Sent Successfully!
Message Sent Successfully!
Message Sent Successfully!

and the CANBUS shield V2 running File>Examples>mcp_can>CAN_receive

Entering Configuration Mode Successful!
Setting Baudrate Successful!
MCP2515 Initialized Successfully!
MCP2515 Library Receive Example...
Standard ID: 0x100       DLC: 8  Data: 0x02 0x01 0x02 0x03 0x04 0x05 0x06 0x07
Standard ID: 0x100       DLC: 8  Data: 0x03 0x01 0x02 0x03 0x04 0x05 0x06 0x07

What can module are you using?
try the mcp_can library?

I am using sparkfun CAN BUS Shield and the module is <Canbus.h>.
Please show the picture of the wiring you have made.

I am not using any module. I am using CAN Bus shield. please show the picture of the wiring that you made between arduino Uno and can bus shield.

The Canbus shield V2 is directly plugged into a UNO, photo

do you plug your sparkfun CANBUS Shield directly into a UNO or attach it using jumper wires?

the MCP2515_can_module is wired so
MCP2515_can_module

I am attaching it with jumper wires. I connected 5v and GND of shield with 5v and gnd of arduino.
Then I connected 10,11,12,13 pins of the sparkfun can bus shield v13 with pins 10,11,12,13 of the arduino.
still it is showing can't init CAN.

cannot you plug the shield into a UNO as shown in can-bus-shield-hookup-guide

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.