Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SPI failure with long connections (not Netduino specific?)

SPI

  • Please log in to reply
2 replies to this topic

#1 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 16 January 2013 - 10:15 PM

Hi all,

 

Finally realized my password reset emails were going to my spam folder. Happy to be here.

 

I've got a project going that interfaces an external AD7714 with a microcontroller. Previously, I had used the Arduino UNO, ChipKit UNO32, and now the Netduino Plus 2. Each time, I've noticed that if the leads for the digital signals are extra long, I constantly get error codes and need to reset the ADC. However, the best way to fix this is to simply shorten all the leads. My project has been running for over an hour now and the error count is still 0.

 

While the problem is solved, I'd like some insight into why that solves things. Does anyone have any ideas?



#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 17 January 2013 - 08:18 AM

While waiting for an answer from more qualified member like Mario Vernari, have a look at Cable Connected, Signal Lost, it discusses this [transmission line] phenomenon in great details.

 

Welcome to the community!



#3 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 17 January 2013 - 08:37 PM

Hi Verdris,

 

Good to have you here!

 

How long is too long, and how long is shortened?

 

In simple terms there are a few things happening when the leads get longer.

 - the signals take longer to get to the other end. If all the data is in one direction this may never be a problem, but if the data is being transferred in both directions (e.g. you are supplying a clock to clock data out of a remote sensor) then the round trip delay could become a problem when the received data arrives too late to be clocked into the master's circuitry.

 - the resistance of the cable will attenuate the signals as they travel. If the resistance is too high, the signal arriving at the other end may not be large enough to register as a high logic level.

 - the capacitance and inductance of the cable will act as a filter. The nice square signals will become "R-C" curves. This can cause two issues

- the signals may be filtered so much they don't have a chance to reach a logic high before they start to fall back down again for the next clock edge.

- the slowly rising/falling edges may be detected as more than one edge (two or three clock edges for the price of one).

 - the cables will pickup more electrical noise from other sources. Mains noise (50 or 60Hz) is an obvious source of noise, but there may be other sources where you are. On its own, the devices might be tolerant of this noise, but adding noise to a slowly rising signal can be detected as several pulses.

 

One really simple thing to try is to turn down the SPI clock speed, this will allow more time for the signals to propagate.

Other fixes may be to use screened cable, amplification of the SPI signals or using a transceiver chip to drive the lines.

 

Hope this helps - Paul







Also tagged with one or more of these keywords: SPI

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.