# Design This file fixes the nets, the values and the thresholds. Which exact parts and footprints to use is up to you; write them in the parts list. ## Nets | Net | Is | | --- | --- | | `VBUS_IN` | 5 V straight from the socket | | `VBUS` | 5 V after the fuse; what the rest of the board uses | | `GND` | Ground, and the socket's shell | | `CC1`, `CC2` | The socket's two configuration pins | | `CC1_SENSE`, `CC2_SENSE` | The same, behind a resistor (only if `detect_current` is on) | | `USB_DP`, `USB_DN` | USB 2.0 data (only if `data_lines` is on) | ## Parts and values | Part | Value | Why | | --- | --- | --- | | Resistor, `CC1` to `GND` | 5.1 kilohms, 1% | Tells a USB-C source that a device is attached and wants 5 V | | Resistor, `CC2` to `GND` | 5.1 kilohms, 1% | The same, for a plug the other way up | | Resettable fuse | Hold current at least the `max_current` input | Opens on a short downstream | | Surge clamp, `VBUS_IN` to `GND` | Working voltage at least 5.5 V | Takes the spike when a cable is pulled | | Capacitors on `VBUS` | 1 to 10 microfarads in total, 16 V or more | Steadies the supply without a large inrush | | Sense resistors | 10 kilohms or more | Limits current into the reader if CC touches a higher voltage | | LED resistor | 1.5 kilohms | (5 V - 2 V) / 2 mA | A source that offers more than 5 V over Power Delivery can put up to 20 V on a pin next to CC inside the plug. Anything on a CC net must survive that touching it. A plain resistor does. ## How much the source offers A source says how much current it will give by how hard it pulls the CC line up. Only the CC pin the cable connects carries a voltage; the other reads near zero. Read both and take the higher. | Higher of the two voltages | Means | A device may draw | | --- | --- | --- | | Under 0.2 V | Nothing attached | Nothing | | 0.2 V to under 0.66 V | Default USB power | 0.5 A | | 0.66 V to under 1.23 V | 1.5 A offered | 1.5 A | | 1.23 V and over | 3 A offered | 3 A | These thresholds are from the USB Type-C specification's table of voltages on a sink's CC pins. Confirm them in the current release before relying on them. Cases for R5, as millivolts on `CC1_SENSE` and `CC2_SENSE`: | CC1 | CC2 | Answer | | --- | --- | --- | | 0 | 0 | nothing attached | | 420 | 0 | 0.5 A | | 0 | 420 | 0.5 A | | 659 | 0 | 0.5 A | | 660 | 0 | 1.5 A | | 0 | 940 | 1.5 A | | 1229 | 0 | 1.5 A | | 1230 | 0 | 3 A | | 0 | 1680 | 3 A | | 199 | 0 | nothing attached | If the board may draw more than the source offers, it must hold back. That is the firmware's job, and the README says so. ## What the check reads The netlist names each part's reference and value and lists each net's pins. The check works from those and from the parts list, not from a drawing: - A resistor "from A to B" is a two-pin part with one pin on each net. - Values are compared as numbers: `5.1k`, `5k1` and `5100` are the same. - With `tool` set to `skidl`, run its own rules check as well. With `kicad`, run `kicad-cli sch erc` and export the netlist with `kicad-cli sch export netlist`. ## For whoever lays out the board - The two CC resistors and the clamp sit within a few millimetres of the socket. - The trace from `VBUS_IN` through the fuse to `VBUS` is wide enough for the `max_current` input: at least 0.6 mm for 1.5 A and 1.5 mm for 3 A, on an outer layer of ordinary 1 oz copper. - `USB_DP` and `USB_DN` run side by side, the same length, as a pair with 90 ohms between them. ## Named here - When the person names no firmware language, the function in R5 is written in Python. ## What this spec leaves to you Where this spec names something, use that name, so that two builds of it agree. Where it does not, the choice is yours. List what you chose in the README.