Hi!
I'm using a Freetronics Ethermega 2560, and everything was ok. But now I've declared by mistake Rx (pin0) as output and now I can't upload any sketch cause there is no rx communication and I get this error while trying to upload:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Is there a way to solve this?
Thank's a lot in advance!
I've tried following Nick Gammon's tutorial on how to program arduinos using ISP as seen here:
But his sketch stops at:
Attempting to enter programming mode ...
I've also tried programming blink sketch using the same connection that is mentioned on above link, but I get the following error:
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
Double checked connections but they seem ok.
Any idea?
Also did Loopback Test, but it fails. When I type anything on Serial Monitor and press enter RX light turns on but nothing else, I don't have it echoed on screen.
Did you use the cable to the ICSP headers version? That should have worked.
If you used individual wires for various Arduino pins you have to use different pins depending on the source and target Arduino model. Are you using an Arduibo UNO to program your Arduino MEGA 2560 as shown in one of the later examples? If you use a MEGA to program a MEGA you have to use different pins.
I don't know if you can use the ArduinoISP sketch to upload a MEGA. The UNO uses the STK500V1 protocol and the MEGA uses the STK500V2 protocol which supports the larger memory space.
The programmer it's an Arduino Uno, and I'm using the ISP programmer sketch that can be found at examples.
I've used individual wires. Following this instructions that I read at Nick Gammon's tutorial:
Arduino Uno Target Mega2560
D10 (SS) Reset
D11 (MOSI) D51
D12 (MISO) D50
D13 (SCK) D52
Gnd Gnd
+5V +5V
Dou you think I can try anything else?
When you use the ArduinoISP sketch you need to disable Auto-reset on the Arduino UNO running the sketch. Add a 1 to 10 uF capacitor between the Reset pin (+) and the Ground pin (-).
What is probably happening is the Arduino UNO gets reset and the IDE then talks to the Arduino UNO's bootloader. When asked for its signature it will reply with the signature for an ATmega328P which doesn't match the value expected from an Arduino MEGA 2560.
I've tried with capacitors of 1u, 2.2u, 4.7u and 10u. It keeps on returning the same :
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
At Freetronics forum I've read that I could try using a USBasp, but I would have to buy it. What do you think about it?
xexijreil:
At Freetronics forum I've read that I could try using a USBasp, but I would have to buy it. What do you think about it?
I like mine. At less than $4 from eBay I recommend everyone buy one.
To diagnose the signature problem more you need to turn on verbose download logging in Preferences. That will show both the signature received and the signature expected. If the signature received is 00 00 00 or FF FF FF it generally means a wiring or hardware error.
-
I figured that this was the problem cause it was when I changed code and put pin0 as output that I got the first error, and since then I can't upload sketches anymore. So I suppose it's because of that but I'm not sure.
-
When I try to program using mini usb to USB cable I get this error:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
As I don't have FTDI cable breakout I can't out the 0.1u cap. Should I buy one?
-
The board is running my sketch ok cause it prints on serial monitor what it's supposed to print while running.
-
Already bought USBasp on ebay, I'll get it on next Wednesday-Friday. But I would like to keep on trying anything that could make the Ethermega load sketches again if possible.
Thank's a lot for your help!!
I've realised at the time that I was posting the previous post that I bought a while ago the SparkFun FTDI basic breakout, so I've used it but I still got the same timeout error. I've looked for correct ways of connecting ftdi to Ethermega but I haven't found any, so I connected this way:
FTDI ETHERMEGA
GND GND
CTS GND
5V 5V
TX0 RX(PIN0)
RXI TX(PIN1)
DTR RESET
Also put the 0.1 cap between reset and DTR. Maybe I'm doing something wrong? I select as programmer Avrisp MkII while using FTDI.
johnwasser:
To diagnose the signature problem more you need to turn on verbose download logging in Preferences. That will show both the signature received and the signature expected. If the signature received is 00 00 00 or FF FF FF it generally means a wiring or hardware error.
I can't find that option at File->Preferences inside Arduino IDE nor in preferences.txt. Am I looking where I would not?
xexijreil:
I can't find that option at File->Preferences inside Arduino IDE nor in preferences.txt. Am I looking where I would not?
On the Mac it's Arduino->Preferences... I don't know where they put it on Windows.
In the "preferences.txt" file it's:
upload.verbose=true
Seems windows version is different. This is my preferences.txt (can't finde upload.verbose):
board=mega2560
browser.linux=mozilla
console=true
console.auto_clear=true
console.error.file=stderr.txt
console.length=500
console.lines=4
console.output.file=stdout.txt
editor.antialias=false
editor.caret.blink=true
editor.divider.size=2
editor.divider.size.windows=2
editor.external=false
editor.font=Monospaced,plain,12
editor.font.macosx=Monaco,plain,10
editor.indent=true
editor.invalid=false
editor.keys.alternative_cut_copy_paste=true
editor.keys.alternative_cut_copy_paste.macosx=false
editor.keys.home_and_end_travel_far=false
editor.keys.home_and_end_travel_far.macosx=true
editor.keys.shift_backspace_is_delete=true
editor.languages.current=
editor.tabs.expand=true
editor.tabs.size=2
editor.window.height.default=600
editor.window.height.min=290
editor.window.width.default=500
editor.window.width.min=400
export.applet.separate_jar_files=false
export.application.fullscreen=false
export.application.platform=true
export.application.platform.linux=true
export.application.platform.macosx=true
export.application.platform.windows=true
export.application.stop=true
export.delete_target_folder=true
last.screen.height=768
last.screen.width=1366
last.serial.location=875,90,417,379
last.sketch.count=0
last.sketch0.location=-8,-8,1382,744,555
last.sketch0.path=C:\Program Files (x86)\Arduino\examples\ArduinoISP\ArduinoISP.ino
last.sketch1.location=438,14,500,600,411
last.sketch1.path=C:\Program Files (x86)\Arduino\examples\ArduinoISP\ArduinoISP.ino
last.sketch2.location=-8,-8,1382,744,555
last.sketch2.path=C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
platform.auto_file_type_associations=false
preproc.color_datatype=true
preproc.enhanced_casting=true
preproc.imports.list=java.applet.*,java.awt.Dimension,java.awt.Frame,java.awt.event.MouseEvent,java.awt.event.KeyEvent,java.awt.event.FocusEvent,java.awt.Image,java.io.*,java.net.*,java.text.*,java.util.*,java.util.zip.*,java.util.regex.*
preproc.output_parse_tree=false
preproc.save_build_files=false
preproc.substitute_floats=true
preproc.substitute_unicode=true
preproc.web_colors=true
programmer=arduino:avrispmkii
run.display=1
run.options=
run.options.memory=false
run.options.memory.initial=64
run.options.memory.maximum=256
run.present.bgcolor=#666666
run.present.exclusive=false
run.present.exclusive.macosx=true
run.present.stop.color=#cccccc
run.window.bgcolor=#F0F0F0
serial.databits=8
serial.debug_rate=115200
serial.line_ending=0
serial.parity=N
serial.port=COM5
serial.stopbits=1
sketchbook.path=C:\Users\Jesús\Documents\Arduino
target=arduino
update.check=true
update.id=-1801025090770262859
update.last=1418470401651
upload.using=bootloader
upload.verify=true
You could try adding upload.verbose=true to your preferences.txt file and re-starting the IDE to see if that works.