How and when to use USB_ID (output) pin?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
Post Reply
User avatar
eez-open
Active Member
Posts: 60
Joined: Mon Oct 23, 2017 1:49 pm
Location: Croatia
Contact:

How and when to use USB_ID (output) pin?

Post by eez-open »

I cannot find any information about how and when to use USB_ID pin. I'd like that USB port can works depending of situation as device or host (OTG). In MCU's datasheet (XE216-512-TQ128) all what I found is that "USB_ID does not need to be connected", and that is reserved output. My current wiring diagram for USB port looks like this:

Image

When USB is acting as host IC15 is switched on and deliver +5V to the +VBUS. In case of over-current trip, #USB_OC signal is monitored, and for detection of device, USB_ID input (pin 4 of Mini USB Type AB socket) is monitored. IC16 together with R14, C31 is intended for protection of MCU's USB pinouts (IC17USB). USB_ID pin is left unconnected, but I'm not sure that is all what is needed for OTG.


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi.

1) The following article, figure 2 and description may help on the USB_ID pin details:

https://www.maximintegrated.com/en/app- ... vp/id/1822

https://electronics.stackexchange.com/q ... only-has-4

2) The USB load switch we have used in a mix of our designs is the AP2822AKATR-G1 - it is very important to confirm the pinout and stock position of this component. For some reasons, this variation of the p/n is under $ 0.10 USD each in T&R but other variations are over $ 0.50 USD each with scarce inventory. We did get stung by this mistake and had to respin our PCBs a second time to select the more popular footprint (AKA suffix).

https://www.mouser.com/ProductDetail/Di ... corporated

This part offers an additional feature in that if the load switch is OFF, there is no reverse leakage back to your power source.

3) This same part can replace the passive network of parts recommended by XMOS with numerous additional features and also will be a single hit placement on the SMD assembly process. The soft-start is great for the in-rush current, etc.

https://www.diodes.com/assets/Datasheets/AP2822.pdf
* again, do review the proper suffix and related footprint

Image

Image

4) Am concerned about the possibility of two power sources attempting to feed power onto the Vbus line at the same time. What if? Perhaps consider some logical Vbus power OR circuit so that no harm will occur to either power source in the event this case occurs. Do check around for circuits that will allow for self-power and bus-power automatic switching which is the same concept.

5) The USB interface pins will need to be impedance controlled so do highlight this detail to your PCB shop @ 90 ohms. In return the PCB shop should supply you with TDR documentation to confirm that for the laminate used by your shop, the USB traces are impedance controlled as requested.

Being USB (probably HS), you should consider only a 4L PCB layout.

We are using a mix of very qualified PCB and component shops in Asia for our prototypes (raw materials only - we assemble locally so do not see a clone of our tchotchke before it is finished). Reminds me of a story when we did the industry's first Plug & Play adapter for Logitech - the board was cloned in Taiwan within 2 months of introduction. Zero scruples in Asia. Had to threaten legal action to keep the importers in North America from selling the clones. Shout back if you need some recommendations.

Here is a good magazine that will keep you busy for a while :)

http://a.globalsources.com/mag/Electron ... path=Full1
User avatar
eez-open
Active Member
Posts: 60
Joined: Mon Oct 23, 2017 1:49 pm
Location: Croatia
Contact:

Post by eez-open »

Thanks for reply. I'm aware of Maxim app note that describe basic principle. According to my current understanding I have everything needed to cover described scenarios. I presume the MCU will take care about attaching/detaching resistors from data lines depending of VBUS presence. Mentioned switch (AP2822) has equal functionality as used TPS2051B (even its -KA package variant has the same pinout). That include soft-start (thanks to current limiting), tiny reverse current (0.2 μA), etc.

Still, I didn't find an answer to my question how to use MCU's USB_ID output, or how it's programmed if that is possible at all, or its state is "hardcoded" in built-in USB functionality and all what I need to do is to wire it wisely when e.g. MCU wants to change role from initial peripheral (B-device) to host (A-device) after USB cable that assign external USB device to act as host (pin 5 on USB connector is wired to GND). If that pin is just reserved because e.g. its functionality is not implemented yet, I'd like to know that.
In summary, more info than what is presented in datasheet would be greatly appreciated.
User avatar
eez-open
Active Member
Posts: 60
Joined: Mon Oct 23, 2017 1:49 pm
Location: Croatia
Contact:

Post by eez-open »

After discussing this topic with XMOS support (support ticket #10759) I've been forwarded back to the forum. I learned so far that XMOS does not support OTG. Therefore statement in the datasheet (XE216-512-TQ128-Datasheet_1.14.pdf, pg. 20): "Different wiring is required for USB-host and USB-OTG." looks to me more as a disclaimer for public and/or reminder for XMOS team that more work is needed here. It is not clear to me what was the purpose of mentioning OTG at all: saying that different wiring is required for something that does not exist (not supported) makes no sense. OTG is mentioned in table on pg. 9, too where USB_ID pin is listed. That pin is marked there as I/O what is also confusing to me (I believed that is only input pin connected to GND or left unconnected).

Also according to information received from XMOS support USB-host mode (from above mentioned statement) is supported to some extent only for iOS audio. But, on the Github are available examples for communication with USB mouse and keyboard that is as far as I understand an example of MCU acting as host not device. My interest for OTG and USB-host mode was initiated by that repository on which I built my wishful thinking about making USB port OTG capable for flexible communication with PC as a host or that MCU can accept USB memory drive (USB MSD). XMOS support told me that MSD class of device is not on the roadmap, but hopefully I'll manage to add it by following USB specification and code available for MCUs from other vendors/architectures.

In summary the OTG is not supported and USB_ID is not supported, not functional or not documented pin that should leave unconnected. For the moment only one question remain unanswered to me: when MCU is going to act as USB-host does I need to take care about "handshaking" pull-downs (15K) externally (e.g. by adding come extra wiring) or that is accomplished internally that I'd like to believe that is the case?
Post Reply