This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TUSB320: General USB C design questions - feedback welcome

Part Number: TUSB320
Other Parts Discussed in Thread: BQ25896, TS5USBA224, TPS745, , TPS2546, , TS3A227E, TPS65987D

Hello,

I am working on a USB C electronic design for a handheld product with a single LiIon cell and would welcome your feedback. The TUSB320HAI/LAI is part of the design but my questions/concerns are fairly general. Please correct me where I am mistaken.

Due to the great many versions of USB and BC, together with backwards compatibility, I have come to the conclusion that a solid design must support both USB C and BC1.2 current advertisement, both in host/SRC role and in device/SNK. This is partly due to USB C specification (quoted below) and the fact that there are adapter cables that enable customers to plug just about anything into our product. Some customers will lose the charger and USB cables shipped with our product and try to use whatever they find in some old drawer. Some A->C adapter cables have a CC1 56k pull-up and some don't. The current advertisement from USB C and BC1.2 BCD could be contradictory. This makes the input current limiting feature in the bq25896 an actual real-world requirement (in addition to the weird BC1.2 DCP specification that in itself makes automatic input current limiting necessary - see quote 4.6 below).

"4.8.1.1 USB-based Chargers with USB Type-C Receptacles
* ...
* ...
* A USB-based charger with a USB Type-C receptacle (Source) which is not capable of data communication shall advertise USB Type-C Current of at least 1.5 A within tVBUSON of entering the Attached.SRC state and shall short D+ and D− together with a resistance less than 200 ohms. This will ensure backwards compatibility with legacy sinks which may use USB BC 1.2 for charger detection." USB C spec R2.0, p225

If this wasn't enough, there's the Audio Accessory with a +/- 3 V voltage swing on the USB C USB2.0 pins (which would break ESD protection and BC1.2 BCD circuit) and the Audio Accessory Charge-Through that some users will try to use to charge our product. I have not been able to figure out whether Audio Accessory may generate this AC signal or only consume it. But, IM not so HO the combined USB standards and proprietary designs are a downright mess, so I wouldn't be surprised if there is suddenly an addendum that allows Audio Accessory to generate the AC signal (if this isn't really the case).

My current design consists of the following:

  • TI bq25896 Single LiIon Battery charger with automatic input power limiting and OTG boost mode 
  • TI TUSB320HAI/LAI USB Type-C Configuration Channel Logic and Port Control
  • Diodes/Pericom PI3USB9201 Dual-Role USB Charging-Type Detector (Does TI have a corresponding IC?)
  • TI TS5USBA224 USB 2.0 High-Speed (480 Mbps) and Audio Switches with Negative Signal Capability
  • STM32L4+ MCU
  • TI TPS745 LDO set to 3.12 V (for an unrelated but good reason)
  • Only USB2.0 12 Mbps (this is MCU-based)

The design goal is a handheld MCU-based product that you can charge via USB C and connect to a PC. In this scenario the product is a device/SNK.

Alternatively you can connect e.g. a sensor via USB. In this scenario the product is a host/SRC.

The product will most likely never work with Audio Accessory but I want to avoid potential problems caused by a user attaching an Audio Accessory with charge-through (accounting for a potential future addendum).

Due to backwards compatibility, it is quite possible that the external sensor will be pre-USB C and require BC1.2 advertisement by a CDP host (our product). So, even if the MCU can do BC1.2 BCD in device role, there is need for a HW solution that does the CDP host advertisement (PI3USB9201).

There are a few pin compatible competitors to the TUSB320 series (PI5USB30216C/D and FUSB303) but the TUSB320HAI/LAI seems to be the best trade-off between functionality and ease of use. PI5USB30216C/D powers up in DRP Try.SNK when in pin control mode but if you want to change from SRC to SNK role (or vice versa) you must power cycle it, which is not necessary with the TUSB320HAI/LAI.

The TUSB320HAI/LAI datasheet is clear that to advertise USB C 3.0A you must power it from at least 3.5 V, but I don't foresee a need for a handheld to be able to source more than 0.5 A. Should it be needed, power supply OR-ing from both 3.12 V and OTG VBUS 5 V should do the trick. (I haven't verified this assumption - there might be a need for signal level shifting too.)

