i have a board with a PIC32MX450F256L. Now i want to:

  • Connect an USB Stick(as Device) to the PICs(as Host) USB Port(micro-B)
  • Connect a Laptop(as Host) to the PICs(as Device) USB Port(micro-B)
  • Recognize as which Role the PIC have to work.

I just have the one USB micro-B Port. USB Sticks will get connected via a Adapter from USB Typ A(female) to micro-B(male). The Laptop via a normal Cable from USB Typ A(male) to micro-B(male)

Is this possible? Do i have to use USB OTG? Or just a Dual Role? Which is the best practise?

with kind regards



closed as too broad by Dave Tweed, Matt Young, Daniel Grillo, tcrosley, Anindo Ghosh Jan 21 '14 at 16:19

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ It sounds like you haven't done adequate research on this topic. Study the relevant sections of the PIC32 family reference manual and datasheet, and look at the extensive software examples that Microchip supplies, then come back here with any remaining questions. \$\endgroup\$ – Dave Tweed Jan 21 '14 at 12:59
  • \$\begingroup\$ I did (since 2 days), but i just dont get it. I have brought to run the Dual Role - MSD host + HID Device Demo. Where i can act as an Host/Device via 2 different usb plugs at my Explorer 16 Board with USB PICtail Plus Daughter Board. At this moment i got the USB OTG Demo to work. My PIC now gets detected as a USB device at my PC. \$\endgroup\$ – mvollmer Jan 21 '14 at 13:10
  • \$\begingroup\$ It's not clear what your specific problem is? All the above options are possible, and there are examples for them in the MLA. \$\endgroup\$ – eGovind Jan 21 '14 at 14:03

If you want to have only one connector, go with OTG.

Dual role is for when you have separate A and B connectors for host and device functionality.


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