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: Reza Naima
Subject: Re: [avr-gcc-list] Anyone interface an AVR with a CAN bus?
Date: Sun, 25 Jul 2004 22:02:09 -0700
User-agent: Mutt/1.5.5.1i

> 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.

I've decided that that's going to be the route I take.
 
> 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 willing to buy them.  I've already gotten the ISO 15765-1 doc which
just refers to the other relevant docs.  The ISO 15765-4 seems the most
interesting, but I can't find that for sale anywere.  Do you have any
references or information availabe.  Or know where I can pick up that
(or ay related) documents.  

> 
> >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.

Will a ceramic resonator work?  I find them easier to deal with than
crystals.  And they're cheaper :)

> 
> >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'll track down the relevant app note -- I don't suppose you remember
the title...

 
> >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"?

Unfortunatly, I'm contractually obligated not to share too much
regarding the details, but it will be a scan tool of sorts..  I've
finished implementing the ISO, VPWM, and most of the PWM (pain in the
ass to deal with the timing issues) protocols, and just found out that
they also want me to implement the CAN protocol.  Yay ;) 

Reza 


p.s. I've posted a simple schematic of how I think the AVR should hook
up to the CAN controler and transiever.  If you wouldn't mind looking at
it -- am I missing anyhthing?  I'm not sure what resitor values I should
use for the CAN termination and the slew rate control... I'm picking 120
and 10, respetctivly, as that's what I've seen used elsewhere...


reply via email to

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