gregdavill / PD-sniffer

USB PD sniffer
Creative Commons Attribution 4.0 International
180 stars 15 forks source link

[v0.1] Eliminate Q2 and Q3 #7

Open dnschneid opened 3 years ago

dnschneid commented 3 years ago

This requires minor code changes, but sort of similar to this design, you can eliminate the Q2 and Q3 double FETs and drive the resistors directly from the STM32. Resistors need to be reduced in value to compensate for the STM32's weaker GPIOs (probably 75 ohms on the low end and 150 ohms on the high end).

Code needs to be changed to make CC1_TX_EN become CC1_TX_EN_ODL -- that is, when transmitting, drive low on the GPIO, and when not transmitting, leave it high-impedance.

This is divergent from the Twinkie firmware, but only matters in the device emulation mode case, so at least the sniffing firmware can be used unchanged. It eliminates 4 FETs, which is of course great for hand assembly.

I would of course recommend prototyping this on existing units and ensuring that the voltages and duty cycle turn out right.