Decoding USB signals

Discussion in 'Embedded Systems and Microcontrollers' started by RotatingEmu, Apr 24, 2009.

  1. RotatingEmu

    Thread Starter Member

    Jun 15, 2007
    11
    0
    I want to send data in real time from a PC to a transmitter via the USB port.

    Between the PC and the transmitter I need to decode the USB signal to get 4 variable voltage signals out (0-5V, or possibly PWM).

    Can I buy a module off-the-shelf that would achieve this goal?

    Or could I build one without too much hassle?

    Any info appreciated,

    Thanks
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    I'm not sure what good "decoding" will do for you. There are 4 wires in the USB interface. There is +5V and GND. You can draw at least 100 ma from this pair. The other pair is a differential signal pair called D+ and D-. I suppose you could decode them well enough to understand the content of the messages but you also need to respond. It will be much easier to use a controller chip or a microcontroller with USB hardware supportfor this purpose. You could use a general purpose microcontroller without any USB support but I think this crosses over into the giant hassle category.

    You can find the documents you require at

    www.usb.org

    There is in excess of 12,000 pages of turgid prose to pour over.

    If you're going to do this I recommend the Beagle Protocol Analyzer from Totalphase. It is the only way to tell what on heaven and earth the PC is trying to do when it enumerates a USB device.

    BTW your registry is going to become a bit messy with all the failed enumerations that will occur during development. Better sharpen up you regedit skills so you can clean up the mess that failed enumerations leave behind.
     
  3. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    Since the PC will understand the signals, and the transmitter will too, why do you need a third device? Put the functionality in the transmitter?
     
  4. RotatingEmu

    Thread Starter Member

    Jun 15, 2007
    11
    0
    PapaBravo: yeah I think a microcontroller with USB support will be my best bet. Does anyone have any experience with communicating with a microcontroller via USB in real-time?

    russ_hensel: the transmitter that I have only understands variable voltage levels as inputs, it requires 4 of these. So I need something to convert USB signals into these 4 signal lines.

    doing a bit of reasearch into the USB protocol I realise it is quite intense, but I think its the best way to communicate as its more future proof and common. Plus I'm interested in learning more about USB.

    Thanks for the replies
     
  5. Arm_n_Legs

    Active Member

    Mar 7, 2007
    183
    10
    You can look at the documentation that goes with the Atmel 89AT5131 or the Silicon Labs C8051F310. Both of these microcontrollers support USB. The manufacturers websites have some samples codes for implementing USB.
     
  6. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    So the transmitter does not understand usb, and what you need is a usb interface for it?
    Try a bitwacker ( google ) it is a pic with bootloader and built in usb. All open source. Free C18 compiler. Cost about 30 bucks.
     
  7. RotatingEmu

    Thread Starter Member

    Jun 15, 2007
    11
    0
Loading...