歐胖
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # PD TYPE- C Elementary Guide 1 ## 大綱 ### Type-C Port架構 1.Type-C Port Manager 2.Type-C Port Controller 3.Type-C Port Controller Interface 4.USB-C Power Path Controller. 5.USB-C Redriver and Retimer ### USB Type-C 概述 1.Signal overview 2.Configuration Channel(CC) Pin 3.Type-C Role # Type-C Port 一個功能完整的Type-C Port需要同時符合**USB Type-C Specification**及**USB Power Delivery Specification**的規範,符合兩個規範的晶片稱為**TCPC(Type-C Port Controller)**。 一個**管理者(Type-C Port Manager, TCPM)** 透過I2C的溝通來控制Type-C Port的功能。 **(EC在Chromebook扮演著TCPM的角色)** ![](https://i.imgur.com/4JnDfSo.png) 圖1.type-c架構圖 ## Type-C Port Manager ### ec在TCPM主要的功能有以下幾個: 1. 透過I2C判斷**外接裝置**的Type-C Port的CC pin狀態 2. 透過I2C設定**本機端**的Type-C Port的CC pin狀態 3. 處理Power Delivery Message中的Protocol Layer訊息 簡單說,可以抓取PD的CC狀態與PD的傳輸訊息 :::info 補充:CC(Configuration Channel) ::: ## Type-C Port Controller TCPC則是整個Type-C功能的核心晶片,主要負責的部分為**Physical Layer**及**CRC的處理**,以及**實現TCPM的設定**,通常在各個晶片的Specification都會提到各個晶片所支援的規範版本。 ### TCPC主要分三個部分 1. **TCPC-compliant registers** TCPM透過I2C與TCPC進行讀/寫設定值,如果Specification沒有提到該晶片符合TCPCI規範,會自己的Register Specification要另外注意。 2. **CC Detect & PD Logic** 任何一顆TCPC都具有辨識對方的cc pin及控制Host端的cc pin來決定Host端的Power Role及Data Role,並且透過cc pin進行PD Logic的溝通。 3. **Switch(Mux)** Type-C Port除了充電及USB功能外,還可以透過Alternate Mode的選擇,切換成其他的功能如投影(displayport)、耳機等功能,此時就會透過switch模組(統稱Mux: Multiplexer)來切換不同的功能。 ## Type-C Port Controller Interface https://www.usb.org/sites/default/files/documents/usb-port_controller_specification_rev2.0_v1.0_0.pdf 在TCPCI Spec.中定義了TCPC必要條件: 1. Port Power control for VBUS 2. Port Power control for VCONN 3. Port Power control for CC control 4. Port Power control for sensing 5. USB PD Message delivery ♢***非常重要: protocol layer message 每個bit 都要到TCPCI查表*** :::info 補充 合格TCPCI `.set_vconn = &tcpci_tcpm_set_vconn` 不合格TCPCI `.set_vconn = &anx74xx_tcpm_set_vconn` ::: ## USB-C Power Path Controller(PPC) 1. 主要功能: OVP、OCP、RCP、FRS、ESD、Dead Battery 2. 防止電路板出現過電流過電壓的情況(Vbus) 3. 有些PPC有額外保護Vbus的信號 :::spoiler 功能詳細資料 OVP: over voltage protection OCP: over current protection RCP: reverse current protection FRS: fast role swap ESD: Electostatic discharge(Electron Static Discharge) ::: --- ### 電路保護,分下列幾點保護 1. 過溫保護 2. 過電壓保護 3. under-voltage 在電源電壓低於正常工程準位時,切斷電源的電路。 4. Reverse current protection 當 Vout 高於 Vin 時,反向電流保護電路會阻止從 VOUT 引腳到 VDD 引腳的反向電流。 ![](https://i.imgur.com/XCEQnJM.png) 圖2.TCPC+TCPM與PPC的電路圖 --- ![](https://i.imgur.com/m8PNPP6.png) 圖3.NCT3807 TCPC :::info 提問1:TCPM+TCPC跟PPC是怎麼溝通的? 答:TCPM(EC)用I2C控制PPC 提問2:PPC是否有公規的SPEC? 答:有,在sever上有,有需要在上去看 ::: ## USB-C Redriver and Retimer Redriver and Retimer兩個是一樣的東西,只是一個價格高一個價格低。 Redriver and Retimer功能:訊號重整拉到一定的準位在發送出去,訊號整流器概念。 以Burnside Bridge(BB)來說會支援三種模式: ~ 1. Bypass Mode 2. Display Port Mode 3. Thunderbolt/USB4 Mode - **init時會在Bypass Mode,有需要其他功能會切過去** :::info 提問1.有幾個port就要幾個retimer?or 是否離得很近是否還需要retimer? 答1.問HW 提問2.ec 如何控制retimer的? 答2.使用register(i2c控制) ::: # USB Type-C 概述 ## Signal overview USB –Type-C插頭是可反轉使用的,任一方向插入均可;無論怎樣插入,電源的連接都是正確的。 由於插座上含有兩組連在一起的資料線D+/D-,所以插頭以任意方向插入時資料線都是連通的。 用於高速通訊的TX/RX不能被連接在一起,所以CC線被用於對電纜的插入方向進行標識,並經由硬體線路對TX/RX進行路由,確保配置正確。(應該是根據電子標籤認證去認證他插入的方向,確保配置正確) ![](https://i.imgur.com/KuhlL9E.png) 圖3.晶片pin腳(上圖為母頭、下圖為公頭) ## Configuration Channel(CC) Pin cc pin 的功能行為操作,TCPCI Spec.定義TCPC必須作為控制CC pin之角色: 1. 依據規範決定Port power role 2. 回報CC pin狀態、控制Rp/Rd 3. CC的sense/debounce/interrupt(cc pin 訊號處理) ![](https://i.imgur.com/31nO846.png) 圖4. cc pin連接圖 在Source的CC pin會有**上拉電阻Rp**,在Sink的CC pin會有**下拉電阻Rd**。 **未連接之前**,Source的**VBUS是沒有輸出的**。並且會保持在高電位 or 零電位的情況。 **連接以後**,CC pin相接,Source的cc pin偵測到Sink下拉的Rd,表示接到Device,Source便會打開VBUS的FET開關,輸出VBUS給Sink,接著執行PD communication。 Source可以根據CC1與CC2的**附載阻抗來判斷連接狀態**,並且偵測它是否接到Debug Accessory或Audio Accessory裝置。 :::danger FET複習 ![](https://www.rohm.com.tw/documents/11409/1810996/tra11_a01.gif/afca455b-490c-495d-b252-e447fb62a3e8?t=1361310510127) 上圖以NMOSFET為例,但是目前最常使用的是CMOS-->N+P 場效電晶體(field-effect transistor-->FET) 是一種通過電場效應控制電流的電子元件。 主要應用是當作switch或是amplifier 1.Amplifier ~ 小電流/電壓從Gate端input,經過跨壓從Drain端output使訊號放大。 2.Switch ~ Gate沒電-->輸出0 Gate給電-->輸出1 ::: --- ![](https://i.imgur.com/05pdsfA.png) 圖6.各種CC pin的組合,與其相對應的關係 最後4個特別注意 當cc1連接到Rd cc2連接到Ra 或 當cc1連接到Ra cc2連接到Rd 會進入到VCONN-Powered Accessory 當cc1連接到Rd cc2連接到Rd 進入到Debug Accessory Mode 當cc1連接到Ra cc2連接到Ra 進入到Audio Adapter Accessory Mode 這些阻值會跟type-c的spec決定 表1. cc pin 的data role 、power role 、resistor ![](https://i.imgur.com/7cIjCJ5.png) DFP = Downstream Facing Port 是在Host端 UFP = Upstream Facing Port 是在Device端 DRD = Dual-Role, host與device的雙向溝通 SRC = source端 SNK = sink端 DRP = Dual-Role Power 具有source and sink雙向傳輸信號 Rp = 上拉電阻 Rd = 下拉電阻 Ra = cable間的下拉電阻 --- ![](https://i.imgur.com/l0mLhjQ.png) 圖7.Type-C cc pin 示意圖(正插反插的示意圖) Type-C 5 支援正反面connection, detected by CC pin 都唯一對一的connection 不會有交叉行為 CC connect Ra與Rd分壓 Vout 變小 完成相對應的USB輸出信號 ![](https://i.imgur.com/JQOmkqP.png) 圖8.power role and data role 比較 Type-C裝置的公頭與母頭並沒有固定的Host與Device的關係 --->透過CC pin去建立power role與data role。 ![](https://i.imgur.com/IRtZHaw.png) 圖9.Source端與Sink端的power role and data role 當Source端的裝置其Data Role為DFP,而當Sink端的裝置其Data Role為UFP。 若裝置有支援USB PD則可透過Power Role Swap或Data Role Swap來切換其角色。 當兩個DRP裝置接在一起,兩個裝置會**隨機組合**,一方為Source,一方為Sink。 ![](https://i.imgur.com/uj6aGzu.png) CC pin有CC1,CC2,當其中一個被用來做DFP,UFP之間的連結,另一個用就來供VCONN 當Cable內將另一個CC pin接一個下拉電阻Ra,代表這是一條**Electronically Marked Cable(E-Marker)**,需要透過VCONN提供電給它。 Source偵測到Ra,便會輸出VCONN在CC pin,供電給Cable。 ## Type-C Role Type-C 總共有三種角色: 1. power 2. data 3. Vconn ![](https://i.imgur.com/l0SMzTI.png) 根據Rp、Rd、Ra的阻值決定role Rp-->data role:DFP,power role:source Rd-->data role:UFP,power role:sink Ra-->Vconn 透過Power Delivery的swap的功能切換role ~ 1.Power Role Swap(PR_Swap): 對換SRC(Rp)與SNK(Rd)角色 2.Data Role Swap(DP_Swap): 對換DFP與UFP角色 3.Vconn Swap: 對換提供Vconn之port ![](https://i.imgur.com/Xaph5pQ.png) 上圖為DRP CC Functional Model,紅圈處是具備DRP功能的TCPC會有一個switch來切換Rd及Rp電阻,在未有裝置連接上的時候做toggle持續切換Rd及Rp,其切換週期必須符合Typc-C spec定義的tDRP(50 ms ~ 100 ms, duty 30%~70%) ![](https://i.imgur.com/UrIQBBl.png) 上圖為實際量測chromebook的Type-C port在未接上裝置前的toggle訊號,0 V表示目前切換成Rd、3.3 V表示目前切換成Rp

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully