MCP2515 module + Mega2560

Hi,

So I know there's quite a few posts about CAN already, but I'm really struggling to get this to work.

I've recently purchased a MCP "module" that looks like this:

First hurdle was finding out the 8MHz crystal didn't work with the Seeedstudio/Coryjfowler's examples - so I went ahead and swapped that out for a 16MHz crystal from Maplin.

I'm currently having issues getting it work still. I've tried Seeedstudio's library, and even followed the advice about using the ICSP headers on the Mega for SCK, SI and SO (And changing CS to pin 9). I've then also tried using pin 50,51,52, and 53 for the SPI lines too.

When running the Coreyjfowler's receive example in debug mode, I get "Enter setting mode fall" which is obviously an issue communicating with the MCP2515 chip to set it Baudrate etc. As mentioned I've tried numerous different pin locations for this, but no matter what, I can't seem to get this to work!

I then tried the sketch posted by Tobias K. here:
http://www.mikrocontroller.net/topic/216833

It returned simply "MCP2515 status: 0" most of the time. I thought I'd try pushing my connections on the MCP module side of things a little harder to ensure they were secure - as I did this, it returned a status of "111111", but I suspect this was due to me perhaps somehow shorting the pins on the back of the module with my thumb more than a loose connection.

Unfortunately I don't speak German, and translate gave some sketchy results, but it seemed to be a hardware issue?

Has anyone got any advice on how to proceed here at all? I've "wasted" more time than I care to admit switching pins around, and trying different libraries and fixes elsewhere. So any suggestions are welcome!

I've put a few more hours into this and got nowhere.. I'm using seeedstudios library at the moment, and tried pin 53 for the SPI CS pin, but no luck.

Here is my current wiring before changing the CS pin to 53. hopefully the ICSP headers are clear enough for you all, didnt notice the rogue gnd wire.

In the above picture I had wired it wrong (coming back to it later at night I instantly recognised the issue) - SCK was on Pin2, rather than Pin3. After I corrected this, I got it setting the CAN Baudrate perfectly.

So I took it out to my car and set it up - started logging the 500KBPS lines, and then my laptop's battery died, I packed the Mega and MCP2515 module into my glove box and went to recharge my laptop. The enxt day I came back to do some more logging and suddenly the failed to set CAN rate was showing again.

I went through each and every Dupont pin, bending the small contact grips to form a more tighter contact to the pins as I suspected it may possibly be a bad connection. This didn't help, so I went a step further and have now soldered the wires directly to the 7 pins on the module.

I still receive the error, but when applying pressure to the back of the module board with my thumb (over the pin header/PCB solder joints) I get a successful message again.

Any suggestion on what may be causing this? I have tried resoldering the pins to the PCB with no luck.

If you can't see any possible short on your solder jib, might try to run your solder iron through the SMD pads, those are more likely to have a loose connection. Especially that you mentioned tha pressure on the board "fix" the issue.

Make sure you clean the board before apply some flux to prevent bridges when running the solder iron with some small quantity of solder on the tip.

Cheers

sorry for re-opening the post...can u post the sketch to read the canbus with this module?