The [USB Type-C Cable and Connector Specification](https://www.usb.org/document-library/usb-type-cr-cable-and-connector-specification-revision-21) lists two types of cables:
- Standard: this supports USB 2.0 data transfer, as well as Power Delivery (PD)
- Full-Featured: this adds differential pairs used for SuperSpeed (SS) data transfer (for USB3, USB4, ...), and sideband use (SBU) for alternate modes or USB4 data transfer
eMarked cables include chips that communicate on the CC wire using the PD protocol.
They provide information about the cable, and are mandatory (but not sufficient) for 5A current transfer (e.g. for 100W charging) instead of the standard 3A (e.g. 60W).
- CC/PD: ensures the Configuration Channel (CC) wire is present, required to determine the plug orientation and for Power Delivery (PD) communication (used for fast charging)
- eMarker: indicates if the cable is electronically marked.
The detection is the complicated part of this design.
A5 on both sides are interconnected through the CC wire.
B5 on both sides are connected to Vconn.
Vconn only allows to power the embedded chip, but does not provide B5 interconnection.
The connected device can detect the presence of the chip, by checking if B5 (on each side) is pulled down using Ra (~ 1kOhm).
It can then provide power on Vconn.
The cable tester detects electronically marked cables the following way.
If Ra is present, the gate voltage of a p-channel MOSFET on the tester is pulled low, powering the corresponding LED.
By default the gate is pulled up by the resistor used for the CC LED.
When Ra is present, it is on both plugs of the cable.
Thus it is enough to detect is on one plug.
Because it can be on A5 or B5 pins, the detection circuit needs to be on both pins.
On the other plug, the CC pins can't be interconnected, else the voltages is pulled to low for the CC LED to work.
Thus, two separate LEDs are used to detect CC.
The pull-up resistor needs to be as high as possible to, for the Ra pull-down resistor (800-1200 Ohm) to work properly, activating the gate.
The BSS84 pMOS has a Vgs of ~1.7V.
A pull-up resistor of 2.2 kOhm is sufficient (with a 3V battery).
Green LEDs are used for CC.
Although they have a higher voltage drop, they seems to be more efficient.
With a 2.2 kOhm, it produces a bright enough light.
Warning: because green LED has a forward voltage drop of ~2V to ground, the battery voltage can't be higher than 3.3V, else the gate voltage will exceed the threshold and the eMarker LED will be on, which is a false positive.