Need help with CAN bus

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I use an atmega168 and a MCP2515/2551 to talk CAN, for a car embedded product. They talk via SPI, both chips have a separated 16MHz crystal. The RS slope on the 2551 is 47k.

I sniff the bus in read only mode and can see all kind of messages on some cars (Hyundai Elantra, Pontiac G5, Chevrolet Cobalt, Saturn Vue) but on a few cars (Honda Odyssey, Jeep Patriot) the hardware sees nothing.

I am using the "kreatives-chaos" CAN library with blank filter in sniffing mode, on the car that are working, I can even send obd2 message and get the answer back (like rpm, temperature, etc) and I use filter, it works fine. On the cars that do not work, even if I send a request message to the ECU, I have no message coming from the MCP2515, no interrupt, meaning the 2515 does not see anything. I tried 250k and 500k speed bus.

I know a couple of people here used an AVR with a MCP2515/2551 for car embedded product, did you have problem with some cars? You can send me a PM if you prefer, give hints, discuss, give clues, whatever!

I went through all the library sources, the PDF, etc and everything is setted right, loopback is working fine too. The lib is pretty well written.

It's just that some cars do not work and I don't know why :?:

If someone can help me, thanks in advance!!!

Last Edited: Thu. Oct 22, 2009 - 01:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From a complete newbie...

"There are three different types of CAN modules available:
– 2.0A - Considers 29 bit ID as an error
– 2.0B Passive - Ignores 29 bit ID messages
– 2.0B Active - Handles both 11 and 29 bit ID Messages"

Are you using standard frames or extended frames and what are you expecting?

Something I doubt will make a difference is change RS to 10K (its only there for noise reduction, maybe 47K slows it down too much).

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In sniff mode I just sniff the bus, in a read-only mode. The chip is set to accept any packet being standard or extended frame. When a packet is received, the MCP2515 fire an interrupt to my AVR. It's just that on some cars this does not happen...

My schematic looks like this (the top left part with the MCP2515/2551) and of course I use an AVR, not a PIC.
http://www.obddiag.net/images/sc...
except that I have a 47k resistor on the RS pins.

I will double check all my resistors value, solder, etc, and may just shunt the 47k resistor to see if it makes a diff.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Honda uses 29-bit CAN starting in 2006. The Jeep Patriot uses 11-bit CAN starting in 2007. CARB requires that all vehicles use 500 kbaud on OBD.
Dave Raymond