Ok, my electrical non-background is showing. So I've got some pins that I'm driving and all is well on a Spartan3e. looking at the pins on the scope, they sit at 0 volts for a '0' and looks like 3.3v on a '1' Now the only inputs I use are on pins 11 and 12, and the UCF looks like this: NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven output. Now the way the buttons work is on the scope they show 3.3 volts, and I have them hooked up to a normally open momentary switch that will attach this signal to ground when closed. When I push the button (viz "pull to ground"????) the button, the VHDL program recognizes the signal as a switch from 0 to 1 (give or take a debounce) Now when I put a scope on my input pin, I see it is up at 3.3 volts, and when the button is pushed, it drops to 0. It seems to me this is not a good setup for using one of my output pins attached to one of my inputs. At some point both pins have 3.3 volts on them, and those two wires are attached. My question is if I want to take my driven output and run it around as an input signal, how do I do that? Thanks, Jon
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
jleslie48 wrote:> Ok, my electrical non-background is showing. > > So I've got some pins that I'm driving and all is well on a > Spartan3e. > looking at the pins on the scope, they sit at 0 volts for a '0' and > looks like 3.3v on a '1' > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > like this: > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > output. > > Now the way the buttons work is on the scope they show 3.3 volts, and > I have them hooked up to a normally open momentary switch that will > attach this signal to ground when closed. When I push the button (viz > "pull to ground"????) the button, the VHDL program recognizes the > signal as a switch from 0 to 1 (give or take a debounce) Now when I > put a scope on my input pin, I see it is up at 3.3 volts, and when the > button is pushed, it drops to 0. > > It seems to me this is not a good setup for using one of my output > pins attached to one of my inputs. At some point both pins have 3.3 > volts on them, and those two wires are attached. > > 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
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote:> jleslie48 wrote: > > Ok, my electrical non-background is showing. > > > So I've got some pins that I'm driving and all is well on a > > Spartan3e. > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > looks like 3.3v on a '1' > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > like this: > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > output. > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > I have them hooked up to a normally open momentary switch that will > > attach this signal to ground when closed. When I push the button (viz > > "pull to ground"????) the button, the VHDL program recognizes the > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > button is pushed, it drops to 0. > > > It seems to me this is not a good setup for using one of my output > > pins attached to one of my inputs. At some point both pins have 3.3 > > volts on them, and those two wires are attached. > > > 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; > > -Jeffnothing so complicated. So far for input I've taken an input pin that was labeled in the UCF as NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 attached a wire to itand tied it to ground with a normally open switch in between to control whether or not the FPGA is seeing a 0 or a 1. Now I have an external wire that I have to hook up to a pin that I label as an "IN STD_LOGIC;" and that external wire has nothing to do with being tied to ground, its just a wire with either 3.3 volts or 0 volts, 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?
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote:> jleslie48 wrote: > > Ok, my electrical non-background is showing. > > > So I've got some pins that I'm driving and all is well on a > > Spartan3e. > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > looks like 3.3v on a '1' > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > like this: > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > output. > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > I have them hooked up to a normally open momentary switch that will > > attach this signal to ground when closed. When I push the button (viz > > "pull to ground"????) the button, the VHDL program recognizes the > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > button is pushed, it drops to 0. > > > It seems to me this is not a good setup for using one of my output > > pins attached to one of my inputs. At some point both pins have 3.3 > > volts on them, and those two wires are attached. > > > 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; > > -Jeffthe 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?
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote:> jleslie48 wrote: > > Ok, my electrical non-background is showing. > > > So I've got some pins that I'm driving and all is well on a > > Spartan3e. > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > looks like 3.3v on a '1' > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > like this: > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > output. > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > I have them hooked up to a normally open momentary switch that will > > attach this signal to ground when closed. When I push the button (viz > > "pull to ground"????) the button, the VHDL program recognizes the > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > button is pushed, it drops to 0. > > > It seems to me this is not a good setup for using one of my output > > pins attached to one of my inputs. At some point both pins have 3.3 > > volts on them, and those two wires are attached. > > > 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; > > -Jeffnothing that complicated. I just don't understand how to take a 3.3 volt signal and send it in to the input pin. so far, the only way I've gotten input on a pin to work is to have a wire on the pin attached to a normally open switch. When the switch is open I see 3.3 volts on the wire, but when I close the switch, the input pin is connected to ground and the oscilliscope show 0 volts on the wire not, 3.3. the open switch is a logical 0, and when its grounded a logical 1 (or vice versa) In the new situation, there is no ground, just the input pin and some other wire that has a signal on it, at 3.3 volts. 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.
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:38 pm, jleslie48 <j...@jonathanleslie.com> wrote:> On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote: > > > > > jleslie48 wrote: > > > Ok, my electrical non-background is showing. > > > > So I've got some pins that I'm driving and all is well on a > > > Spartan3e. > > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > > looks like 3.3v on a '1' > > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > > like this: > > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > > output. > > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > > I have them hooked up to a normally open momentary switch that will > > > attach this signal to ground when closed. When I push the button (viz > > > "pull to ground"????) the button, the VHDL program recognizes the > > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > > button is pushed, it drops to 0. > > > > It seems to me this is not a good setup for using one of my output > > > pins attached to one of my inputs. At some point both pins have 3.3 > > > volts on them, and those two wires are attached. > > > > 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 > > nothing that complicated. I just don't understand how to take a 3.3 > volt signal and send it in to the input pin. > > so far, the only way I've gotten input on a pin to work is to have a > wire on the pin attached to a normally open switch. When the switch > is open I see 3.3 volts on the wire, but when I close the switch, the > input pin is connected to ground and the oscilliscope show 0 volts on > the wire not, 3.3. the open switch is a logical 0, and when its > grounded a logical 1 (or vice versa) > > In the new situation, there is no ground, just the input pin and some > other wire that has a signal on it, at 3.3 volts. > > 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.In the new situation, there is no ground AND NO SWITCH. just the input pin and some other wire that has a signal on it, at 3.3 volts. - I keep forgetting to say that. the switch is no longer there. 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...
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:38 pm, jleslie48 <j...@jonathanleslie.com> wrote:> On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote: > > > > > jleslie48 wrote: > > > Ok, my electrical non-background is showing. > > > > So I've got some pins that I'm driving and all is well on a > > > Spartan3e. > > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > > looks like 3.3v on a '1' > > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > > like this: > > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > > output. > > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > > I have them hooked up to a normally open momentary switch that will > > > attach this signal to ground when closed. When I push the button (viz > > > "pull to ground"????) the button, the VHDL program recognizes the > > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > > button is pushed, it drops to 0. > > > > It seems to me this is not a good setup for using one of my output > > > pins attached to one of my inputs. At some point both pins have 3.3 > > > volts on them, and those two wires are attached. > > > > 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 > > nothing that complicated. I just don't understand how to take a 3.3 > volt signal and send it in to the input pin. > > so far, the only way I've gotten input on a pin to work is to have a > wire on the pin attached to a normally open switch. When the switch > is open I see 3.3 volts on the wire, but when I close the switch, the > input pin is connected to ground and the oscilliscope show 0 volts on > the wire not, 3.3. the open switch is a logical 0, and when its > grounded a logical 1 (or vice versa) > > In the new situation, there is no ground, just the input pin and some > other wire that has a signal on it, at 3.3 volts. > > 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.In the new situation, there is no ground AND NO SWITCH. just the input pin and some other wire that has a signal on it, at 3.3 volts. - I keep forgetting to say that. the switch is no longer there. 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...
Reply by ●April 28, 20092009-04-28
On Apr 28, 8:07 pm, Jeff Cunningham <j...@sover.net> wrote:> jleslie48 wrote: > > Ok, my electrical non-background is showing. > > > So I've got some pins that I'm driving and all is well on a > > Spartan3e. > > looking at the pins on the scope, they sit at 0 volts for a '0' and > > looks like 3.3v on a '1' > > > Now the only inputs I use are on pins 11 and 12, and the UCF looks > > like this: > > > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11 > > NET "BUTTON_2" LOC = "F14" | PULLUP ; #"FPGA_IO18" pin 12 > > NET "PIN13_LED" LOC = "F2"; #"FPGA_IO19" driven > > output. > > > Now the way the buttons work is on the scope they show 3.3 volts, and > > I have them hooked up to a normally open momentary switch that will > > attach this signal to ground when closed. When I push the button (viz > > "pull to ground"????) the button, the VHDL program recognizes the > > signal as a switch from 0 to 1 (give or take a debounce) Now when I > > put a scope on my input pin, I see it is up at 3.3 volts, and when the > > button is pushed, it drops to 0. > > > It seems to me this is not a good setup for using one of my output > > pins attached to one of my inputs. At some point both pins have 3.3 > > volts on them, and those two wires are attached. > > > 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; > > -JeffIn the new situation, there is no ground AND NO SWITCH. just the input pin and some other wire that has a signal on it, at 3.3 volts. - I keep forgetting to say that. the switch is no longer there. 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...
Reply by ●April 28, 20092009-04-28
On Tue, 28 Apr 2009 17:30:35 -0700 (PDT), jleslie48 <jon@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.com
Reply by ●April 28, 20092009-04-28
jleslie48 <jon@jonathanleslie.com> wrote: (snip)>> > NET "BUTTON_1" LOC = "F12" | PULLUP ; #"FPGA_IO17" pin 11(snip)> 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?See the part that says PULLUP? That turns on a resistor to 3.3V on the output. Then you can pull down to ground with the switch or an output configured to sink current only. Another post indicates how to generate an "open drain" output, or what was "open collector" in the TTL days. -- glen






