Advertisement

Debugging USB Type-C and USB power delivery system designs

July 22, 2019

gaya-July 22, 2019

Designing robust systems using a high-speed interface like USB Type-C requires a great deal of care. When the interface involves advanced features like USB power delivery, debugging designs becomes even more complex. While systems can be verified by confirming that messages are sent and received accurately, there are many issues that can arise that complicate verification.

For example, with USB power delivery, two devices must complete a power contract negotiation to determine how much power will be delivered between the devices. If there is an error during negotiations, however, it can be extremely difficult to debug the process unless you can actually capture signaling data in real-time and view them within the context of the USB protocol.

Visibility into the signaling is also important when communicating with devices from other manufacturers. With USB Type-C combining data, power, and video in one connector, it can be challenging to identify the actual capabilities of a Type-C port, such as whether it is a power source or sink, what power capabilities it offers or requires, and whether it supports Alternate modes. With signal visibility, it is a straightforward process to see how a device actually behaves. Developers can also verify communications over the Configuration Channel (CC) at both the electrical and message levels.

To assist developers, USB Type-C/PD analyzers are available, such as the CY4500 EZ-PD Protocol Analyzer from Cypress. Protocol analyzers enable non-intrusive probing and capturing of USB-PD protocol messages on the Configuration Channel (CC lines). This article describes debugging techniques using a protocol analyzer that can accelerate the development of USB-PD based designs. In addition to design and debugging, analyzers are also useful for assisting developers in understanding the USB-PD protocol. For information on the basics of the USB Type-C and Power Delivery protocol, see USB Type-C and Power Delivery: 101.

Protocol Analyzers

Protocol analyzers like the Cypress’s CY4500 EZ-PDTMProtocol Analyzer kit (see Figure 1) supports analysis of the USB-PD and USB Type-C specifications. They capture USB-PD messages on the CC line in a non-intrusive manner that does not negatively impact real-time communications. This analyzer consists of Cypress’s programmable MCU (PSoC 5LP), which monitors data on the CC line (USB Type-C Connector) and sends this data to the host application, EZ-PD Analyzer Utility, over a USB interface. The USB Type-C plug and receptacle on this analyzer provide a pass-through for CC messages transmitted between each USB-PD connection. The programmable MCU taps these CC messages without disturbing the system and transfers them over the USB interface to a PC running the CY4500 EZ-PD Protocol Analyzer, a tool that captures the USB-PD traces and displays (see Figure 2).

click for larger image

Figure 1: USB-PD Type-C Protocol Analyzer Kit (CY4500 EZ-PD)

click for larger image

Figure 2. EZ-PD Analyzer Utility user interface

Protocol analyzers enable easy electrical level and protocol level debug and analysis of any USB Type-C and USB PD system. The analyzer is powered through the USB interface to the PC and includes connector headers for the probing of USB Type-C signals (CC lines, VBUS, and SBU lines). The analyzer can trigger sets of GPIOs for timing measurements of specific (or a combination of) USB PD events. Support for CC termination by the analyzer allows for emulation of a USB Type-C source/ sink/ cable for testing without need to connect to another USB Type-C device.

On the PC side, a Graphical User Interface (GUI) enables easy capture, offline analysis, and debugging of USB PD messages at the protocol level of any USB Type-C system. The GUI simplifies triggering sets of GPIOs on the CY4500 board for timing measurements of specific (or a combination of) USB PD events. Developers can also easily enable and disable CC terminations on the CY4500 board for emulating a USB Type-C source/ sink/ cable for ease of testing. Developers can also easily search and filter messages to speed problem identification and resolution.

Debugging with a USB-PD Protocol Analyzer

To probe the USB Type-C signals of an unattached USB Type-C port, the USB Type-C receptacle (or Type-C plug) of the protocol analyzer must be connected to the USB Type-C plug (or USB Type-C receptacle) of the device under test (DUT) as in Figure 3. USB Type-C signals are brought on a header that can be used for probing the signals on an oscilloscope.

click for larger image

Figure 3. Protocol analyzer setup for debugging USB Type-C ports in detached state

For probing USB Type-C signals or for capturing USB PD messages on the configuration channel (CC lines on the Type-C port), the protocol analyzer must be connected in between the two USB Type-C ports as in Figure 4. The analyzer sends signals to the protocol analyzer utility running on a PC to capture and decode the USB PD messages coming over the USB Type-C port.

click for larger image

Figure 4. Protocol analyzer setup for debugging USB Type-C ports in attached state

Understanding USB Type-C signaling

USB Type-C DFP – Unattached State

In the default state, the Downstream Facing Port (DFP) is the power source and thus should expose Rpterminations (pullup) on its CC wires. If the DFP device has a Type-C receptacle, then both its CC wires should expose the Rpterminations as in Figure 5. Refer to the USB-PD specification for more details on the Rprequirements.

click for larger image

Figure 5. Unattached USB Type-C DFP with USB Type-C receptacle

If the DFP device has a USB Type-C plug, then Rp terminations should be exposed on its CC wire, whereas the VCONN shall be grounded (see Figure 6).

click for larger image

Figure 6. Unattached USB Type-C DFP with USB Type-C plug

USB Type-C UFP – Unattached State

In the default state, the Upstream Facing Port (UFP) with USB Type-C receptacle or USB Type-C plug is the power sink and thus should expose Rdterminations (pull down) on its CC wire(s) as in Figure 7. Refer to the USB-PD specification for more details on the Rdrequirements.

click for larger image

Figure 7. Unattached USB Type-C UFP

USB Type-C DRP – Unattached State

Dual Role Port (DRP) devices will initially toggle their state between DFP (by connecting Rpand disconnecting Rd) and UFP (by disconnecting Rpand connecting Rd) operation in the unattached state as in Figure 8 and Figure 9.

click for larger image

Figure 8. Unattached Type-C DRP with Type-C receptacle

click for larger image

Figure 9. Unattached Type-C DRP with Type-C plug

USB Type-C Attached State

When one DFP and one UFP or two DRPs are connected together, they accept the resulting DFP-to-UFP relationship (achieved randomly in case of DRP), and a successful Rp-Rdvoltage divider is formed on one of the CC lines. This indicates that the Type-C connection is established (see Figure 10 and Figure 11). For example, the CC value formed here is formed due to a voltage divider of Rp= 12k pulled to 3.3V on the DFP side and Rd= 5.1k on the UFP side, resulting in a voltage of roughly 900 mV.

click for larger image

Figure 10. Direct USB Type-C connection between USB device and Host (without EMCA cable)

click for larger image

Figure 11. USB Type-C connection (without EMCA) - flipped

The status of CC wires depends on the orientation of the USB Type-C plug connected to the USB Type-C receptacle. The status of the other CC line (or VCONNsignal) depends on which end the analyzer is connected to and also whether an EMCA [1] is used for the connection or not. Figure 10 and Figure 11 show the waveform captures in the absence of an EMCA. Figure 12 is a waveform capture of a USB Type-C connection with an EMCA in between DFP and UFP (as shown in Figure 13).

click for larger image

Figure 12. USB Type-C connection (with EMCA)

click for larger image

Figure 13. USB Type-C connection with EMCA

Continue reading on page two, "Understanding the USB-PD protocol" >>

< Previous
Page 1 of 2
Next >

Loading comments...