3
\$\begingroup\$

To begin with, I realize that voltage is relative but I do not understand how to get a common ground so that everything is relatively correct to go in and out of the various chips.

The picture summarizes the setup: Xbox to Level Shifter to SPI Chip to FPGA to Computer

Xbox plugged into the wall -> Wired USB Xbox controller which the input runs at 1.8v. Streaming the controller button input through a level shifter (SN74LVC245A) which shifts the logic to 3.3v -> SPI chip (MCP23S17) -> FPGA (Basys 2). The FPGA is connected to the computer via USB which is plugged in to the wall.

I would expect the multimeter would read 1.8v because of the assumed common ground. But I guess this is not the case because of what the value suggests. Right now both the laptop and Xbox are plugged into the same power strip but I could see how there might be further mismatch if they were on separate rails.

How do I work around this issue? Have I overlooked something simple or is it a flaw in design?

I realize that 4 buttons would be easier to go straight into the FPGA after coming out of the level shifter but I plan to add a lot more of the controllers input which I do not have enough pins for.

\$\endgroup\$
2
  • \$\begingroup\$ This is so badass. What was this project? How did it turn out? Please tell me there is a blog for this somewhere. \$\endgroup\$
    – Jacksonkr
    Jul 29, 2016 at 15:49
  • \$\begingroup\$ @Jacksonkr The plan was to automate the controller in order to replay Trials Evolution runs and even possibly vision detection for basic headshot bot. I didn't make it much past this point after having some trouble SPI interfacing with the MCP23S17 and moved onto other projects. You can find out what I have been doing on my personal site: ericeastwood.com \$\endgroup\$
    – MLM
    Jul 29, 2016 at 21:39

1 Answer 1

3
\$\begingroup\$

Just to make things simple, I'm going to assume that everything in your consumer electronics is designed properly (reasonable assumption) and is still operating to it's designed standards.

Another assumption I am going to make is that at least one of these units and perhaps both has only a 2 pronged plug that receives mains voltage.

The power transported and converted in the wall wart/power plug is transported in an AC waveform. There should be no direct DC connection, unless there is, in which case there will be a third prong (called safety) on your plug into the mains current. And even then that ground/safety may not be carried through the USB port of controller line.

Basically one or both of the DC sides of the power brick has no ground reference with the AC side. The DC is "floating", there is no assumed ground.

The solution for you is that you need to establish that ground, by connecting all of the grounds on all of the devices together.

For proof you simply need to measure the differences in grounds between the controller and the USB based FPGA ground. Do so with both DC and AC and you'll find that it is drifting around.

If there is a fault, or things have failed you'll notice it by circuit breaker going.

Have you ever noticed that when you plugin a USB port from one computer to another that there is sparks? but everything works once connected? It's the same thing happening here.

\$\endgroup\$
5
  • \$\begingroup\$ So all I have to do is put the ground line from the controller and the FPGA together and it works (do I need to connect more grounds)? If that is not the case, what is the solution to make this type of device work? BTW there is a 5.5v difference from FPGA ground to controller ground DC. \$\endgroup\$
    – MLM
    May 24, 2013 at 23:45
  • \$\begingroup\$ Yes, but if you want to be sure, use the current setting of your DMM and measure the amperage, it should stabilize at zero. It might read something at first because of the discharge of capacitance. Also measure Voltage in AC mode, you'll probably see something too. You probably have cooked the I/F chips (electrical Overstress) but maybe not, it depends on what was hooked up. The voltages are floating but should be at very high impedance to each other unless there is a fault. measuring with an ohm meter will give you the wrong results though. \$\endgroup\$ May 25, 2013 at 0:03
  • \$\begingroup\$ Wait, wait. I am getting a little bit of a mixed message mudding up my brain. What do I want to be sure of before I connect the grounds? I am guessing you are talking about the spi or level shifting chip that may have been fried because of the 7v or whatever. Could there be any threat to the Xbox or Laptop? Would you reccomend a USB Isolator such as (circuitsathome.com/products-page/usb-interfaces) to keep my laptop safe? When I measure voltage AC there is a 5.9v difference. I get 0 DC mA and .44 AC mA - not sure if you want those numbers.. \$\endgroup\$
    – MLM
    May 25, 2013 at 0:15
  • 1
    \$\begingroup\$ I'm just saying that, if you want to be sure, you can measure it yourself. O mA DC is what is to be expected from two isolated grounds separated by a large impedance. There should be no chance for a DC current to flow, so it's safe. Just connect the grounds together. \$\endgroup\$ May 25, 2013 at 0:24
  • \$\begingroup\$ The XBox power supply (at least on my XBox), is indeed a two-prong connection. \$\endgroup\$ May 25, 2013 at 15:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.