2014年9月25日 星期四

USB Type-C Configuration Channel (CC) pin function (English version)

USB Type-C Configuration Channel (CC) pin function

When you realized the Type-C Configuration Channel pin function, you would understand the detection mechanism of Type-C. The six items as below are Type-C CC function.
1. Detect attach of USB ports, e.g. a DFP to a UFP
DFP (Downstream Facing Port) is Host, UFP(Upstream Facing Port) is Device. There is a pullup resistor Rp in DFP side and there is a pulldown resistor Rd in UFP side. Before the connecting between DFP and UFP, the DFP VBUS source have no output. After the connecting between DFP and UFP, the CC pin in DFP detected the voltage level of CC pin was dropped by Rd, then DFP know the UFP is attahced,DFP would turn on the MOSFET in VBUS path and supply VBUS to
UFP.


There are 2 CC pin in DFP side, DFP detect the three kinds of pulldown resistance,  Open, Ra and Rd,  DFP can identify the state of connecting accroding to the CC1,CC2 table as below. 

2. Resolve cable orientation and twist connections to establish USB data bus routing
The Type-C can be plugged with upside-up and upside-down. When the DFP detected the CC1 pin was pulled down, it is upside-up plug. When the CC2 pin was pulled down, it is upside-down plug. The figure as below show the MUX is used Type-C USB3.1 signal path switch. Since the data rate of USB3.1 is up to 10 Gbps, we need to add MUX to avoid the trace branch or stub.

3. Establish DFP and UFP roles between two attached ports
Besides the DFP, UFP, the Type-C defined another port, DRP (Dual Role port). DRP can change to DFP or UFP.  When the DRP is connected to DFP, the DRP will change to UFP. When the DRP is connected to UFP, the DRP will change to DFP. When two DRP are connected together, it will be random that one to be DFP and the other to be UFP.

4. Discover and configure VBUS: USB Type-C Current modes or USB Power Delivery
The table as below show the power capability of each USB standard. The pure Type-C can support up to 5V / 3A. If USB PD is combined with Type-C, the power capability can be up to 20V /5A. The USB PD protocol is transmitted over the CC line connection.   

Type-C can support maximum current at 1.5A and 3A mode. How the Type-C port choose which current mode to run? The maximum current depend on DFP output  capability, DFP inform the UFP which current mode the DFP can support by the voltage value on CC pin. The resistance of Pulldown resistor ,Rd is fixed at 5.1K on UFP side. DFP can use Pullup resistor,Rp or current source, IP to produce voltage on CC pin. The variant of Pullup resistance or current will make the voltage on CC pin differentiallyThen, the UFP monitor the voltage on CC pin to know the output  capability of DFP.

Type-C spec define the Pullup resistance and current source for each current mode.
For example, when the DFP provide the 330uA to CC pin, the voltage of CC pin will be 330uA * 5.1k=1.683V. According to the table as below, this DPF  will be classified to be vRd-3.0 by the UFP. When the DFP provide the resistor Pullup to 4.75~5.5V with resistance 10k, the voltage of CC pin will be 5v * 5.1k /(5.1k+10k)=1.688V. This DPF  also will be classified to be vRd-3.0 by the UFP.

The BMC PD controller send the USB PD protocol over the CC pin connection.

5. Configure VCONN
Type-C spec define the Active cable which include circuit inside of the cable and need to be supplied power. There are two CC pin, CC1 and CC2. When one of the CC pin is used for connecting bwtween the DFP and UFP. The other CC pin can be used to supply power to Active cable. The name of this power rail is VCONN. When the DFP CC detected the Pulldown resistor, Ra , the CC pin will be switched from Pullup Rp to VCONN. The resistance of Ra  is 800~  1200ohm. The VCONN need to supply 4.75~5.5v and output power 1Watt.


6. Discover and configure optional Alternate and Accessory modes
Type-C spec define the Alternate and Accessory mode. The Host, Device, Cable can send structure VDM (Vendor defined message) to exchange the information and discover USB ID. When the Host communicated with the device and enter the alternate mode by VDM, The Type-C pin define can be  changed to support PCIe or DisplayPort. The example as below is Type-C docking application. It used MUX to switch one of PCIe and USB3.1 signal to Type-C port. The Type-C port can be used for docking with Ethernet port.

