Help understanding how avrdude works with ArduinoISP and why its not working for me 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?
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.



  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