Crosstalk between digital inputs


RichardE

Recommended Posts

I wonder if anyone would care to comment on this:

I'm just starting out on VHDL and following the IntroToSpartanFPGABook. One of the early examples configures C0 to C7 as digital intputs which are connected to switches and configures C8 to C15 as digital outputs which are used to drive LEDs. The states of the 8 switch inputs are written to the 8 digital outputs.

However, not having a LogicStart MegaWing I only have the one switch and I move that around the digital inputs. What I was finding was that when only a single digital input was pulled high 2 of the LEDs would turn on - the one I expected and also an adjacent one.

I was convinced I must have a short somewhere in the wiring to the LEDs or a solder bridge between pins on the header but I could not find it. Then it struck me that since I only had the one switch, all the remaining inputs were left floating so I changed the constraints so that all the digital inputs had pulldowns and now it works fine - only one LED turns on if only a single input is taken high.

I realise it is not really a good idea to leave inputs floating but I have to admit that when working with PIC micros and the like I have on occasions left inputs floating with no ill effects. I have seen many designs where unused IO pins have been left configured as inputs.

So my questions are:

1. Is the behaviour I describe above something others have experienced and would this be expected?

2. Are the Spartan 3E FPGAs particularly susceptible to this because of the construction of the inputs?

3. Aren't all unused IO pins configured as inputs? Does this mean I should really connect all unused inputs to 0V (or with a pullup or pulldown resistor)?

Link to comment
Share on other sites

Hi Richard,

indeed, floating inputs can read any value and are sensitive to interference and charge accumulation. This happens in all devices, and with more expression on those who have CMOS inputs.

Most micros use some sort of weak pullup/pulldown to avoid this sort of interference, when you leave them floating (which, by the way, is not advisable at all).

So there are basically two things you can try on your design:

1) Change inputs to TTL (makes them more resilient to interference)

2) Add a weak pulldown or pullup to the pins

To implement 1), edit your constraints (the .ucf file), and change the IO standard to TTL, something like this:

NET YOUPINNAME LOC="???" | IOSTANDARD=LVTTL;

To implement 2), edit the constraints and add the pulldown (or pullup) constraint to the IO pins, like this:

NET YOUPINNAME LOC="???" | IOSTANDARD=LVTTL | PULLDOWN;

Hope this helps.

Alvie

Link to comment
Share on other sites

I've also seen the same things on ADCs. A without a small load connected a floating input ADC will slowly build up charge over time.

In a somewhat unrelated context, There is a "property" for the "Generate Programming file" process that allows you to set the state of all "unused pins" (those without signals connected to them) as "pull up", "pull down" or "float".

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.