Go Down

Topic: Driving Mega2560 from external 5V bricks USB port (Read 19353 times) previous topic - next topic


Apr 03, 2012, 05:58 am Last Edit: Apr 03, 2012, 06:10 am by kurt6string Reason: 1
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

4) 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.


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?


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.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!


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.


Apr 07, 2012, 02:12 pm Last Edit: Apr 07, 2012, 02:15 pm by kurt6string Reason: 1
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?


Apr 07, 2012, 02:19 pm Last Edit: Apr 07, 2012, 02:25 pm by SurferTim Reason: 1
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.  :smiley-eek:


(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.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131