Created Fri, 05 Aug 2016 22:53:21 +0000 by Marevealous
Fri, 05 Aug 2016 22:53:21 +0000
Hey I am in process of designing my own PCB for chipkit board (I will most likely use chipkit-diy bootloader). I am confused about VBUS pin. I know that it should be connected to 5V, but when? Does it have to be at 5V level all the time? Or only while using USB? Can it be left floating while not using USB? Also, what about the case when my board is powered from external power supply but USB is still connected to PC? Should I connect external power supply 5V to VBUS or keep VBUS connected to USB 5V? Thanks in advance!
Fri, 05 Aug 2016 23:22:56 +0000
VBUS is connected to the 5V pin of the USB. If that 5V pin also happens to be powering the board that's fine. That's known as "Bus Powered". If it's not powering the board then it's known as "Self Powered". It should only get +5V applied to it when the USB is actually connected. It should be disconnected at all other times.
If your board is supplying power and that power is "mixed" with the USB then there should be some form of "back powering" protection. A schottky diode is the simplest method. The highest voltage (board power or USB power) wins and powers the board.
Sat, 06 Aug 2016 08:39:41 +0000
It should only get +5V applied to it when the USB is actually connected. It should be disconnected at all other times.
Ok, so VBUS will be connected to USB connector 5V+.
If your board is supplying power and that power is "mixed" with the USB then there should be some form of "back powering" protection. A schottky diode is the simplest method. The highest voltage (board power or USB power) wins and powers the board.
Well, honestly I've been just using a jumper for that in the past, but it was with 8 bit MCUs which did not need another LDO for 3.3V (they worked at 5V). It worked well because I designed the jumper in a way that it has only two positions and one enables USB-powering and second external powering. Can you show example of your schottky solution?
Sat, 06 Aug 2016 09:37:18 +0000
The simplest method is just to "mix" the two 5V signals together before regulating down to 3.3V. Your 5V will be slightly lower than 5V though because of the diode voltage drop, which is why you use Schottky - the forward voltage drop is much lower. Choose ones that have the smallest drop you can find unless you don't need your 5V to be exactly 5V - and anyway, from USB it most likely won't be, since it can be anywhere from 4.75V to 5.25V and still be within the USB specifications.
[attachment=1]twopower.png[/attachment]
If you need close to zero voltage drop on the USB power to keep as close to 5V as possible then you need a more complex system - the same system that is used on 90% of Arduino and chipKIT boards, involving a reverse-connected P-channel MOSFET and a small op-amp to work as a comparator. The MOSFET is reverse biased and turned off when powered by external power, and forward biased when powered by USB. The body diode in the MOSFET lets through enough power to run the op-amp which then detects that the external power isn't there and turns the MOSFET on bypassing the body diode, which then removes the voltage drop.
[attachment=0]3pQ92.png[/attachment]