Question
Can a simple NPN BJT transistor prevent a debug UART from backfeeding the MCU on the target PCB?
Problem
UARTs and associated USB-to-UART dongles (such as an FTDI branded one) are commonly used to debug microcontrollers on PCBs. The problem is that the TX
line from the FTDI device to the microcontroller is driven high when IDLE by the FTDI device. This can prevent you from being able to reset the MCU by power cycling the board, as when you remove power to VCC
, the +3.3V
on the TX
line backfeeds through the MCU internal ESD diodes to VCC
, and keeps the voltage rail propped up. Series resistors work o.k. to prevent damage caused by this, but are not entirely suitable for making sure the VCC
net drops right down to near 0V
, as the power draw from the MCU drops significantly as it starts to turn off (e.g. through "brown out detection), meaning the MCU hovers in a weird state, or even worse, gets stuck repeatedly trying to turn on!
Potential Solution
Would a NPN BJT as shown in the image below fix this problem? I'll test this out on breadboard when I get the chance, but thought it could be good to ask here also! At least it might start some interesting conversation or discussion around other solutions to this.
I think the 0.7V
drop from base to emitter will be o.k., this will just mean that the MCU sees about 2.6V
as HIGH rather than 3.3V
. I initially designed this using a MOSFET, but the equivalent gate-source threshold voltage is usually much larger than the base-emitter drop of 0.7V
, meaning the logic HIGH could be even less than 2.6V
and start causing problems.