Driving Mega2560 from external 5V bricks USB port

After another hour of experimentation I found something that worked:

The following instructions are for Macintosh/osX (Lion), with the Arduino IDE 1.0.0 installed in the applications folder.

  1. Plugin a usb cable to the arduino mega rev3 in order to supply it with power.

  2. Plugin an avrispmkII programmer into the 6 pin icsp1 jack located adjacent to the usb connector (observe pin1 orientation via the dot on the board).

  3. Open a terminal window, paste in the following command and execute it:

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -p m16u2 -F -P usb -c avrispmkii -U flash:w:/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/firmwares/Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

  1. Unplug both the programmer and the usb cable, then plug the usb cable in and the mac (and the pc) should recognize the usb port as long as the arduino mega rev 3 is KNOWN TO BE GOOD.

Note that I had to alter the '-p' device code to 'm16u2', AND I had to use the .hex file that was contained in the arduino IDE's firmwares folder which was 21kb - The one I downloaded from git hub was 93kb, I have no idea why, but I do know that the instructions above work for me.

NOTE THAT THESE INSTRUCTIONS DID NOT REPAIR THE BOARDS THAT I THOUGHT WERE DAMAGED HOWEVER.

In one case the programmer indicated there were verify errors and did not restore the dead board.
In another case the programmer indicated the burn was successful but again did not restore the board.

The reprogramming only worked on the board that I bricked by apparently erasing the 16u2, or uploaded bad firmware.

Thus it still appears to me that I have 3 dead mega's and no clue as to WHY they're dead. Per-the-above-help, I have verified that the external regulator puts out a nice steady 4.98 volts both loaded, and unloaded and ripple is within the OKI-78's specifications.

Anybody have any other thoughts on the matter?

kurt6string:
In one case the programmer indicated there were verify errors and did not restore the dead board.
In another case the programmer indicated the burn was successful but again did not restore the board.

I find usually verification errors are not caused by a bad chip although they can be.
If the programmer indicated that the burn was successful, it is highly likely that the chip is ok.
I do not know why the USB port would not show up but it seems like in atleast the second case, the chip is likely still good.
At this point, I am totally confused.

I'm confused too! - But I'll retry the one that didn't have verify errors just to make sure, I'll report back on that. Thanks.

I just retried the 16u2 firmware reloads on two of the arduino mega rev 3's - one reports the burn was ok, one reports verification errors, and neither can be recognized. I don't think there's anything left to try....

Regarding my suspicion that simultaneously providing both usb power and external power to a mega2560 can damage the 16u2 (usb controller chip) I am now removing transistor T2 from the mega2560. This transistor is what allows usb power to be connected to the 5vdc bus. Removing it totally prevents usb power from being used.

Note that you cannot just clip the 5vdc wire (or an unpowered hub I think) because the usb power is applied to the 16u2 and is used to power an internal component which is used to provide power to the data lines. I tried this first, and it resulted in very very shaky usb connections. Sometimes it would connect, most times it wouldn't.

But removing T2 removes usb power from the 5vdc bus AND yet still allows usb communications to work properly.

to be continued...

Thanks for that info. I thought T2 may be the culprit back in reply #5.

I'm not sure it's the culprit, but removing it prevents using both power supplies simultaneously while allowing usb communications. What do you think T2 might be doing to damage the 16u2?

It was just a suspicion. You should know soon. How long would they last with T2 on the board?

edit: I don't know, but the gate on it is only disabled (gate high) by the voltage on Vin being higher than 6.6vdc. If you power the device with +5v, the gate is left low, which enables the fet T2. They don't do a great job conduction reversed, but they do.

I'd say the boards died within a 2-3 day time frame. I can't pin it down any closer than that because the usb cable was only plugged in intermittently but if I had to guess I'd say they had maybe 4-5 hours of time plugged into both usb and external power.

@kurt6string: Keep me posted on the results of your test. I have a project I put on hold until this is resolved.

We should know in a couple of days if the particular board I removed T2 from dies. But this won't be a very definitive test in that I'm sticking with this one particular mega, running on external power from an OKI-78 dc-dc converter. If it dies, then the OKI-78 is probably doing it or, it's a bad batch of 16u2's....I'd suggest just starting your project on a board with T2 removed to be on the safe side.

Hi folks, I am the Original Poster for this thread. Appreciations to SurferTim and kurt6string for digging deeper into this.

