Go Down

Topic: Cannot upload code to Arduino Mega when connected to external power supply (Read 2159 times) previous topic - next topic

Zapro

Hi.

I got an Arduino Mega from a friend, it's brand new. He owed me one, since i gave him mine, sitting in a RepRap that i sold him.

The new Arduino Mega 1280 i received works perfectly, i just have a single problem - I cannot program it when it's connected to power trough the DC barrel connector or trough the VIN pin - When trying to upload the program the RX LED blinks three times, and i get this message: "avrdude: stk500_recv(): programmer is not responding"

I have tried a Loopback test, connecting RST to Ground and bridging RX and TX pins (0 and 1) there is fine communication over the FTDI chip.

It's not an genuine Arduino board, but looking at the PCB layout it's 100% based on the older Mega design (FTDI based)

Uploading code without external power connected works just fine, and the Arduino works fine and runs my program with external power connected.

Any advice, i cannot seem to find out what is causing the problem.

// Per.

Nick Gammon

My guess is it's something to do with reset. When externally powered it has already reset itself by the time you go to program it.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Zapro

Toggling the RST pin resets the Arduino just fine, under USB power or External power.

I guess i have to hook up the Oscilloscope to find out what is going on.

It's just interesting this reset-program is only there when on external power.

// Per.


Zapro


What voltage are you putting into Vin?


I was using a 12V supply, because i had some exteral stuff connected that needed the 12V supply too.

I have tried connecting an adjustable DC power supply now, and when the voltage on VIN gets over 6,75 volts, the communication stops.

This is really weird!

The 3,3 and 5V voltages on board is within specs.

What is happening ?!

// Per.

SurferTim

I am not sure. There is another thread that involves usb failures and powering the Mega through the +5v pin. Maybe it has the same problem through Vin also?
http://arduino.cc/forum/index.php/topic,82046.0.html

The odd number is 6.75v. If you read that thread, that is about the voltage that disables T2. That is the transistor that provides power to the CPU from the usb port. Maybe the regulator on the Mega Vin is not working?

Zapro

Well i got fed up and whipped out the oscilloscope and tried some stuff out.

Here is what happens:

When feeding the board a low voltage on VIN the 5V rail looks like this:



And when i turn up the voltage, this happens:


So the voltage regulator and/or Opamp is not happy!

I will try to replace some components and see what happens.

I'll return with my findings.

// Per.



SurferTim


Well i got fed up and whipped out the oscilloscope and tried some stuff out.
(snip)
So the voltage regulator and/or Opamp is not happy!

I will try to replace some components and see what happens.

I'll return with my findings.

// Per.


I would guess one or the other is not happy!  :smiley-eek:
Let us know what you find.

edit: What time scale are you using there? I can't tell how often that is happening.
Never mind. I just saw the time scale in the lower right corner.

Nick Gammon

It looks a bit like the voltage regulator is oscillating. I believe there is supposed to be a cap on its output to stop that. Maybe that has failed or they used a cheap or under spec one.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics


Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nantonos


Well i got fed up and whipped out the oscilloscope and tried some stuff out.

When feeding the board a low voltage on VIN the 5V rail looks like this:


It would be interesting to see similar oscilloscope traces when feeding a range of voltages (5.5V - 12V)  into the DC jack. Is the 5V stable or does it oscilate?

I ask because I wonder what is the optimum wallwart voltage to get - 7V? 9V?

Go Up