"4.6 Power
...
Notes: 1. USB BC 1.2 permits a power provider to be designed to support a level of power between 0.5 A and 1.5 A. If the USB BC 1.2 power provider does not support 1.5 A, then it is required to follow power droop requirements. A USB BC 1.2 power consumer may consume up to 1.5 A provided that the voltage does not drop below 2 V, which may occur at any level of power above 0.5 A.
...
All USB Type-C ports shall tolerate being connected to USB power source supplying default USB power, e.g. a host being connected to a legacy USB charger that always supplies VBUS." USB C spec R2.0, p217

"2.3.1 Source-to-Sink Attach/Detach Detection
Power is not applied to the USB Type-C host or hub receptacle (VBUS or VCONN) until the Source detects the presence of an attached device (Sink) port. When a Source-to-Sink attach is detected, the Source is expected to enable power to the receptacle and proceed to normal USB operation with the attached device. When a Source-to-Sink detach is detected, the port sourcing VBUS removes power." USB C spec R2.0, p33

It seems that the simplest is to let device/SNK be the default mode and make it possible for the user to temporarily reconfigure it to host/SRC. It's both a HW and an MCU USB SW question. In other words, the DRP roles are not practically usable. If the bq25896 doesn't ramp up quickly enough, we could violate the intention of the USB C specification (quote p33) and fall back to legacy support (quote p217), which may never damage the USB C attached device.

---

So far I have mostly described my current design and what lead to it. Hopefully there are experts in USB that could confirm or correct. Please provide feedback.

To the specific TUSB320HAI/LAI questions:

1. As somebody else has already pointed out in another post, the datasheet is incomplete/contradictive regarding the ADDR and PORT pins' floating voltage range - the internal pull-up/pull-down resistor values don't result in an idle voltage inside the ADDR and PORT floating voltage range. The question is whether the ADDR and PORT pins can successfully be driven directly by a modern MCU, including floating state. (I suppose the TI ARM core MCUs are fairly similar to the STM32L4+ in this aspect.) With the STM32L4+ the pins would probably be configured to analog (inputs). Or, should a tri-state buffer be used?

2. It seems clear that PORT is sampled when EN or EN_N is asserted, but is it also possible to change ADDR during an EN or EN_N deassert & assert cycle? A note at the bottom of datasheet p5 suggests this: "(2) Internal pullup and pulldown for PORT and ADDR are removed after the device has sampled EN = high or EN_N = low."

Thank you in advance

