Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Any general length considerations for SPI busses?

Any general length considerations for SPI busses?

2004-11-24 by James Washer

A friend and I are working on a system that will need a few "remote" devices (ADC, Temp sensors, etc) and are trying to determine just how long a wire/bus we can use with SPI. Is 20 feet reasonable?

 - jim

Re: [AVR-Chat] Any general length considerations for SPI busses?

2004-11-24 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: James Washer
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, November 24, 2004 6:44 AM
Subject: [AVR-Chat] Any general length considerations for SPI busses?


A friend and I are working on a system that will need a few "remote" devices 
(ADC, Temp sensors, etc) and are trying to determine just how long a 
wire/bus we can use with SPI. Is 20 feet reasonable?

You might be able to get it to work, but SPI is really intended for 
communication between devices on the same PCB. I'd give each device it's own 
MCU and use some sort of low-cost networking scheme.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller
http://www.kasamba.com/viewExpert.asp?conMemID=105725&Catid=1111&banID=2100

Re: Any general length considerations for SPI busses?

2004-11-24 by Gus

why SPI? you need at least 4 wires for that and it won't work 
right!!! use CAN instead

--- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:
> A friend and I are working on a system that will need a 
few "remote" devices (ADC, Temp sensors, etc) and are trying to 
determine just how long a wire/bus we can use with SPI. Is 20 feet 
reasonable?
> 
>  - jim

Re: Any general length considerations for SPI busses?

2004-11-24 by Graham Davies

--- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:

> ... working on a system ...
> ... a few "remote" devices
> (ADC, Temp sensors, etc)...

People would be able to help you more if you gave us some idea of the 
data rate you envision.  SPI can be pretty fast - do you need that? 
The suggestion to use CAN probably assumes you do. Cheaper and easier 
alternatives exist if a lower data rate would do.  An example would 
be LIN.  Anyway, as people say, SPI is not right for your application.

Graham.

Re: [AVR-Chat] Re: Any general length considerations for SPI busses?

2004-11-24 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: James Washer
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, November 24, 2004 3:32 PM
Subject: Re: [AVR-Chat] Re: Any general length considerations for SPI 
busses?


I'm a newbie at playing with HW.. I've been a software guy forever. Sorry 
for leaving out details.

I've got a couple of different situations.

1) I want to have a remote AVR with an LCD that shows system status. Nothing 
major, but with any of say 20 inputs( think automobile, door open, oil 
pressure low, ignition on, etc). The LCD needs to be updated with things 
change.  The AVR/LCD unit will be ~10 feet from the main controller.

2) Think home alarm/automation system. Temp sensors, door sensors, smoke 
alarms, motion detectors, etc. These "sensors" will be up to ~100 feet away

In neither case do I need much speed. I don't have any hard number here, but 
I'd thinking tens of bits/second is all I need.

p.s. What is LIN??


LIN (Local Interconnnect Network) is a networking system intended mainly for 
automotive applications where the speed and reliability of CAN isn't 
required. Atmel has an app note on a software implementation for the AVR.

Leon

Re: Any general length considerations for SPI busses?

2004-11-24 by brewski922

Not knowing what you meen by the controller but I it seems to me that 
the AVR/LCD would also be part of your controller.

As for the devices that feed you this info. The Door-Open, Ignition-
On, Smoke-Alarms and Motion-Detectors are binary and each couild be 
connected to it own pin on the AVR. The Oil-Pressure-Low in itself is 
binary but what ever detects the actual pressure is analog in and 
binary out.

For most applications the binary inputs could be hundreds of feet 
away.

For a temperature sensors with 1-wire devices a single AVR pin can 
handle 8 devices. A thermo-couple could be used without concern of 
the distance in a car. Actually the distance you will be running in a 
car probably noise and not the length of the cable will be a problem. 
The AVR has a very high input impedance so almost no current will be 
flowing. With zero current across any resistance and zero voltage is 
dropped. 
Voltage = Current x Resistance
V = 0 x 100 (100 ohms here is way too big still the result is zero)
Oh, you might have a microamp or so draw but still that would give 
you a drop of only about 1/1000 volt.

Now, if noise is picked up your readings could be all over the map. 
To cut down on noise you might try 2 wires with a shield. The shield 
only touches GND in the car at the AVR box. Then again noise may not 
be a problem. You need to do a little tril and error research here.

Mike


--- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:
> I'm a newbie at playing with HW.. I've been a software guy forever. 
Sorry for leaving out details.
> 
> I've got a couple of different situations. 
> 
> 1) I want to have a remote AVR with an LCD that shows system 
status. Nothing major, but with any of say 20 inputs( think 
automobile, door open, oil pressure low, ignition on, etc). The LCD 
needs to be updated with things change.  The AVR/LCD unit will be ~10 
feet from the main controller.
> 
> 2) Think home alarm/automation system. Temp sensors, door sensors, 
smoke alarms, motion detectors, etc. These "sensors" will be up to 
~100 feet away
> 
> In neither case do I need much speed. I don't have any hard number 
here, but I'd thinking tens of bits/second is all I need.
> 
> p.s. What is LIN??
> 
>  - jim
> 
> On Wed, 24 Nov 2004 14:40:04 -0000
> "Graham Davies" <YahooGroups@e...> wrote:
> 
> > 
> > --- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:
> > 
> > > ... working on a system ...
> > > ... a few "remote" devices
> > > (ADC, Temp sensors, etc)...
> > 
> > People would be able to help you more if you gave us some idea of 
the
> > data rate you envision.  SPI can be pretty fast - do you need 
that?
> > The suggestion to use CAN probably assumes you do. Cheaper and 
easier
> > alternatives exist if a lower data rate would do.  An example 
would
> > be LIN.  Anyway, as people say, SPI is not right for your 
application.
> > 
> > Graham.
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> > 
> > 
> > 
> > ------------------------------------------------
> > Yahoo! Groups Links
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AVR-Chat/
> >  
> > To unsubscribe from this group, send an email to:
> > AVR-Chat-unsubscribe@yahoogroups.com
> >  
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.

Re: [AVR-Chat] Re: Any general length considerations for SPI busses?

2004-11-24 by James Washer

I'm a newbie at playing with HW.. I've been a software guy forever. Sorry for leaving out details.

I've got a couple of different situations. 

1) I want to have a remote AVR with an LCD that shows system status. Nothing major, but with any of say 20 inputs( think automobile, door open, oil pressure low, ignition on, etc). The LCD needs to be updated with things change.  The AVR/LCD unit will be ~10 feet from the main controller.

2) Think home alarm/automation system. Temp sensors, door sensors, smoke alarms, motion detectors, etc. These "sensors" will be up to ~100 feet away

In neither case do I need much speed. I don't have any hard number here, but I'd thinking tens of bits/second is all I need.

p.s. What is LIN??

 - jim

On Wed, 24 Nov 2004 14:40:04 -0000
"Graham Davies" <YahooGroups@ecrostech.com> wrote:
Show quoted textHide quoted text
> 
> --- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:
> 
> > ... working on a system ...
> > ... a few "remote" devices
> > (ADC, Temp sensors, etc)...
> 
> People would be able to help you more if you gave us some idea of the
> data rate you envision.  SPI can be pretty fast - do you need that?
> The suggestion to use CAN probably assumes you do. Cheaper and easier
> alternatives exist if a lower data rate would do.  An example would
> be LIN.  Anyway, as people say, SPI is not right for your application.
> 
> Graham.
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> 
> 
> 
> ------------------------------------------------
> Yahoo! Groups Links
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>  
> To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>  
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

RE: [AVR-Chat] Re: Any general length considerations for SPI busses?

2004-11-24 by Larry Barello

You can run SPI pretty slow.  Since each line (MISO, MOSI and SCK) are
uni-directional, you could buffer them, or even use LVDS (but then where
would the simplicity be...)  SPI is really simple, primitive and you can
hang simple shift registers off the end.  The disadvantage of SPI is that
you need some sort of "enable" line for each peripheral.

TWI is another possibility, again, it was designed for board level
interconnect so 20ft is a stretch.  But, again, you can run it pretty
slow... but the device addressing is built into each part.

The only other solution would be some sort of multi-drop serial interface.
Or, to add external hardware to your AVR chips.  I assumed from the start
that you wanted to use minimal external components to make this work.
Show quoted textHide quoted text
-----Original Message-----
From: James Washer [mailto:washer@trlp.com]
Sent: Wednesday, November 24, 2004 7:32 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: Any general length considerations for SPI
busses?



I'm a newbie at playing with HW.. I've been a software guy forever. Sorry
for leaving out details.

I've got a couple of different situations.

