ADM CANBUS - Unexpected issues.

Hi All.

I’ve had a pretty good read of the forum and haven’t seen anyone doing “Exactly” what I’m doing. I see there is a CANBUS post here nearly everyday, but I feel like someone might have seen the issue before.

—The Hardware—

-Arduino 2560 Mega.
-MCP2515 Transceiver Sheild.
-Ford Falcon G6E Turbo, MK2, 2013.

I have attached how it is all wired up in the attachments section should you need to double check it.

To Confirm, the Wiring is:

VCC - > 5V
SCK - > PIN 52
CS → PIN 53

I have also used Signal + Chassis ground interchangeably to the Arduino, didn’t help.

The Addition to the Librarys I’ve made is

// Pins remapped to Arduino Mega 2560
#define P_MOSI B,2 // pin 51
#define P_MISO B,3 // pin 50
#define P_SCK B,1 // pin 52
#define MCP2515_CS B,0 // pin 53
#define MCP2515_INT E,4 // pin 2
#define LED2_HIGH H,5 // pin 8
#define LED2_LOW H,5 // pin 8

The Wires I’ve used are jumpers, just straight cables, not twisted around each other. I don’t believe this is the problem as I am able to read data.

—The Problem—

I am using the Spark Fun CAN_Bus_Shield Library (GitHub - sparkfun/CAN-Bus_Shield), just trying to read from the car. My sketch, CarTest1, is basically just the example for reading the CANBUS, provided in the aforementioned library. I have configured all the pins for the mega in that library, allowing me to use the shield, mega and library in concert.

So, In that sketch, the CAN Inits okay, and the data starts flowing (Evidence Attached). Great, I thought. After about a minute, on the small LCD in my gauge cluster, I got a Transmission fault, followed by a DSC Fault and finally a communication fault.

Seeing this, I quickly turned off the car and removed the pins from the OBD2 Connector, turned the car off and then back on again. This cleared all the problems, I took the car for a quick spin it performed as normal.

This is completely repeatable, and happens every-time I plug the cables into the port after about a minute of operation. I feel as though it could be to do with termination perhaps, but I am not an expert of any kind on the CANBUS, and was hoping someone could shed some light on what they thought might be happening. I am most surprised by this, as I am not trying to write to the CAN, only read from it.

Lastly, I thought I would try to send/receive on the canbus, basically just to try something different, using the example found here CAN-Bus_Shield/SparkFun_CAN_Demo.ino at master · sparkfun/CAN-Bus_Shield · GitHub. As soon as I entered 1, send into the serial monitor, the coolant temp on the dash went to 100% and the car did its usual concert of the transmission fault, dsc fault and comms fault.

ANY assistance would be greatly appreciated.

CarTest1.ino (1.81 KB)

First Read Of OBD2.txt (89.1 KB)

This is just a guess but 9600 baud is slow. I wonder if your sketch is blocking because of the output buffer being full.

Hey WildBill,

Appreciate the reply. I tried commenting out the loop and just leaving the canbus connected, not printing anything to the serial line, this issue still persisted.

I will try increasing the Baud tomorrow, will post more definitive results then.

Is your car using 11 or 29 bit addressing?

It looks like the library you are using only allocates 16 bits for the address field.

Hey Mikb55,

The car uses 11 Bit addressing. Could this be the problem that I am facing?

I wouldn't have thought that mattered when I'm only reading from the CANBUS? Either way, id be eager to try changing it, What is your recommendation there?

Put the MCP2515 into listen mode. This will prevent it sending ACK bits and so will make it invisible to the rest of the car. If you still get errors then it's likely that the wiring or termination is causing problems.

Hey all,

Thank you for your responses.

I ended up swapping to the Arduino Uno to read the canbus. When I used the library I had been using (Spark Fun Canbus) I got the same Errors, So I swapped to a different library (Arduino CAN, GitHub - sandeepmistry/arduino-CAN: An Arduino library for sending and receiving data using CAN bus.) and that has worked Flawlessly. Will now attempt to use a second board to display the info.