avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Anyone interface an AVR with a CAN bus?


From: Bruce D. Lightner
Subject: Re: [avr-gcc-list] Anyone interface an AVR with a CAN bus?
Date: Sun, 25 Jul 2004 21:39:03 -0700
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

Reza Naima wrote:

I'm looking at interfacing with the OBD2 CAN inteface that is starting
to appear on cars these days.  However, the document that describes how
they encapsulate OBD2 over CAN is not yet available, although it was
drawn up over 2 years ago.  So I'm not even sure what speed the bus is
going to operate at either -- but I've got a good logic analyzer that
should help determine the clocking speed..

Both 500 Khz and 1 Mhz are used in U.S. vehicles, starting with model year 2003. That's fast enough that you likely will need a dedicated "CAN controller" chip.

In fact there are both SAE *and* ISO standards which apply to the OBD-II automotive CAN-bus. They are in fact "available"...for a fee. However, getting everthing you need is pretty expensive. (One of the ISO standards is less than 5 pages long, and, as I recall, each ISO standard costs ~$100...what a rip-off!)

I'm looking at going with the MCP2515 controllre IC, though I'm not sure
how fast of an oscillator it needs.

For 1 MHz OBD-II CAN, you will need 16 MHz clock with that chip.

I found one schematic that shows it
hooked up to a 16mhz resonator.  The data sheet doesn't provide a value
either, just a description of how to hook it up.  I'm going to draw up a
schematic, order the parts, and try to get it work.  Wish me luck ;)

You shouldn't have any problems if you follow the Microchip app note. I've made it work with a couple of different AVR chips.

I'm curious, if I want both the MCP2515 and the ATmega16 to operate at
16mhz, any issues with having one of them clock the other one to save on
xtal costs?

You probably would have to use the AVR part as the source of a "common" 16MHz clock. As I recall, the MCP2515 oscillator doesn't run until it is "turned on", which would require a running AVR part. Using a 16 MHz oscillator chip will surely work, but that may be a power/cost issue.

Sharing the AVR's 16 MHz clock with the CAN controller may be asking for trouble because of the extra load. It *may* work, but given the lack of decent detailed electrical specs for both chip's oscillator circuits, I'd be afraid to go into "production" with such a solution.

So, are you making your own OBD-II "scan tool"?

Best regards,

Bruce

--
 Bruce D. Lightner
 Lightner Engineering
 La Jolla, California
 Voice: +1-858-551-4011
 FAX: +1-858-551-0777
 Email: address@hidden
 URL: http://www.lightner.net/lightner/bruce/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]