1) I want to have a remote AVR with an LCD that shows system status. Nothing
major, but with any of say 20 inputs( think automobile, door open, oil
pressure low, ignition on, etc). The LCD needs to be updated with things
change.  The AVR/LCD unit will be ~10 feet from the main controller.

2) Think home alarm/automation system. Temp sensors, door sensors, smoke
alarms, motion detectors, etc. These "sensors" will be up to ~100 feet away

In neither case do I need much speed. I don't have any hard number here, but
I'd thinking tens of bits/second is all I need.

p.s. What is LIN??

 - jim

On Wed, 24 Nov 2004 14:40:04 -0000
"Graham Davies" <YahooGroups@ecrostech.com> wrote:

>
> --- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:
>
> > ... working on a system ...
> > ... a few "remote" devices
> > (ADC, Temp sensors, etc)...
>
> People would be able to help you more if you gave us some idea of the
> data rate you envision.  SPI can be pretty fast - do you need that?
> The suggestion to use CAN probably assumes you do. Cheaper and easier
> alternatives exist if a lower data rate would do.  An example would
> be LIN.  Anyway, as people say, SPI is not right for your application.
>
> Graham.
>
>
>
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
> ------------------------------------------------
> Yahoo! Groups Links
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>
> To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




Yahoo! Groups Links

Re: Any general length considerations for SPI busses?

2004-11-24 by Graham Davies

--- In AVR-Chat@yahoogroups.com, James Washer <washer@t...> wrote:

> In neither case do I need much speed.
> ... I'd thinking tens of bits/second
> is all I need.

I thought so. CAN is overkill. You need something low-speed and 
robust that is simple to implement. I would suggest looking into LIN. 
It is a multi-drop, two-wire serial network with a master/slave 
architecture which fits your description.  It also conforms to the 
general direction of the suggestions other people are making. A big 
advantage is you can get the specifications for free! Since the whole 
project is private, you could implement any part of the standard you 
wanted to without the obligation of complete conformance. In other 
words, treat it as a bunch of suggestions.
http://www.lin-subbus.org/

What have you put together for hardware? There are people here who 
may have products that would help you get going. Maybe a MAVRIC from 
BDMICRO? I have a JTAG on-chip debug interface called the AVR ICE-
Cube at http:/www.ecrostech.com and also a carrier for the AVR 
Butterfly, though I don't think the Butterfly is what you want.

Graham.

RE: [AVR-Chat] Any general length considerations for SPI busses?

2004-11-24 by wbounce

Isn't SPI a way to connect a pc to a MCU to program it. IF so I am using
a 6 foot cable for that.
Show quoted textHide quoted text
-----Original Message-----
From: Leon Heller [mailto:leon.heller@dsl.pipex.com] 
Sent: Wednesday, November 24, 2004 5:08 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Any general length considerations for SPI
busses?



----- Original Message ----- 
From: James Washer
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, November 24, 2004 6:44 AM
Subject: [AVR-Chat] Any general length considerations for SPI busses?


A friend and I are working on a system that will need a few "remote"
devices 
(ADC, Temp sensors, etc) and are trying to determine just how long a 
wire/bus we can use with SPI. Is 20 feet reasonable?

You might be able to get it to work, but SPI is really intended for 
communication between devices on the same PCB. I'd give each device it's
own 
MCU and use some sort of low-cost networking scheme.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller
http://www.kasamba.com/viewExpert.asp?conMemID=105725&Catid=1111&banID=2
100 




 
Yahoo! Groups Links

Re: Any general length considerations for SPI busses?

2004-11-24 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "wbounce" <wbounce@s...> wrote:

> Isn't SPI a way to connect
> a pc to a MCU to program it.

No. You're thinking of ISP. In-System Programming.

Graham.

Re: [AVR-Chat] Re: Any general length considerations for SPI busses?

2004-11-25 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: Graham Davies 
To: AVR-Chat@yahoogroups.com 
Sent: Wednesday, November 24, 2004 11:25 PM
Subject: [AVR-Chat] Re: Any general length considerations for SPI busses?



--- In AVR-Chat@yahoogroups.com, "wbounce" <wbounce@s...> wrote:

> Isn't SPI a way to connect
> a pc to a MCU to program it.

No. You're thinking of ISP. In-System Programming.

The AVR uses SPI for ISP, though. 8-)

Leon

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.