When the CC1 and CC2 are pull-down with resistance ( ≤Ra), the Host know the device is audio device , then Host enter accessory mode and switch USB signal to Audio signal.

Reference
1. www.usb.org  "USB Type-C Specification Release 1.0"

2014年9月24日 星期三

USB Power Delivery Protocol Layer

USB Power delivery定義了Protocol layer,利用Protocol制定的message來溝通。
下面為他們所制定的message格式。


每段message都會有16bits的header用來表示message的類別,如果是data message
,後面會有0~7個Data Objects,而control message被包含在16bits的header裡。


這16bits header的格式如下
Number of Data Objects:它讓接受端知道header後面會有幾個data objects。
MessageID:讓接受端知道,目前是第幾段message,在一開機時,應該為0。
Port Role:表示目前發出message的是0(Sink) or 1(Source)。
Specification Revision:表示發送端支援00(PD reversion 1.0) or
                                         01(PD reversion 2.0)。
Message Type:message分為control與data兩種,而data meesage會在header後面
                           跟隨data object。而conrol message沒有data object。

Control Message:當Number of data objects為0,表示這段message為Control
                                    message。Control message用來做兩端的溝通。


Data message:用來傳送資料。


   有下面四種種類的data object
 Power Data Object (PDO) :
Source端用來送出自已的供電能力,另外當Source端送出PDO,但Sink端發出Reject message來表示Source的供電能力不符合Sink端的需求,Source端可以要求Sink送出
PDO來表示Sink端需要的電力為何。

 Request Data Object (RDO) :
當Source端發送PDO後,例如是12/1.5A,Sink端可以發送RDO來表示自已只需要0.5A。


 BIST Data Object (BDO) :
用來做physical layter test,算是debug mode。

 Vendor Defined Data Object (VDO) :
用來傳VDM,可以知道另一端的Product ID、Cable ID。在確認ID後,如果device支援alternate mode,在Type-C port可以用MUX開關,讓原的USB訊號,改傳PCIE、DisplayPort訊號。如果device為audio裝置,可以從USB訊號PIN傳類比的耳
機訊號。是一個讓USB port延伸更多功能的方式。

Reference
1. Universal Serial Bus  Power Delivery Specification_Revision  2 .0,   V0. 90

2014年9月22日 星期一

DisplayPort for USB Type-C

Video Electronics Standards Association (VESA)在9/22發布在Type-C Alternate Mode支援
DisplayPort。在我的另一篇文章"USB Type-C Configuration Channel (CC) pin function"提到USB PD的VDM (Vendor defined message)可以讓Type-C的host認到device裝置,而進到Alternate mode。

從下圖DisplayPort的圖可以看到,DP包含四個Lane,與AUX channel, Hot Plug Detect訊號。



下圖為DisplayPort Alternate Mode示意圖,當host認到device為DP裝置,便切換MUX/ Configuration Switch,讓原來Type-C USB3.1訊號的腳位,改為傳輸DP訊號。AUX訊號
Type-C保留的SBU1,SUB2來傳。HPD是偵測pin,作用與CC pin類似,所以跟CC pin共用。

如果要完全達到DP的功能,需要4個Lanes。

為了達到USB與DP信號可以同時進行,DP alternative mode也定義了2 lane來達到DP功能,並
支援下面的規格,這兩個lanes需要走USB3.1的通道。
– For DP 1.2a (HBR2), this provides support for 2560x1600 or 2 each 1080p displays。
– For DP 1.3 (HBR3), this will provide support of 4K UHD (3840 x 2160)


DP也支援docking傳輸,可以讓docking只經由Type-C port,就可以輸出DP,HDMI與多組USB訊號。 



Reference
1.http://www.vesa.org/wp-content/uploads/2011/01/ICCE-Presentation-on-VESA-DisplayPort.pdf
2.http://www.displayport.org/wp-content/uploads/2014/09/DP-Alt-Mode-Overview-for-VESA-                 v1.pdf