Niclas

  • Hi Niclas,

    To address your specific TUSB320 first:

    1. I do not see a issue as long as the MCU GPIO in input "mode" does not drastically change the loading on PORT or ADDR. In some cases when GPIO is configured as a input, an internal pull-down resistor is enabled (and remains enabled) which affects the state of PORT or ADDR but this depends on the specific MCU application. 

    2.ADDR will also be sampled when EN/EN_N is asserted sot he ADDR state must be set beforehand. 

    I suggest creating a separate thread to find the correct TI equivalent to PI3USB9201 however TPS2546 maybe a good place to start.

    Audio Accessories typically only "consume" audio signals with +/-3V swing (i.e. headphones). 

    Please let me know if any more questions or if I missed anything. 

  • Hi Malik and thank you,

    Does this mean that there is never a need to power cycle the TUSB320HAI? If you e.g. want to go from I2C control to pin control you deassert EN/EN_N, reconfigure ADDR & PORT, and finally assert EN/EN_N? (Or the other direction.)

    It might seem like a strange question, but I haven't yet decided on I2C control vs. pin control, so I'm designing HW to support both. For this to be guaranteed to work I must know whether I must also power cycle the TUSB320HAI. The PI5USB30216C/D requires power cycling for this.)

    -

    Regarding Audio Accessory: You write "typically only 'consume' audio signal". I came to that conclusion myself (mostly by reasoning), but:

    - Do you know if Audio Accessories may only consume (or is it just the common case)?

    - How can we know that it won't suddenly be added to the USB C specification?

    when learning about USB I have on several occasions realized that either I had just missed something or suddenly the team behind the USB specifications decided to add some feature that has great impact on what you need to incorporate in your design.

    One such example is added backward compatibility to USB C chargers so that they also must do BC1.2 current advertisement. Many USB C controller datasheets / application notes don't mention BC1.2, when it really should have been part of the datasheet reference design. It must be a nightmare to develop and maintain ICs for USB.

    I am getting a similar feeling as with Bluetooth - they never seem to mature and stabilize. Every now and then some company comes up with a 'bright' idea for using or misusing USB and either gets it into the USB specification or goes into production with a proprietary solution. I am not the only one with these sentiments:

    https://www.androidauthority.com/state-of-usb-c-870996/

    -

    Could you please comment on the design choices in my original posting? The Audio (Accessory) switch might be superfluous, but am I missing something? Is there a better combination of ICs that do what I want? (Not in BGA chip.)

    Is it practically possible to be idle in Try.SNK and then let the product configure USB HW and SW upon attachment? Are there timing aspects that makes this fail? Or would we end up with a mismatch between USB C role 'selection' and BC1.2 detection? An obvious case is if the user plugs in an A->C cable with (and also without) pull-up resistor.

    In other words: is the only practical SW design either a device/SNK or host/SRC before attachment occurs?

    -

    The TPS2546 is only a host-side BCD? I need dual role capability, but thank you for the suggestion.

    -

    Best regards

    Niclas

  • Hi Niclas,

    Correct, TUSB320LAI should resample the ADDR and PORT pins when EN is asserted without power cycle. Be sure that EN is dessaerted for 50 ms after ADDR and PORT pin status change.  

    This is the most common use case for devices that present Ra to the CC pins to "consume" audio signals. I am not aware of any future change to the USB-C spec to include Audio adapters that can source audio signals.  If you want to define your device to support Audio Accessories that support charge through then the USB-C spec says:

    "The system shall connect A6/B6, A7/B7, A8 and B8 to an appropriate audio codec upon
    entry into the Audio Adapter Accessory Mode. The connections for A8 (SBU1) and B8
    (SBU2) pins are dependent on the adapter’s orientation. Depending on the orientation, the
    microphone and analog ground pins may be swapped." - Apendix A :Audio Adapter Accessory Mode

    From this perspective you will need an audio codec in your system (assuming your MCU does not have such function).  

    Your device selection look good from my view but you may want to look at our USB Type-C Audio Adapter Accessory Mode Reference Design for more info on design supporting audio accessories.

    There is nothing wrong with having your port stay in Try.SNK, in fact port should be configured for DRP Try.SNk before connection. If no CC termination is detect then there is no connection from a Type-C perspective and system will have to understand what is connected based on DP/DM and/or Vbus. USB-C negotiations happen before BC 1.2.

  • Thanks again Malik,

    Much appreciated.

    Thank you for the hint about tidub66.pdf. I have already looked at it but I couldn't find a suitable Mic/GND - GND/Mic switch. Could you recommend one?

    -

    There is a problem with Try.SNK and TUSB320; It's not available when under pin control:
    "When operating in GPIO mode, the TUSB320 will always operate as a standard DRP." (HAI datasheet p11)

    (This is actually one of the upsides to the PI5USB30216C/D. In pin control mode it powers up as Try.SNK. On the other hand, it must be power cycled for role change and when attached as default current SNK in pin control mode both OUT1 and OUT2 are hi-Z, so you must monitor VBUS too.)

    -

    Thank you also for confirming my suspicions regarding USB C and BC1.2. However, I fear that the real-world is not so clean-cut. When looking for A->C cables with pull-up resistor, I came across a few that don't incorporate one. (Qualtek 3021090-01M and 3023048-01M do for example.) In other words, in great many cases the USB C controller won't detect attachment, so the USB C controller cannot be relied upon for role determination. This means that the BC1.2 BCD should already have been configured for the expected role, so Try.SNK won't work in some use cases. (We don't have the Mini or Micro ID signal.) This isn't a very big problem for our product. It is a device by default and only in a few specific cases it is a host.

    One of my tasks ahead is to draw a flow chart of how to determine role and current based on information from TUSB320HAI, PI3USB9201, and bq25896. (The latter will detect external VBUS even if advertisement is missing from both the other ICs, which I suspect might be the case when connecting our product to a PC via an A->C cable that doesn't have a pull-up resistor.)

    Regardless, the A->C adapter cable pull-up resistor really only results in USB C SRC role for the power source (that might be a PC or a charger) and SNK role for the device. If there is BC1.2 BCD current advertisement it is probably more reliable than the USB C advertisement. If both USB C and BC1.2 BCD says 'default current', we don't know if it's 500mA or 900mA (or much more because the 5V power source (typically PC port) is designed to supply much more e.g. per port pair).

    As I said, USB is a downright mess. There is an abundance of specifications but you cannot rely on anything so you still have to design for 'anything goes'. Hopefully the bq25896 automatic input current limiting will detect overcurrent before the power source is permanently damaged...

    -

    Could you point me to one, comprehensive, application note that explains all this and presents a proper solution?

    Best regards
    Niclas

  • Hi Nicals.

    TS3A227E can be used to automatically resolve MIC/GND orientation. 

    Correct, TUSB320LAI Try.SRC and Try.SNK options are only though I2C. I recommend using I2C mode if possible in your system to get the most flexibility out of TUSB320LAI. 

    From my view these cables to do not follow the USB-C spec and should not be accounted for. The USB-C spec mentions that USB-C to USB-A cables should have Rp on A5 pin (CC) for both USB 3 and USB 2 cable assemblies. You can refer to Table 3-12 USB Type-C to USB 3.1 Standard-A Cable Assembly Wiring and Table 3-13 USB Type-C to USB 2.0 Standard-A Cable Assembly Wiring. I do understand that in the real world that there can be non-compliant cables but without CC termination it will be difficult to determine solely based on Vbus (Always present at the Type-A port). One potential way to detect such a non-compliant cable is to detect VBUS and poll TUSB320HAI I2C registers to understand CC pin state. If CC pins are read a unconnected and VBUS is present then you may be able to assume such a non-compliant cable is connected. This would only work assuming that Vbus is not provided by your system and system always starts as a UFP/sink, not a DFP/source. 

    500mA/900mA default current values are defined for USB2 or USB 3 applications. In your case if default current is detected then you should always follow 500mA max to be USB compliant. Current consumption based on interface can be monitor by PC USB port and overcurrent condition reported to the USB Host. 

    The USB-C Spec does have some guidelines on how a USB-C port responds to a legacy Host port, 4.5.3.2.2 Legacy Host Port to Sink Behavior. Table 4-17 Precedence of power source usage form the USB-C spec also describes the order in which your system should configure it power consumption (USB-C current mode supersede BC 1.2). We do not have applications note on system design for cables that do not follow the Type-C spec. However the paper below may help shed some light on proper design with USB-C. 

    https://www.ti.com/lit/wp/slyy109a/slyy109a.pdf 

  • Thanks again for a very good answer.

    Isn't the TS3A227E only for the 'audio jack to USB C adapter' or simply 'audio jack decoding'? It incorporates switches for Mic/GND but as I understand it they exist because there are two different standards for where Mic and GND are located on the 3.5 mm plug? They make sure that the Mic pin on the TS3A227E has the correct polarity? But, don't you also (inside the handheld) need to account for the rotation of the USB C connector?

    I really sympathize with your point on out-of-spec USB C cables, but I fear that it is impractical from a real-world product support perspective. If we only support in-spec USB C cables we will have dissatisfied customers and a need to spend time on support cases that could have been avoided.

    It's a bit like designing for VBUS never exceeding some 5.x V without PD, because the specification doesn't allow it. I don't remember where, but I have come across technical documentation from some of the reputable IC manufacturers (perhaps TI or ST) that warn about rogue USB C chargers that provide 20 V without PD negotiation.

    Thank you for referring me to '4.5.3.2.2 Legacy Host Port to Sink Behavior':
    "The value of Rp shall indicate an advertisement of Default USB Power (See Table 4-24), even though the cable itself can carry 3 A. This is because the cable has no knowledge of the capabilities of the power source, and any higher current is negotiated via USB BC 1.2." I hadn't realized that this is actually part of the specification.

    I had already read slyy109a.pdf. It is indeed one of the best design documents, but it doesn't mention BC1.2 (which is no worse than the competition, but still not sufficient).

    I have looked at www.ti.com/.../products.html but the closest I come to what I am looking for is the TPS65987D. I haven't scrutinized its datasheet, but I would welcome something similar without support for PD. It would have to be possible to configure it so that it accepts out of spec USB C cables. And it should interface nicely to e.g. bq25896. There must be a huge market for MCU USB2.0-only USB C products that can take both SNK and SRC role.

    -

    The design I'm working on will have two main purposes; a test platform for dual-role USB2.0 USB C BC1.2 that can also be used as a development board for the actual future products. As such I am making the TUSB320HAI configurable both for I2C and pin control and I am incorporating diode OR-ing for its VDD so that you power it from 3.12V (bq25896 VSYS and LDO from LiIon battery) when VBUS is not present but jack VDD up to above 3.5V when acting as SRC and advertising 3.0A. From this design I can then remove bells and whistles when transferring the proven design to the actual product.

    I'll also include the TS5USBA224 and add a pin header for ASEL, USB C connector rotation/polarity, and audio signals so that support for Audio Accessory can be added with a breakout board.

    In summary: The best solution I have found is TUSB320HAI/LAI, PI3USB9201, and bq25896. This means three fairly separate interrupt sources that all need to be queried and reacted to. The PI3USB9201 should probably be disabled until either TUSB320HAI or bq25896 says that 'it seems we have become attached'. Running TUSB320HAI in pin control (and listening to the bq25896 PG# pin) should improve 'response time' at attachment as a device/SNK. This is why TUSB320 pin control mode is potentially very interesting, despite its limitations.

    In our case, we will have a menu option through which the user can select to change to host/SRC for a limited period of time (15 seconds?). The HW and SW are reconfigured for host/SRC and current is advertised both via CC and BC1.2. We might include a menu option to provide VBUS 'legacy style', so that it will be possible to violate USB C specs but at least it has to be an active choice. If attachment is not done in this limited time frame, the product reconfigures itself to idle device/SNK.

    Best regards

    Niclas

  • Hi Niclas,


    Isn't the TS3A227E only for the 'audio jack to USB C adapter' or simply 'audio jack decoding'? It incorporates switches for Mic/GND but as I understand it they exist because there are two different standards for where Mic and GND are located on the 3.5 mm plug? They make sure that the Mic pin on the TS3A227E has the correct polarity? But, don't you also (inside the handheld) need to account for the rotation of the USB C connector?

    TS3A227E can automatically determine the MIC and GND connection from SBU1/2 as well and routes the signals appropriately to the internal destination. It is not necessarily just for audio jack decoding on 3.5mm plug. The external adapter would have the USB-c plug goin into you receptacle.   

    I have looked at www.ti.com/.../products.html but the closest I come to what I am looking for is the TPS65987D. I haven't scrutinized its datasheet, but I would welcome something similar without support for PD. It would have to be possible to configure it so that it accepts out of spec USB C cables. And it should interface nicely to e.g. bq25896. There must be a huge market for MCU USB2.0-only USB C products that can take both SNK and SRC role.

    Unfortunately I am not an expert on TPS65987D. I would recommend posting questions for this device to understand if this is possible. 

    n our case, we will have a menu option through which the user can select to change to host/SRC for a limited period of time (15 seconds?). The HW and SW are reconfigured for host/SRC and current is advertised both via CC and BC1.2. We might include a menu option to provide VBUS 'legacy style', so that it will be possible to violate USB C specs but at least it has to be an active choice. If attachment is not done in this limited time frame, the product reconfigures itself to idle device/SNK.

    I think requiring user action when using this type of cable is a good solution given the circumstances. This will ensure that the "non-complaint" behavior does not occur on it own and quarantined to the specific cables.  

    Hope my comment were helpful!

  • Hi Malik,

    Thank you once more. Your input has been most valuable.

    I hope others will find this thread useful. We decided to go with USB C before we understood what it would require. In hindsight we should have stuck to Micro AB USB and OTG. The time spent cannot be justified by the extra value brought by non-PD USB C. On the other hand, we now have what seems to be a solid USB C USB2.0 design that's backwards-compatible and hopefully a bit more future-proof.

    Keep up the great work.

    All the best

    Niclas