02 June 2016

USB Type-C and Dual-Role Port Devices

This protocol analyzer capture shows how a DRP alternates between voltage source and sink until it sees one  or the other at the far end of a link
Figure 1: This protocol analyzer capture
shows how a DRP alternates between
voltage source and sink until it sees one
or the other at the far end of a link
At this juncture in our ongoing series of posts about USB Type-C and power delivery, it's time to acknowledge that some Type-C devices are not strictly a power source or sink. Some are called out in the Power Delivery 2.0 specification as dual-role port (DRP) devices that may act as either a source or sink for power. Note that unlike in the original OTG spec, this applies only to a port's power role, not to being a USB host or connected device.

The existence of DRPs in the PD 2.0 specification introduces a certain amount of complexity in this sense: At power-up, a decision must be made as to which end of the link is the default power source and which is the default power sink.

By rule, during detection the DRP is to alternate Rp voltage (source) and Rd voltage (sink) every 75 ms until it sees the opposite on the other end of the link. Also by rule, only one source and one sink are permitted in the link. So when the cable is plugged into the second device and the DRP does see the pull-down voltage on the far end, it then "knows" that it's attached to a sink and settles into its role as a power source. If one were to be watching this process on a protocol analyzer, it would appear as in Figure 1. Note that in packet #33, the port status shows as "Sink attached to left port" after numerous switches of source and sink attached to right port. It's important to note that although the DRP may initially be configured as a power source, it can later switch roles with the other device (hence the "dual-role port" moniker).

Shown here is the more complex case of two connected DRPs
Figure 2: Shown here is the more complex
case of two connected DRPs
Things get even more interesting when one DRP is attached to another DRP (Figure 2). Both can function as either a source or a sink, but they have to determine which is which; they can't both come up as a source. As USB 3.1 and Type-C proliferate, DRPs will be common. Laptops, tablets, and basically any battery-powered device with host functionality will have to operate as a DRP.

With two DRPs attached to each other, both sides will toggle between Rp and Rd every 75 ms. In effect, it's as if there is a switch within the two Type-C receptacles transitioning from pull-up resistance to pull-down resistance.

At some point, both DRPs see Rp or Rd on the CC line. The CC pin that's at the higher voltage indicates which should be used. The other CC line becomes Vconn if needed, and the downstream-facing device (DFP) should always be the initial source for Vbus.

The sensing on the CC pins is what tells the device(s) how the cable between them is oriented. In our next post, we'll continue exploring the Power Delivery 2.0 spec and look at the various PD message types.


No comments:

Post a Comment