Go Down

Topic: Which are the necessary pins for the Sparkfun CAN-BUS shield? (Read 2044 times) previous topic - next topic

JustWannaLearn

I wanna test the Sparkfun CAN-BUS shield (https://learn.sparkfun.com/tutorials/can-bus-shield-hookup-guide) but I don't want to solder everything. I've found this source code https://github.com/sparkfun/SparkFun_CAN-Bus_Arduino_Library/blob/master/src/defaults.h that specifies pins 2,3,4,5, but I think they're AVR pins, not arduino ones. So, which pins are them in arduino UNO?

The other pins I must solder are RX/TX, 5V and GND, right?

pylon

Quote
I've found this source code https://github.com/sparkfun/SparkFun_CAN-Bus_Arduino_Library/blob/master/src/defaults.h that specifies pins 2,3,4,5, but I think they're AVR pins, not arduino ones. So, which pins are them in arduino UNO?
That's not AVR pins but port bits (that's why there is a letter in front of the number).

The Sparkfun CAN bus shield connects to pins 9, 10, 11, 12 and 13 of the Arduino (so it's not compatible with the Mega2560 for example), while pin 9 is the CS for the SD card interface, pin 10 is the CS for the MCP2515 and pins 11, 12 and 13 are the SPI bus lines (MISO, MOSI, SCKL).

Quote
The other pins I must solder are RX/TX, 5V and GND, right?
To use the CAN bus you don't need the RX/TX connection, that's for the optional GPS module only.

JustWannaLearn

oh yes, I meant TX/RX for serial listening on the test module :)

thank you!

JustWannaLearn

That's not AVR pins but port bits (that's why there is a letter in front of the number).

The Sparkfun CAN bus shield connects to pins 9, 10, 11, 12 and 13 of the Arduino (so it's not compatible with the Mega2560 for example), while pin 9 is the CS for the SD card interface, pin 10 is the CS for the MCP2515 and pins 11, 12 and 13 are the SPI bus lines (MISO, MOSI, SCKL).

To use the CAN bus you don't need the RX/TX connection, that's for the optional GPS module only.
I soldered 9,10,11,12,13, GND, 5V, 3V, but I'm getting

CAN Read - Testing receival of CAN Bus message
Can't init CAN


Are you sure those are the pins?

pylon

CAN INT is connected to D2 but you didn't ask for that connection nor did you ask if these are all connections needed to run the shield.

If you need only the CAN part of the shield you have to connect D2, D10, D11, D12, D13, 5V, GND and RESET.

JustWannaLearn

Thanks, it worked!

I also just found the schematic. I understand what's MISO, MOSI, SCK, but what's CAN_CS and CAN_INT?

pylon

Quote
I also just found the schematic. I understand what's MISO, MOSI, SCK, but what's CAN_CS and CAN_INT?
CAN_CS is the chip select for the MCP2515. On an SPI bus every chip needs a separate CS line to address that particular chip. If the chip select line is not LOW, the chip will ignore the bus lines and put them into high impedance state.

CAN_INT is specific to the MCP2515 and signal that data was received (maybe also other notifications). If you want to know more about it, consult the datasheet of the MCP2515.

mocanduino

hello @JustWannaLearn i am using the the same sparkfun can shield and arduino uno and i want to test the canbus but i am struggling with connecting the correct pins. i connected pin 9,10,11,12,13 on the uno board to pins # 9,10,11,12,13 on the CAN-SHIELD and i also connected the GND and the 5V. but still giving me

Can't init CAN



Go Up