views:

558

answers:

4

What serial communication bus would you use in a automotive embedded system if your main selection criteria were:
* Electrically robust
* Slow speed (32 kb/s)
* Easy to program
* Easy to interface with microcontrollers

It won't be transferring much data, but it will need to be transferred periodically at high speed (100 - 500 Hz). I find that RS-232 is just not reliable enough if you have noise in your ground line. CAN-bus seems interesting, but I have no experience with it.

We are currently interested in a combination of AVR AT90CAN128 microcontrollers.

+3  A: 

For all out reliability you can't go past CANbus (but then that was sort of implied by your choice of processor?)

Depending on what you want to interface to, this can be very simple - the base level protocol is quite straight forward. But if you want to talk to any other non-proprietary devices you'll have to implement the higher protocols (eg. CANopen).

But if CANbus isn't appropriate, then I would recommend RS485 or RS422 (depending on your topology). If all you're trying to achieve is point to point communications it's identical to RS232. (you'll have to put your own protocol layer on top if you're trying to support multidrop comms though.)

Andrew Edgecombe
+7  A: 

You've already chosen the AT90CAN128, whose standout feature compared to other AVR processors is support for the CAN bus. There really is not a better choice than CAN for an automotive application with your data rate and noise immunity requirements. If you march in to an automotive customer with anything other than CAN, you'll end up spending all your time defending the decision not to use it.

With that said, for noise immunity in a hostile environment like a car you'll need a bus using differential signaling. That rules out i2c or SPI, which is unfortunate because they meet your other requirements. RS-485 would be workable as @Andrew Edgecombe points out.

If you're not building a commercial product but instead building something for your own use to put in the engine compartment, you can probably get by with USB. USB will make it easy to interface with a laptop in the passenger compartment, and though it isn't designed for high-noise environments it is differentially signaled at a reasonably high voltage.

DGentry
One note: I saw a presentation from Toyota a few years ago about using Ethernet. They wouldn't use it for engine control, but everything else was possible from climate control signaling to piping audio from the radio to the speakers. They were interested in plastic optics with LED transceivers.
DGentry
A: 

As others said, CAN is standard, robust, more robust with slow speed etc.

And there's even support in Linux kernel for it from version 2.6.15 if you ever need bigger system.

Harriv
A: 

Two other excellent choices other than CAN are LIN and FlexRay. LIN is a simpler, slower interface while FlexRay is more robust and designed for safety critical systems like real-time controls of brakes.

For a nice overview chart of how the various bus choices interrelate see this slide.

JonnyBoats