Simple 2-port USB 2.0 Hub

Discussion in 'The Projects Forum' started by fkento, Jul 9, 2012.

  1. fkento

    Thread Starter New Member

    Jul 9, 2012
    I am trying to build a 2-port USB 2.0 Hub. I found a Cypress Chip that I think will do the trick.

    Cypress TUSB2036VFR

    Is it just as simple as connecting the Power, GND, D- and D+ lines to the upstream and downstream ports? Or do I need any resistors to connect to the other lines? This will be integrated into another project so the downstream devices will the hard wired in. The hub will be bus-powered. Any advice will be appreciated.

  2. paulktreg

    AAC Fanatic!

    Jun 2, 2008
    Have you looked at the datasheet?
  3. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    have you seen how cheap usb hubs are.. No point in building one..
  4. fkento

    Thread Starter New Member

    Jul 9, 2012
    Yes but I am a newbie. When it says a pin needs to be pulled high or low what does that mean? I assume pulled low means connected to ground? What does pulled high mean? Connected to +3.3v? Do I need pull-up or pull-down resistors? Is "pulled to logic 1" the same as pulled high?

    I think I need to pull down pin 8 (BUSPWR) to enable bus-powered mode. Also, for 2 downstream ports, pin 24 (NP3) needs to be pulled high. Pins 22 & 23 (NPINT1-0) need to be pulled high to indicate permanently attached devices.

    Now I am uncertain about what to do with the following pins

    Pin 4 (RESET)
    Pin 31 (MODE)
    Pin 21 (OCPROT)

  5. fkento

    Thread Starter New Member

    Jul 9, 2012
    This will be integrated into another project. In other words, my project needs to have it's own internal USB hub.
  6. agesome

    New Member

    Jul 5, 2012
    There is a typical application circuit on page 9 of the datasheet.
    Your understanding of pulling up/down is correct, there is also the wikipedia article.

    Datasheet is your friend.
    Which means you have to pull it down for the specified amount of time after the supply voltage is stable. Power-on reset devices can be used for this. They are cheap, small and ensure your IC doesn't attempt to work under low voltage, which can be bad.

    My understanding of the MODE pin is limited. I see it as this: when MODE is pulled low, a 6 MHz crystal is expected between XTAL1 and XTAL2 (see below typical application circuit); when MODE is high, a 48 MHz signal is expected on XTAL1.
    Those with better understanding, correct me if I'm wrong.

    Now to pin 21, OCPROT. Since you previously tied BUSPWR down, your hub is now bus-powered (drawing power from the host). The footnote under pin description table states that when OCPROT is pulled low, the host assumes that you have overcurrent protection; when OCPROT is high, that indicates no overcurrent protection on your device.

    FYI, USB standard defines maximum current drawn from host; 500 mA for USB 2.0, for example. That is what one needs overcurrent protection for.
    I have no idea what behavior is expected from the host and the device with present/absent protection, as in I didn't read the USB standard, sorry.

    But, in my experience USB ports would get shut off by the OS when their VCC and GND got shorted (thus consuming too much current), and googling for "usb over current protection" turns up a lot of ICs for that.
    So apparently you can either deal with it yourself or let the host handle it.
    fkento likes this.