Electronic – Why would you need a floating signal on a board


I read the following from a book titled "An Embedded Software Primer" by David E. Simon. (23rd print Nov/2014 – Page 16)

enter image description here

If no part on the circuit is driving a signal, then that signal is
said to be floating. Its voltage will be indeterminate and may change
as time passes. The results of a floating signal vary between harmless
and disastrous, depending upon how the parts with inputs connected to
the floating signal cope with the problem.

Based on this, it looks like there is no good reason why would a circuit have a floating signal. If this is right, then why would such signal be allowed?

Is this done due to a mistake in the board design?

Are there scenarios where such a signal is needed?

Best Answer

Floating signals are usually not a good thing, but can be acceptable in some cases. In all those cases, the value of the signal does not matter.

Not every signal is relevant all the time. A common example is the MISO line of a SPI bus. This is only actively driven when a slave device is selected (enabled). It's value is only relevant for a short time around one of the SCK clock edges. At all other times, the signal can be any state without affect on the system since the system ignores it.

So what happens to MISO when no slave is selected, as is the case whenever the SPI bus is not in use? The answer is you don't care. It doesn't matter what its value is since nobody is looking at it. Since MISO is driven only by the single selected slave, all unselected slaves and anything else on that line must be high impedance. That means when no slave is selected, the line is left floating as described in the passage you quoted above. This causes no bad data, since again, the system is ignoring the line at that time.

While a floating line is OK logically when nothing is looking at its value, it can be a problem electrically. Many logic inputs are intended for the voltage to be either solidly low or solidly high. In-between values can cause higher than specified currents in the input circuit, and in some cases can even cause this circuit to oscillate.

For this reason, there is often a weak pulldown or pullup resistor on lines that could float. I usually use a 100 kΩ pulldown on MISO, for example. When a slave is selected, it drives the line regardless of the small extra current it takes to hold it in the high state. However, when nothing is driving the line, it will go low, preventing the unwanted extra current and oscillations in anything receiving the signal.

There are also types of digital inputs that can handle any voltage within the valid range without undesirable characteristics, like extra current or oscillations. Schmitt triggers are one example. These have hysteresis so that after flipping one way, it takes a different voltage to flip the other way. A floating line may cause the digital signal to be interpreted randomly as its voltage floats around, but the digital input is designed to handle that. Of course the rest of the system still needs to be designed to not care what the value of that digital signal is during the time its floating.

In general, truly floating signals are bad, but can be easily addressed with a weak pulldown or pullup resistor.