I am trying to use avrdude with a Mega2560 running ArduinoISP
Note: I have the 10uF cap on the Mega2560 RESET line as described by Ardunio.
Also, I am using avrdude/6.3 on Windows 10. The Mega2560(ArduinoISP) is connected to the PC using an a USB cable - connection is COM8.
I have a couple of tasks I want to do
- Update the firmware on my USBASP
- Load Arduino boot on ATTINY85 dev board.
I started with Arduino IDE but moved to avrdude to better understand the problem
For #1: Wired it per https://www.arduino.cc/en/Tutorial/ArduinoISP
AVR-ISP pin MEGA-ISP pin
6/10 (name)
1/9 (MISO) 50
2/2 (VCC) VCC
3/7 (SCK) 52
4/1 (MOSI) 51
5/5 (RESET) 53
6/10 (GND) GND
I tried using the command:
avrdude -c arduino -p m8 -P COM8
I get the error
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xed
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0
avrdude done. Thank you.
--UPDATE-- The error above was caused by not setting the BAUD rate. Now I get:
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
What I really want to know is more of how this process works so I can better understand it and be able to debug the issues.
- Is this an error communicating with the ISP (Arduino) or is it an issue with the ISP talking to the target (ATMega8B on USBAVR)?
- What does "stk500" mean? Is that the programming protocol, the ISP protocol, or something all together different?
- Is this all documented somewhere?
1 Answer 1
The target board was not reset.
The "Arduino as ISP" sketch uses pin 10 to reset the target, not the SS pin. So even on Mega, wire reset of target to pin 10, not to pin 53. enter image description here
Is this an error communicating with the ISP (Arduino) or is it an issue with the ISP talking to the target (ATMega8B on USBAVR)?
the first error "not in sync" is a problem with communication with the programmer. it was caused by wrong baud rate. the "invalid signature" is a response from the programmer about target. if the signature could be read avrdude would print the target MCU type. all zeros signature is when the target doesn't answer. so check the wiring.
What does "stk500" mean? Is that the programming protocol, the ISP protocol, or something all together different?
yes it is a ISP programming protocol. the "Arduino as ISP" implements only this protocol
Is this all documented somewhere?
this is AVR MCU world, not Arduino. you can google avrdude reference, stk500 reference etc
-
This got it working. How did you know it was the reset?markshancock– markshancock2019年06月04日 14:36:51 +00:00Commented Jun 4, 2019 at 14:36
-
I use "Arduino as ISP" quite often. You could accept the answer to mark the question solved2019年06月04日 15:12:21 +00:00Commented Jun 4, 2019 at 15:12
-
Just recall that the question was not just to solve the immediate issue; but, to know how to trace the symptoms to the cause. If you can add how the symptoms pointed you to the RESET connection then that would be a more complete answer. Also I need to test it with the other test case.markshancock– markshancock2019年06月04日 22:50:42 +00:00Commented Jun 4, 2019 at 22:50
-
the "check the wiring" rule. I enhanced the answer2019年06月05日 05:50:57 +00:00Commented Jun 5, 2019 at 5:50
Explore related questions
See similar questions with these tags.
-c arduino
should be-c avrisp -b 19200