USB power and Vin power at the same time?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

USB power and Vin power at the same time?

Post by gratefulfrog » Tue Nov 03, 2015 8:05 pm

Hi,

I have a question about powering the pyboard.

What happens if I first power the pyboard from the USB connector to the PC, and THEN connect the pyboard's Vin to +5v? Will the USB power be disabled?

I ask because I am working on an early prototype PCB with an onboard 5v 2A PSU.

Here are some sequences of events and results:
  1. 1. When I power the circuit from the PSU, without the pyboard connected, it all seems normal.
    2. When I connect the pyboard, it still seems normal.
    3. If I then connect the pyboard to the USB connector it still seems normal.
However, this sequence is not so great:
  1. 1. With the PSU disconnected from the circuit, I connect the pyboard to the PCB
    2. I then power the pyboard from the USB connector, it still seems normal.
    3. I then power up the PSU, providing now 5v to the pyboard's Vin, the PSU's LM2596 gets burning hot, I can smell it,
    4. I disconnect everything before it's too late.
Could this have something to do with how the pyboard manages its power source?

Any thoughts?
Thanks,
Bob
Last edited by gratefulfrog on Tue Nov 03, 2015 10:14 pm, edited 1 time in total.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: USB power and Vin power at the same time?

Post by dhylands » Tue Nov 03, 2015 8:17 pm

The pyboard doesn't really do anything as far as managing it's power source. The only potential for any management is U4 (which is not installed by default on the pyboard), which is needed for USB Host/OTG modes. The only other "management" circuitry is the diode that's present on the board.

If you're going to connect VIN and USB then you should definitely use an additional diode as @blmorris mentioned here:
http://forum.micropython.org/viewtopic.php?p=6569#p6570

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: USB power and Vin power at the same time?

Post by blmorris » Tue Nov 03, 2015 8:44 pm

It sounds like the LM2596 doesn't like having its feedback and output pins energized before it gets powered up; I don't have a good theory why, so this is just my WAG, but it is possible that it is latching up somehow. Either way, having another diode between the PSU output and Vin should prevent that. You can still power the rest of your circuit directly from the LM2596-based PSU without the intervening diode; the diode drop won't affect the pyboard since it will be getting power through its own LDO regulator anyway.

-Bryan

gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

Re: USB power and Vin power at the same time?

Post by gratefulfrog » Wed Nov 04, 2015 7:32 am

I think I understand.

But, in fact, I only use the USB connection to the pyboard for programming and testing. Once I am ready to deploy the entire circuit, there will not be a USB connection. The pyboard will get its power from the PSU as well (4.9v).

In either case, I'm guessing that a diode to prevent reverse flow out of Vin is a good idea?

Cheers,
Bob

gratefulfrog
Posts: 149
Joined: Sun Mar 01, 2015 12:10 pm

Re: USB power and Vin power at the same time?

Post by gratefulfrog » Wed Nov 04, 2015 9:25 am

Well, by first connecting the PSU, and only then the pyboard USB, there was no smoke!

I posted the video of the WORKING PCB driven by the Pyboard to this forum page!

Thank you all for your help, without which this never could have happened!!!

More results will follow!

Ciao,
Bob

Post Reply