Starting CAN failed!

I tried the CAN library recommended here - CAN - Arduino Reference
and, I have tried to adjusted the 2 parameters for MCP2515 as it was told here - arduino-CAN/API.md at master · sandeepmistry/arduino-CAN · GitHub

//MCP2515 only
  //frequency - new SPI frequency to use, defaults to 10E6
  //This call is optional and only needs to be used if you need to change the default SPI frequency used.
  //Some logic level converters cannot support high speeds such as 10 MHz,
  //so a lower SPI frequency can be selected with CAN.setSPIFrequency(frequency).
  //Override the default SPI frequency of 10 MHz used by the library. Must be called before CAN.begin(...).
  CAN.setSPIFrequency(8E6);

  //MCP2515 only
  //Override the default clock source frequency that is connected to the MCP2515. Must be called before CAN.begin(...).
  //clockFrequency - new clock frequency to use (8E6, 16E6) connected to MCP2515, defaults to 16 Mhz
  //This call is optional and only needs to be used if you need to change the clock source frequency connected to the MCP2515.
  //Most shields have a 16 MHz clock source on board, some breakout boards have a 8 MHz source.  
  CAN.setClockFrequency(8E6);

while, it was always prompted: Starting CAN failed!
any suggestion is welcome!

2 Suggestions. First if you do not have a second CAN module on the buss or it is not properly terminated or the grounds are not connected this is what I would expect. Solution build a second module and correct the errors. Second post a schematic of your system as wired, not a frizzy picture. CAN can be very difficult until things are connected correctly. Most of the time it does not work because there is not a second module to ACK the transmission.

Here is my wiring:

Great schematic! You have only one termination resistor, generally you need them at the physical ends of the bus which is 60 Ohm. How do you determine you have received a character. The code I use uses the INT line. Other then that I do not see why it would not work. Also I have read about problems when the bus was to short, less than 2 meters.

My problem is when I connected 2 CAN modules like this, it couldn't even initiated correctly.

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