Tiny 2040: Safe to program via USB while powered by 5V pin?

Title says all. Planning on having the Tiny 2040 powered via the 5V pin, but I also want to be able to write and test programs on it while it is installed in my project so that I don’t have to keep plugging and unplugging the USB every time. Not entirely certain that this is possible — notes don’t specify.

The 5V pin is directly connected to VBUS (5V of USB-C). So the answer is: no, it is not safe. If your voltage on the 5V pin is higher than the VBUS-voltage, you will be backpowering your laptop/pc. The same is true the other way around. If your 5V power is e.g. a battery, this even could be dangerous.

You could put a diode between your 5V power source and the 5V pin. This would protect at least your 5V source. Since you will have a voltage drop across the diode, chances are high that the USB-voltage is higher than the 5V voltage and thus this could also prevent back-powering the laptop/pc. So measure the voltages and use at your own risk.

I’ve run into the same issue with custom power settups on an Interstate 75 and Plasma Stick. Two regulated suplies (one in the PC and one in the external device) fighting each other trying to regulate / control the one Bus voltage doesn’t usually work out very well.
I use a Data only USB Cable with those setups. The -5V wire is cut, only the Data+, Data -, and Ground are connected from the PC to the Pico device. Hunt around and you can likely find a ready made version. I just used an exacto knife to preform my own surgry on mine. Any time I see a yellow usb cable with some black electrical tape on it; I know which cable it it, and what its for. ;)

1 Like
  1. I’m powering the board through another board’s 5V rail (it’s a 12v input with a 5v rail). It will never be powered with a battery.
  2. I will only have the USB plugged in for setup and testing.

Does that make a difference?

Not really. You run the risk of damaging something, even if its only a short time. I would unplug the supply feeding the 5V pin, while programing. What else is connected to the Tiny 2040?

2 Likes

Just a few GPIO pins into some inputs on another board.

If I just leave the 5V disconnected the entire time during testing, and keep the board plugged into USB, I feel like that would do the trick.

Thats good pratice, IMHO. For me, my PC’s stock Type A port won’t supply enough curent to drive what’s added on to my Plasma, or i75. Wierd things happen as a result, and it just wouldn’t do. I’m a retired electronic technician, it’s no big deal doing modifications to stuff to make it work. But I get that, thats not always the case for other forum members.