On Tue, 28 Apr 2009 17:38:05 -0700 (PDT), jleslie48 <jon@jonathanleslie.com> wrote:>Its an electrical question, I mean I somehow have to attach my input >pin to the external wire rather than to ground, but that means there >will be two 3.3 volt signals on that wire, that doesn't sound good.You directly attach the external wire to the input pin. The pull-up on the input pin is a weak pull-up so when the external wire is at 3.3V, it agrees with the pull-up and you see a high signal internally. When the external signal is driving 0V, it overrides the pull-up and pulls the input node to ground and you see a low internally. There is no issue with the pull-up pulling to 3.3V and the external wire also driving a 3.3V to the same node. -- Muzaffer Kal DSPIA INC. ASIC/FPGA Design Services http://www.dspia.com
a basics question: using input pins, pullup, short to ground vs driven signal.
Started by ●April 28, 2009
Reply by ●April 28, 20092009-04-28
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:46 pm, Muzaffer Kal <k...@dspia.com> wrote:> On Tue, 28 Apr 2009 17:30:35 -0700 (PDT), jleslie48 > > > > <j...@jonathanleslie.com> wrote: > >> > My question is if I want to take my driven output and run it around as > >> > an input signal, how do I do that? > > >> Are you saying you want to connect an output pin to an input pin and > >> leave the pushbutton connected so that either can drive the input? > > >> Make the output pin so called "open collector" that only drives low and > >> floats high. > > >> outputpin <= '0' when mysignal = '0' else 'Z; > > >> -Jeff > > >the part that confuses me, is the 3.3 volts that I see sitting on the > >input pin when its not tied to ground. how can I send "in" from the > >external wire 3.3 volts when it already has 3.3 volts on it? > > If you consider that there is always a connection to the input pin, I > think it would clear up your issue. If you have a pull-up with 3.3V > and the input agrees with it, you are sending in a high signal. If > your external driver disagrees with the pull-up and drives a 0, you're > sending in a low signal. If you had a 3rd state where you didn't know > if a driver is connected then you might need another signal to detect > if there is a driver or only if the pull-up is connected but I don't > think that's your configuration (actually even in that case, with a > true tri-state IO you can detect if a driver is "driving" or not). > Does that help? > -- > Muzaffer Kal > > DSPIA INC. > ASIC/FPGA Design Services > > http://www.dspia.comahh! so if I connect these two wires, the input (at a steady 3.3 volts) and the other wire (that changes between 0 and 3.3 volts) that is a normal thing to do. When both wires are at 3.3 volts I'll get one signal on the input pin, and when one is at 3.3 (the input pin) and what its connected to is at 0 volts (the external wire) the external wire acts just like the closing the switch scenario aka, connecting the pin to ground, and thus changes the state on the input pin from 0 to 1 (or 1 to 0, whatever.) It that how it works?
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:56 pm, Muzaffer Kal <k...@dspia.com> wrote:> On Tue, 28 Apr 2009 17:38:05 -0700 (PDT), jleslie48 > > <j...@jonathanleslie.com> wrote: > >Its an electrical question, I mean I somehow have to attach my input > >pin to the external wire rather than to ground, but that means there > >will be two 3.3 volt signals on that wire, that doesn't sound good. > > You directly attach the external wire to the input pin. The pull-up on > the input pin is a weak pull-up so when the external wire is at 3.3V, > it agrees with the pull-up and you see a high signal internally. When > the external signal is driving 0V, it overrides the pull-up and pulls > the input node to ground and you see a low internally. There is no > issue with the pull-up pulling to 3.3V and the external wire also > driving a 3.3V to the same node. > -- > Muzaffer Kal > > DSPIA INC. > ASIC/FPGA Design Services > > http://www.dspia.comahh! so if I connect these two wires, the input (at a steady 3.3 volts) and the other wire (that changes between 0 and 3.3 volts) that is a normal thing to do. When both wires are at 3.3 volts I'll get one signal on the input pin, and when one is at 3.3 (the input pin) and what its connected to is at 0 volts (the external wire) the external wire acts just like the closing the switch scenario aka, connecting the pin to ground, and thus changes the state on the input pin from 0 to 1 (or 1 to 0, whatever.) If that is correct I think I've got it. So I'm perfectly fine having the two 3.3 volts values on both wires. I just wanted to make sure. My first two years with the company I earned a reputation for smoking equipment (I toasted easily $70,000 worth of stuff,) and I'm determined this year to not fry anything. Thanks Jon
Reply by ●April 28, 20092009-04-28
On Tue, 28 Apr 2009 18:07:59 -0700 (PDT), jleslie48 <jon@jonathanleslie.com> wrote:>ahh! so if I connect these two wires, the input (at a steady 3.3 >volts) and the other wire (that changes between 0 and 3.3 volts) that >is a normal thing to do.Yes but only because the input 3.3V is being generated by a weak pull-up.> When both wires are at 3.3 volts I'll get one >signal on the input pin, and when one is at 3.3 (the input pin) and >what its connected to is at 0 volts (the external wire) the external >wire acts just like the closing the switch scenario aka, connecting >the pin to ground, and thus changes the state on the input pin from 0 >to 1 (or 1 to 0, whatever.) If that is correct I think I've got it.That's correct. -- Muzaffer Kal DSPIA INC. ASIC/FPGA Design Services http://www.dspia.com
Reply by ●April 29, 20092009-04-29
On Tue, 28 Apr 2009 17:30:35 -0700 (PDT), jleslie48 <jon@jonathanleslie.com> wrote:>On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote: >> jleslie48 wrote:>> Make the output pin so called "open collector" that only drives low and >> floats high. >> >> outputpin <= '0' when mysignal = '0' else 'Z; >> >> -Jeff > >the part that confuses me, is the 3.3 volts that I see sitting on the >input pin when its not tied to ground. how can I send "in" from the >external wire 3.3 volts when it already has 3.3 volts on it?Since this is a pushbutton input, you can be sure that isn't a "hard" 3.3V, i.e. a direct connection to the 3.3V supply. Otherwise the pushbutton would be a dead short across the supply. (The pushbuttons normally used are simple "make" or occasionally "break" contacts rather than changeover switches. Unlike the slide switch in one of Antti's recent puzzles, which had a "neither" position between its two intended states.) First step. Confirm this by looking at the board schematic; expect to see a pullup resistor to 5(er... 3.3)V and a simple switch to 0V. And note the resistor value (say 1k, 4.7k or 10k) That 3.3V you see has to come from somewhere. Usually a resistor, but check to be certain. (Re-reads post: the "PULLUP" constraint enables a resistor built into the I/O circuit attached to the pin. This is usually a weak - high value- resistor, but on some Spartan-3s I recall someone finding it a lot lower than advertised; possibly down to 3.5K) Then you can connect an output to that input pin (or even declare the pin to be I/O, both input and output; it saves external wiring). This is where Jeff's advice comes in. Connecting a 3.3V output to this 3.3V signal is no problem - they are at (almost) the same potential so (virtually) no current will flow between them, and the input pin will just see 3.3V. The problem comes when the input pin and output pin are set to DIFFERENT levels; setting up a conflict between them. There are two possible cases; you must safely cover both cases, or understand how Jeff's advice safely covers both of them. If the output is set to 0 and the input is pulled to 3.3V by a 1K resistor, the output must sink 3.3ma through the resistor to properly control the level on the input pin. Setting its drive strength (in the UCF file) to 2ma is definitely not recommended! (a 10k resistor would require 0.33ma, quite safe). In this case, also pressing the button will do no harm. If the output is set to 1, the input will read 1 ... until the button is pressed. Now the output is shorted to ground - the input will read 0 - but the output is driving a large current (its "drive strength" is a lower limit and only applies into a recommended load, which a short circuit is not!) and can potentially be destroyed. Jeff's advice - allow the output to pull to 0, or turn off - covers both cases. Instead of driving 1, the output turns off, and let the resistor do the work. This is called a wire-AND configuration (often a wire-OR by people who remember negative logic) because the input sees ((switch=1) and (output=1)) (Not recommended at MHz speeds; there are tricks to improve its speed) - Brian
Reply by ●April 29, 20092009-04-29
"jleslie48" <jon@jonathanleslie.com> wrote in message news:89daa806-4c77-4677-8e2f-c1c9f2426060@d25g2000prn.googlegroups.com...> > So I'm perfectly fine having the two 3.3 volts values on both wires. > I just wanted to make sure. My first two years with the company I > earned a reputation for smoking equipment (I toasted easily $70,000 > worth of stuff,) and I'm determined this year to not fry anything. >Maybe you should take a basic course in electronics. /Mikhail
Reply by ●April 30, 20092009-04-30
jleslie48 <jon@jonathanleslie.com> writes:> I ~should~ just be sending in the external signal to the input pin, > but my instinct tells me I'm gonna smoke something when I solder two > wires with 3.3 volts together... >The smoke comes out when too much current flows. Current only flows when there's a voltage *difference* between two points. The size of that current depends on the resistance between two points (Ohms law - Current = Voltage difference / Resistance). In your case, (to a first and probably 2nd approximation) the voltage difference is zero (you have 3.3V at the end of each wire), so no current flows, so no smoke... Now if the voltage at the "far" end were zero volts (because you had enabled the PULLDOWN option in the UCF file), there'd still be no smoke as the pulldown is of the order of 1000s of ohms, so the current flowing will be of the order of milliamps, still no smoke. [As an aside - if the "far end" pin were actually defined as an *output*, so actively *driving* 0V onto the wire (in the same way as your other output is driving 3.3V onto the wire) and you conencted them together, a not insignificant current would flow (up to 10s of milliamps), but in my experience, still no smoke. The chip can feel warm if you do this lots though :)] Does that help any? Cheers, Martin -- martin.j.thompson@trw.com TRW Conekt - Consultancy in Engineering, Knowledge and Technology http://www.conekt.net/electronics.html
Reply by ●April 30, 20092009-04-30
"jleslie48" <jon@jonathanleslie.com> wrote in message news:f1446e4e-46bf-4779-9c5f-804f9ba46920@b6g2000pre.googlegroups.com...> > how do I get the FPGA to recognize that the volts are supposed > to come from the external wire and be interpreted as a 0 or a 1? >What is your job description? I am sorry but with this level of understanding of basic electricity you shouldn't be allowed close to a soldering iron. No amount of postings here will help you if you don't know what makes a current flow. You need to take a big step back and learn the basic physics first, otherwise change the job. /Mikhail