I was told on several forums that there should be no problem powering the Mega from the 5V rail, but my drawer of bricked Megas kept getting fuller. They were all R2, none were R3. The only R3 I have has been exempted from drinking at the 5V trough because I was running out of $$, so I modified my backplane to power it from 7V in the Vin pin. It was a bother, but it has not bricked. Here's the algorithm:

  1. Mega2560 R2 powered from external 5V regulated (+-2%) works fine.
  2. Plug and unplug USB cable over a few hours.
  3. Mega is no longer recognized as device by system. USB port disappears from IDE. Mega still runs last sketch but new one can't be loaded through USB port.
  4. Buy new Mega R2. Repeat steps 1-3.
  5. Repeat step 4 a few more times.
  6. Buy Mega R3, but have second thoughts about the 5V rail.
  7. Power Mega R3 by Vin pin. After 1 month of use, USB still works. Also Ruggeduino (Uno clone) works without problem in same circuit.

While this alone does not conclusively prove there is a design flaw or limitation in the Mega power circuit, the rest of this thread supports the idea. Can't prove R3 survives any better than the R2. I like kurt6string's idea about removing T2, but disappointed that he wasn't able to recover his bricked Megas. I am going to try his procedure when I get a chance. Maybe some of my bricked Megas can load sketches from their ICSP ports.

Modifying the Megas by removing T2 is not a solution for me. I need a plug-and-play. At this point, I am going to keep external supplies away from the 5V pin and provide the power through Vin. Perhaps this problem will be addressed in R4.

(Now... what to do with these bricked Megas?)

Note that I've sent emails to both sales and team at arduino.cc asking them to look at this problem AND to fix the broken zip file containing the rev3 reference design. First I emailed sales, then a week later forwared to team, after 10 days or so I still haven't received a reply and the broken zip file is still un-openable....nobody's home....

Others have power supply problems related to a power supply (Vin in this case) in conjunction with the usb power.
Take a look at the o-scope displays in reply #6 here. :astonished:
http://arduino.cc/forum/index.php/topic,100362.0.html

vanduino:
(Now... what to do with these bricked Megas?)

I think they should be sent back to the vendor with a warranty replacement request. The vendors get away with a lot that wouldn't be tolerated in consumer products under the umbrella 'electronic hobbyists'. And in this case I think that replacements are justified. I hope to do this as soon as I have a talk with my customer, who purchased the boards I used in development. My usage of the boards falls within all the documented specifications, and there are no caveats mentioned about usb and external power. If distributors start getting boards back then that drives change at the manufacturing level.

That reminds me, one of the Megas I bricked was an R3 from Radio Shack. They took it back, no questions ( < 30 days). So the r3's brick as easily as the r2's.

The others were evilbay items. Tough luck.

Good reason to buy these things from established vendors with return policy.

Is this USB bricking on 5V external power confined to the Mega? Anyone heard of it on the Uno or Nano?

I am planning on hooking a Nano to my backplane. Don't need another brick. I'll contact Gravitech (manuf) and see if they will warranty it.

Hello,

David Cuartielles from the Arduino Team here. I have been following this discussion trying to figure out what has been going on in this case.

Please note the following. We do not recommend connecting the Mega boards powering them from the 5V connector. Not the Uno R3 either. The voltage regulators we were using in the past (Arduino Serial, NG, Duemilanove, Diecimila, and part of the Uno's) would allow doing that. But the new way we use to bring power into the boards will not ensure the boards to work properly. That 5V pin is meant to be used to power sensors and low-current devices.

The fact that this issue is showing after a certain amount of hours of operation seems to be due to stress material. However I am just talking without scientific proof. Our hardware team is going to put some boards under test to check this point and see if there is a deterministic way to measure how long the boards run on this mode. I know this will not be of any help for your project as you seem to be interested in powering things from that 5v connector.

On the other hand, since our previous boards allowed this type of functionality, when documenting the new boards we copied material from the documentation files to the previous boards. There is one line about the 5v that says (and I quote textually):

5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.

.. that last part should not be there:

or be supplied by USB or another regulated 5V supply

If you want to power up your boards you should be using the Power Jack, Vin, or the USB port.

This is obviously an error on our side and we will replace the original Arduino boards you got bricked. Please send me an email to: d.cuartielles AT arduino DOT cc with the serial numbers of the damaged boards and their models. Include your preferred shipping address. I will make sure the same boards are shipped to you the minute after I get that email.

I am sorry for the non-Arduino branded boards. As you know we don't support those.

Thanks for your understanding and thanks for helping us finding out this error in our documentation. We will fix that immediately.

/d

Hi David. Is there any chance of getting a switching regulator with a wider input range?

I think that being able to be powered by 5v directly is essential functionality.
Many times people only have access to a 3-5v source that can be connected directly to the 5v pin.
In many cases 6.5v or more cannot be obtained.
It seems like a redesign maybe needed. Have you considered ultra-low voltage dropping diodes?