Modding How to debug USB and tips on this idea

Discussion in 'Modding' started by spider87, 24 Mar 2008.

  1. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    Ok, I'm not 100% sure if this is considered modding or not but it seemed like the best place to go. ATM just for fun I'm trying to figure out a way to debug USB so I can see what the outputs would be depending on if the wires on the end were touching or not. My aim here is to make it so the program can detect whether the 2 wires are touching eventually I will be making a piece of software which will email me when they're not touching. (This will be a high tech security for my doorway [as an experiment]) I will put one piece on the door and one piece on the doorway (both connected to the same usb wire as of now) and when they are touching the program will sense nothing but when they are pulled apart a sound will play and the program will email me every 15 minutes or so that someone is going through the doorway stopping, of course, when the door is clsoed. This not only gives me the ability to know if they closed the door but what time they were in there too and also for how long depending on whether or not the door got closed upon entering.

    But anyway my base question here is, does anyone know of a piece of software that will show me what the USB port sees and will the usb port see different things when the 4 end wires are all connected as opposed to when they are apart?

    THANKS!



    EDIT: Any thoughts on this method or maybe an easier method that would accomplish the same for fairly cheap (20$) would be much appreciated! Thanks!
     
    Last edited: 24 Mar 2008
  2. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    No one?
     
  3. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    Umm... if you're just joining all 4 wires together, you'll have at least one short from the +5 to the GND line (which will damage the motherboard), possibly more depending on how the motherboard-end of the D- and D+ wires are terminated.
    You could use a parallel port for this, or a serial port, but USB works differently (the data pins are not just switchable to an 'on' or 'off' state, they transmit binary data at a high rate -- the data you send/recv from the port is encapsulated in 'packet' like structures, so even sending something simple over USB means lots of bits).

    If your USB host controller is smart, you might get some error flag or interrupt if you join the D- and D+ together (leaving the +5 and GND apart), BUT it will also probably not do it much good, and will also prevent anything else on that bus from working (mouse, etc).
     
  4. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    Thank you, I'm glad I didn't just go ahead and test it haha. :jawdrop:

    I'm still curious though how you would debug USB just so that I can see what the dongles I have are doing and how it looks so I can eventually make my own.

    Thanks again.

    -Alex
     
  5. mattthegamer463

    mattthegamer463 What's a Dremel?

    Joined:
    26 Nov 2004
    Posts:
    2,804
    Likes Received:
    1
    you could probably do this 100 times easier with a parallel port, and with parallel you could detect more than just one "switch" and probably up to 8 I think.
     
  6. spider87

    spider87 Your modder

    Joined:
    29 Jan 2008
    Posts:
    119
    Likes Received:
    0
    Last edited: 24 Mar 2008
  7. Splynncryth

    Splynncryth 0x665E3FF6,0x46CC,...

    Joined:
    31 Dec 2002
    Posts:
    1,510
    Likes Received:
    18
    USB uses differential signaling and is protocol based. Just shorting things is likely to fry hardware. If you want to see the traffic on the bus, you will need a USB bus analyzer. Otherwise there are various pieces of software that watch the OS's USB software stack and log info like this one.
    If you want to work with USB, I recommend Lakeview Research as a starting point.
     
  8. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    There's (or was) a piece of software available - though naturally I can't remember the name - which showed you the data exchanges between devices and controllers, there used to be a picture on wikipedia which was generated with it but that seems to have gone. It was freeware and generated 'flow chart' looking diagrams, you may be able to find it if you sniff around :eek:
    OTOH http://www.sharewareconnection.com/usblyzer.htm looks like it might be helpful though.
     

Share This Page