USB OTG Cable Confusion

General discussion on mikroPascal PRO for PIC32.
Post Reply
Author
Message
Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

USB OTG Cable Confusion

#1 Post by Rotary_Ed » 19 Oct 2014 00:37

I have implemented the OTG USB module of the PIC32MX795F512H chip I have on my project board. For those who may not be familiar with the OTG function, to fully implement it (so your chip may act as either HOST or DEVICE) requires mounting a USB micro a/b socket.
However, beware there are potential problem external to your chip and board.

The Chip responds to the type of male plug that is inserted in the micro a/b socket and configures itself as either host (if micro a plug is inserted) or device (if micro b plug is inserted). There are other requirements such as to provide 5 volts for USB port as well. But, the USB OTG cable situation can get quite confusing.
Mico a/b socket with micro a and micro b plugs
Mico a/b socket with micro a and micro b plugs
Mirco ab.jpg (27.47 KiB) Viewed 3918 times
There are a large number of electronic units (mostly cellphones, pads) where the manufacture has ignored the USB org OTG specifications. The end result is there are a very large number of cables which are advertised as OTG or OTG HOST which WILL NOT work with the PIC32. The reason is they are built to satisfy the large cell phone market and many are unit specific, but the bottom line is the vast majority of these so-called OTG HOST capable, will NOT put the PIC32 into the Host mode because the male micro plug these cables come with is almost always an micro b and not a micro a plug as required by the USB specification Organization.

So if your USB project is not working as expected closely examine the micro male and compare it to numerous reference drawings found on-line (see above). The micro A plug is a rectangle while the micro b plug appears as a trapozoid.

Inserting a so-called OTG HOST cable into the micro a/b socket and expect to dump data to a Flash Drive (device) and you will likely be disappointed - not because you have necessarily program, configured or built your chip/board incorrectly, but because the so-called OTG HOST cable has a micro b plug instead of the required micro a plug.

I have only found a few sources (I'm sure there are more - but, I found them hard to find) for a true OTG Host cable with a micro a plug. I list them here:
https://www.sparkfun.com/products/11604
http://www.karlssonrobotics.com/cart/us ... 7AodXmIA8w

These two products appear to be similar if not the same. I have used the one from Sparkfun.com with no problem - except it being a bit short in length.

I also found one cable source with micro a plug on one end that has a USB 2.0 Male (rather than Female) on the other end - which can be made to work if you get a female A to Female A coupler (assuming you need a female A for plugging in something like a Flash Drive)

http://www.mcmelectronics.com/product/83-11870

If anyone else has a source for a true OTG HOST cable, please let me know.

I hope this saves someone time and hair loss.
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: USB OTG Cable Confusion

#2 Post by filip » 06 Nov 2014 14:44

Hi,

Thanks for sharing this, it is quite helpful. :)

Regards,
Filip.

Rotary_Ed
Posts: 756
Joined: 26 Dec 2004 23:10
Location: Matthews, NC, USA
Contact:

Re: USB OTG Cable Confusion

#3 Post by Rotary_Ed » 06 Nov 2014 15:29

You are welcome, fillip

Can be very frustrating to have something unexpected - like an HOST OTG cable which is not - adding hours/days/weeks to your project time trouble shooting. :evil: :twisted:
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered

Post Reply

Return to “mikroPascal PRO for PIC32 General”