i have a Arduino Mega 2560 R3 and a Sparkfun CAN Bus Shied. Im using the SparkFun_CAN-Bus_Arduino_Library-master. I want to communicate over SPI (they have diffrent SPI pins), so i had to change it in defaults.h Changes:
#define P_MOSI B,2 // new pin: 51, orginal: #define P_MOSI B,3
#define P_MISO B,3 // new pin :50, orginal: #define P_MISO B,4
#define P_SCK B,1 // new pin :52, orginal: #define P_SCK B,5
#define MCP2515_CS B,0 // new pin:53, orginal: #define MCP2515_CS B,2
i connected the pins:
Arduino Mega Pin - Sparkfun pin
51 - 11
50 - 12
52 - 13
53 - 10
also connected: 5v, gnd, rst, (pin 2)
Before i realized that spi pins are diffrent, the can init from demos dont worked.
After changes, init worked but e.g. CAN_Write_Demo i can not see the data in PCAN-View. There is nothing.
I read that PCAN-View is not compatible with my lib so i try the MCP_CAN_lib-master, same problem. I also tried it with Vector CAN, with both libraries same problem.
Why can't I see the messages?
I also tried other demos e.g. CAN_Read_Demo and sent a can message with PCAN-View but get nothing.
When i run write demos, it dousnt even send anything and when i run read demos e.g. sending from PCAN-View, status from PCAN-View changes instant to BUSHEAVY.
Thank you for helping.