Multiple USB connections on UC3A

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I am interested in connecting one USB device to the UC3A and then using a separate USB connection to a PC. The data sheet talks about 7 end points, which with my limited USB knowledge I understand would allow communications with multiple USB devices/host. The question I have is can anyone suggest how on a hardware level this can be accomplished? Would I need some sort of OTG compatible hub?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Endpoints" are internal to the USB protocol. Think like "ports" in TCP or something. Just because you've got HTTP on port 80 and FTP on port 22 doesn't mean you have 2 ethernet cards; similarly 7 endpoints doesn't in any way correspond to the actual number of USB links supported (which is always 1) :-)

So no, afaics you aren't going to be able to use the UC3 simultaneously as a device and a host.

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for that explanation.
The question then is.... If a PC as a host can support multiple physical devices via a hub, and my understanding is that the UC3A can also do that in Host mode but would require an OTG compatible hub??
Does the OTG standard not allow for multiple devices via a hub in different modes?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

USB OTG is the name of an extension which allows compatible hardware to automatically choose whether it's going to be a host or a device depending what it's plugged in to. If you connect an OTG-compatible device to a hub then you've already made the choice for it (it's a host if you plug it in to the upstream hub port or a device otherwise) so the OTG bit is a bit irrelevant.

Actually that's not quite true; if you have hardware in USB OTG mode (i.e. waiting to see whether it should turn in to a host or device) and you then connect it to a standard hub it will not be able to tell what it should do, though if you manually force it to be a host it will work fine. If you see an OTG-compatible hub it just means that the upstream port can send the SRPs required for an OTG device to automatically detect that it should go to host mode.

The question then becomes what you actually want to do. From your original post

Quote:
I am interested in connecting one USB device to the UC3A and then using a separate USB connection to a PC
you want the UC3 to have host access to another device and, at the same time, have a PC with host access to the UC3 device. No hubs, OTG, endpoints or anything will make this happen for you, you'd need 2 completely separate USB PHYs on the UC3 and it just doesn't have them.

So,
1) You can have the UC3 as a device, the other device as a device and have them both hosted by the PC through a normal hub
2) Have the UC3 as a host for the other device and some kind of host-host bridge back to the PC. While there's no USB standard host-host bridge you can go through an intermediate protocol. For example, 2 USB to serial converters connected in a null modem configuration.

If however I've misunderstood and you meant that you want the UC3 to connect to a device sometimes and a PC at other times then yes, this is exactly what OTG is used for though you won't be needing any hubs.

Hope this helps :-)

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi squidgit

You are 100% correct in your understanding of what I am trying to do in point 2.
Thanks for the advice. Now I must just figure out what is the best/most cost effective way to achieve this.
One thought was to use another USB IC perhaps a small AVR? I have also been looking at USB implemented in software on some of the small AVR's but they of course are not hardware compliant.

All suggestions are welcome :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah certainly possible. It shouldn't be too hard to port the bit-banged software USB stuff over to a UC3 family AVR32 and will save you extra hardware. Otherwise indeed fitting a second uC or something more special purpose like a Vinculum [1] host might be worth it.

-S.

[1] http://www.vinculum.com/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pity about the price of the Vinculum. About $12.5 US At that price I could include a second UC3A :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what speed do you need from UC3A<->PC connection? if it's slow enough you can use FT232 to implement USB-RS232 brige, it costs $4.5 on digikey