View Full Version : USB powered demo board
11-10-2006, 12:46 PM
Being on the move a lot, the propeller demo board and my laptop have gotten to know each other quite well. I love its size and all that it can do... but there is one minor problem, the power supply. It comes with the standard wall-wart to power the 5v regulator, which in turn powers the 3.3v regulator. This works great... given that you are near a power outlet. I've had a few situations to where I've run out the door with my demo board and my laptop, only to forget the supply... and guess what? No working demo board for me!
So I got to thinking... may things are powered from the USB port these day (even the prop plug/clip!). Why not power the demo board from the USB port? It is a regulated 5v already... and the demo board has the 3.3v regulator on it. So, refrencing to the demo board schematics you can see that the 5v regulator output is connected straight to the 3.3v regulator's input, but that line also has a hookup right by the mini breadboard!
Thus, after cutting up an old USB cord that powered a small fan, I was able to hook the +5v wire into the 5v socket on the demo board, and the ground wire to a Vss socket on the board as well (see image attached). The board fired right up and ran great. It was running a program I wrote to display the date/time onto a vga monitor... I let it run for over an hour and it was perfect. http://forums.parallax.com/images/smilies/jumpin.gif (Note: picture was just a quick shot of the USB cable hooked up to it)
This also lead me to think... would it be possible to make the demo board usb powered in the future? Meaning, you have the option to power the board from the usb cable already plugged into it? I'm probably going to make a cleaner USB cable that has an extended 5v wire comming out of it to hook right into the 5v socket on the board... it would make my life a little easier!
while alive = 1
11-10-2006, 01:05 PM
There are definite limits to how much current a USB device can draw. Someone else here·might know better, but I believe that without asking "permission", you may only draw 50ma, or so. With permission, you can get 500ma.
One cleaner way to get the USB 5V line to power the Demo Board would be to just solder a tiny wire from the 4.7uF 0603 cap near the FTDI chip, over to the 5V regulator's output. Then, no extra cable would be needed.
Maybe in the future we could do this, but we're a little loathe to do something outside of the USB spec, even if it always works in practice. For your personal use, this is quite fine, though. I bet other people would be interested in getting the same setup. I know Potatohead travels a lot and plays with his Propeller in hotel rooms.
Post Edited (Chip Gracey (Parallax)) : 11/10/2006 5:09:02 AM GMT
11-10-2006, 01:27 PM
Quite interesting on the current limits there, I know that 500ma is the maximum (2.0 specs), didn't know about the 50ma bit though. Still, being able to run the demo board with a vga driver going is great.
I also had the keyboard and mouse (from the propeller starter kit) hooked up to the demo board, and it ran fine under under the usb's power... and the mouse alone is rated 100ma.
I think this is worth looking in to :)
while alive = 1
Phil Pilgrim (PhiPi)
11-10-2006, 01:40 PM
Powering a board from the USB port can be tricky. The fact that you got it to work at all is laudable, indeed! However, for utmost reliability, there needs to be a power switch and soft-start circuit between the USB +5V supply lead and the downstream circuitry. The reasons for this are twofold:
1. The USB port does not supply full power until the USB chip has been detected and "enumerated" by the operating system. Until then, the maximum allowable current draw is only 500µA. (Apparently, as in your case, not all PCs actually limit the available current in this fashion.) When full power is available, there's an output on the USB chip that signals this fact, which can be used to turn on the downstream circuitry.
2. The +5V source, even at full power, is current-limited, both by the host driver and the USB cable impedance. What this means is that any sudden current demands (e.g. charging a filter cap) could cause enough of a voltage drop to reset the USB chip. For this reason a soft-start circuit, which limits the initial inrush current, is necessary.
FTDI (http://ftdichip.com/FTDocuments.htm) has published quite a bit of info in their datasheets about USB-powered devices. Some of it I disagree with, as their suggested circuits have proven ineffective on my bench. And the FT232R's power switch output has a glitch at startup (which is not present in the FT232BM), rendering it ineffective for its intended purpose. But their literature is still a good place to start.
A better soft-start circuit is described by Texas Instruments here (http://focus.ti.com/lit/an/slva156/slva156.pdf) (pdf) and forms the basis of the soft-start circuitry used in Parallax's MoBoStamp-pe (http://www.parallax.com/detail.asp?product_id=28300), as well as the MoBoProp board that I've been working on.
To see how FTDI's and TI's original concepts have been morphed in a real product, you can take a look at the schematic of the MoBoStamp-pe available at the end of this document (http://www.parallax.com/dl/docs/prod/boards/28300-MoBo-0906.PDF) (pdf). This board also includes a brownout detector that turns off the downstream circuitry under heavy load to keep the USB chip from resetting.
11-10-2006, 02:33 PM
This is a great idea.
I'll probably do this, as I've already been to a thrifty looking for a new wall wart!
(I never buy new wall warts)
Edit: I often run an external large sized disk in a USB case. It's for virtual machine images for demos, training and support. It came with a cable that taps power from two USB ports and a switch. If I boot the laptop with it plugged in, the USB port gets cranky, even with both plugs plugged into ports. This is often true for the battery supply as well.
If I let it all boot up and settle in, then toggle the switch, things are fine. It averages 300ma, with peaks over 500ma. Have used it for at least a year and the USB ports on the laptop are just fine.
Running a demo board should be no biggie --at least in the as shipped condition.
Post Edited (potatohead) : 11/10/2006 6:58:53 AM GMT
Don @ DLP
11-10-2006, 09:06 PM
The DLP-PROP has the regulator on-board that takes power from the USB port: http://www.parallax.com/propeller/tools.asp
In standby mode, the max power a USB device can draw per the spec is 500uA.· I think this is designed to save the battery on a laptop since the 5V power is still available at the USB port when the laptop enters Standby mode (ie when you close the lid·on the laptop and go to lunch).· The DLP-PROP draws about 390uA in standby mode.·
When a USB device is first connected to the USB port (before enumeration completes) it can draw no more than 100mA.· After enumeration completes, the max current that can be drawn is 500mA, but be careful.· If you are connecting to a USB Hub that is NOT powered (no wall wart) then the max current that can be drawn after enumeration is 100mA.
Most USB target designs use a MOSFET switch that keeps power turned off to the electronics until enumeration completes to make sure the current spec is met.· To get a look at such a design, go to the last page of the datasheet for the DLP-PROP (http://www.dlpdesign.com/dlp-prop-dsv11.pdf) and look for the MOSFET transistor Q1.
11-10-2006, 10:13 PM
Now I'm starting to become even more interested in this concept...
It is just really interesting to me as to what is going on exactly... if the USB port is limited to 100mA before emumeration, then technically me using that power to drive my setup really shouldn't work out... I have my demo board with the mouse, keyboard and an external time-keeping chip (although it pulls VERY little current) running a program at 80Mhz with about 5 active cogs. I'm quite sure all of that exceeds the 100mA range (as I posted before, the mouse alone is 100mA). Also, I used this setup both on my laptop (which is only USB 1.1) and my power-house desktop (USB 2.0).
Does it make a difference that the cable I'm using is just the 5v+ and Gnd straight from the USB port? I haven't tried to leech power from a usb cable that is plugged into something and has communication going on.
Hmm, maybe building a battery pack that is rechargeable via the usb port would be a better route...
Isn't electronics fun?
while alive = 1
Don @ DLP
11-11-2006, 12:15 AM
If you don't care about adhering to the USB spec, and you are not using a hub, then you can probably use the 5 volts (500mA max) from the USB port for whatever you want. If memory serves, exceeding the current spec will only be noticed (or complained about) by a hub.
Remember, you didn’t hear this from me. I’m trying to keep peace with the USB gods…
Cliff L. Biffle
11-11-2006, 12:51 AM
It's not just the HCIs -- hubs will even let you bend this. That's why there are a bazillion "make a USB-powered X" projects on the net right now: people have discovered that most USB ports are handy 5v current sources.
You should have no trouble pulling at least 150mA from just about any USB port. Not saying it's a good idea, mind you.
Phil Pilgrim (PhiPi)
11-11-2006, 01:02 AM
And this would explain why "soft-start" power switching circuits based on FTDI's design appear to work.
Oliver H. Bailey
11-12-2006, 11:31 AM
I did a lot of research on this for Embedded Systems Desktop Integration a couple years back. The idea was to limit current draw to 100ma until the device could tell the host the maximum current required (up to 500ma). This would avoid a device that may have a problem from not only pulling a drain on the host but prevent a dangerous situation from arising from an unattended device that may be seriously overheating. If a USB device pulls more current than it states, the host will disconnect it and shut it down. Setting up a breadboard using USB power should be done very carefully and with tremendous caution. It is very easy to develop on a bench with a powered hub and then go to a client site to demo your work forgetting your powered hub. That can be a very embarassing situation. Remember that each host controller supports up to 127 devices. If each device used 500ma that over 60 amps of current. In addition high current drain devices do affect laptop batteries and can cause other heat related problems. While some laptops may not turn off the power to use in suspend mode, other do cut the power (IBM) whenthey suspend. While USB pots seem like a good source of 5 volt power, it can quickly prove to be more trouble than using a wall wart. Proceed with caution.
11-13-2006, 03:29 PM
As a side note... I recently hacked the USB2SER adapter to grab the 5v coming off the USB to power a project. Works great, the USB hub on my machine shows a 90ma drain with the prop running and doing it's job.· I'm using a MCP73831 to charge a lithium battery from an old bluetooth headset.· Works well so far!
I'm assuming it'd be just as easy (especially with Chip's suggestion) to do on the demo board...· Which is tempting me as I type this....
Post Edited (sharpie) : 11/13/2006 7:36:21 AM GMT
11-13-2006, 09:48 PM
It does sound very tempting, but my hands aren't stable enough... I bet I would end up destroying the programmer http://forums.parallax.com/images/smilies/freaked.gif
while alive = 1
11-13-2006, 10:56 PM
Just as an aside, Radio Shack sells a really tiny wall-wart (#273-1763) that works very well with any low drop-out regulator. It puts out 6V at 1.8A. I've used it with both the Stamp and Propeller development boards.