Request clarification re: Powering the Due

G'day all!

My crisp new Due arrived last night, and I can't wait to let the smoke out power it up.

But I have some serious questions that need to be clarified. Hopefully the answers will be helpful to the many others asking similar questions!

OK. The Due info sheet http://arduino.cc/en/Guide/ArduinoDue is quite confusing, as it says that the board may be powered from the USB port, but then a paragraph later it says it can't, and it must be powered by the DC adaptor if the board is a host.

So could we get some clarification, specifically :
-for testing, "first light" purposes (i.e. out of the box), what is the best method for powering the board?

This isn't explained anywhere, and would be an excellent item to add to the blurb sheet that ships with the unit, just so we know. A simple line diagram would be very helpful to prevent any potential release of smoke.

  • Can I program the board when it's just being powered by the Programming USB port?

  • Should I also remove any Native USB device at that time, or is it safe to leave in? In other words, can both USB connections be powered simultaneously, if I'm using the Native port from a powered hub, etc? Following on from this...

  • If I have a (second) USB target connected and powering the board via the Native USB port, when programming, can I just stick in the Programming USB connector, or should I only ever program on DC power?

Perhaps a simple "howto" thread, aimed at novices (I've been designing and building MCU projects for over a decade, but this is my first ever Arduino) could help prevent accidents and frustration. Could another Arduino image be used for this?

Ummmm... I think that's it for now. I hope this generates some interest and helps to improve the documentation. I'm happy to help out in any way I can - but right now, I know nothing!

Cheers,
Pete

CephasAntipodes:
s!

OK. The Due info sheet http://arduino.cc/en/Guide/ArduinoDue is quite confusing, as it says that the board may be powered from the USB port, but then a paragraph later it says it can't, and it must be powered by the DC adaptor if the board is a host.

So could we get some clarification, specifically :
-for testing, "first light" purposes (i.e. out of the box), what is the best method for powering the board?

Well ... I'm very much a novice and mine hasn't even arrived, but read this carefully:

ArduinoGuide:
The board can take power from the USB connectors or the DC plug. If using the DC connector, supply a voltage between 7V and 12V.
The Arduino Due has an efficient switching voltage regulator, compliant with the USB host specification. If the Native USB port is used as host by attaching a USB device to the mirco-A usb connector, the board will provide the power to the device. When the board is used as a usb host, external power from the DC connector is required.

Further down the guide it says:

ArduinoGuide:
When using the Due as a host, it will be providing power to the attached device. It is strongly recommended to use the DC power connector when acting as a host.

My understanding of this is as follows:
When programming and doing basic testing/applications, powering by the USB is fine. However, if you connect a USB device to the board (e.g. an optical mouse) the board has the capability to power the device only if an external DC supply is connected. There is probably some voltage drops across diodes or similar that make powering a USB device from a USB-powered board impractical and risky.

(EDIT Remember, "acting as a host" means it's the brains and the USB device is the peripheral. This was something that was either not possible or difficult to do on the AVR boards. When connected to the programming port, the board is now the peripheral and your computer is the "brains", it's not acting as a host.)

I have two Due boards I have been tinkering with for the past few weeks. Perhaps this will help clarify some things:

  1. There are two USB ports. One is the programming port, one is the native port. The programming port is only used for programming, connection to a different USB host, and/or power. The Native port can be used for programming, power, connection to a different USB host, and/or connection to peripherals (mouse, keyboard, android phone, etc).

  2. Power can be provided in one of 4 ways: a) via the programing USB port b) via the native USB port (this is not really the best method) c) via the DC barrel connector (jack) or d) directly to the board via VIN

  3. In any USB connection between devices (for purposes other than simply power), there must be exactly 1 host and X number of endpoints. The Due can play either role but not both at the same time. If you want to use the Due as a USB Host, you must use the native port. Either connection may be used if the Due is to be an endpoint. The firmware (i.e. sketch, program, etc) controls how the native port acts.

  4. Programming can be done without respect to how the board is powered or otherwise connected. When you connect the programming port to your computer (the computer is the Host in this case), power is provided from the computer to the Due. If there is no other source of power, the Due will draw from this supply. It's fine to power the board via any method when programming, and it's fine to leave things connected to other ports/pins/etc.

  5. you didn't ask about this, but IMO worth mentioning: when programming the Due, be sure to press the onboard "erase" (not "reset") button for a few seconds right before you upload the new sketch.

Hope that helps clear things up.

Thanks, guys, that's been really helpful.

I think I've got the gist now, after doing what I should've done in the first place - check the schematics! :blush:

In fact, it's best to power the board from the DC jack under all conditions, and to use the USB power option only when no DC power is available. The USB ports can provide power, but (as has been pointed out) not when the board is acting as a host, since it has to provide at least 100mA of USB power to meet the spec (technically, for faster USB modes, it should be 500mA). That's why you can't power from the USB and power either USB bus (oh dear, "PCB board" anyone?)

So thanks again. It's all coming together now, and no smoke has been released!

Cheers,
Pete