# Unknown Response when using Uno Rev3 as an ISP for burning hex on Atmega8

**URL:** <https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526>\
**Category:** Uploading\
**Created:** [January 22, 2025, 7:43am UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526 "2025-01-22T07:43:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![isitayush](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isitayush/32/1129570_2.png) [@isitayush](https://forum.arduino.cc/u/isitayush)\
**Post date:** [January 22, 2025, 7:43am UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/1 "2025-01-22T07:43:48Z")

</div>

Hi Everyone! I wrote a small blink program for an ATMega8U-DIP I bought recently. The source is this,

```C
#ifndef F_CPU
#define F_CPU 16000000
#endif

#include <avr/io.h>
#include <util/delay.h>

int main(void) {

  DDRB |= (1 << PB0); // Set PB0 as output
  while(1) {
    PORTB ^= (1 << PB0); // Set PB0 high
    _delay_ms(500); // Small delay
  }
}

```

Here are the steps I followed,

1. I compiled the above code to `main.hex` using `avr-gcc` and `avr-objcopy`.
2. I connected my Arduino UNO Rev3 and uploaded the `Examples -> 11. Arduino ISP` sketch onto my board.
3. I disconnected my uno board and connected all the wires according to this schematic,  
 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/9/d/49d5ab2fe2878828dc9f061f4bd46f4beff2b3d9.png)

> At this point, Arduino is connected to my ATMega8U DIP on sitting breadboard and it can program it through SPI.

1. I then tried to upload my `main.hex` file I compiled earlier via ` avrdude -c arduino -p m8 -P /dev/ttyACM0 -b 19200 -U flash:w:main.hex` but I get this response,

```sh
avrdude error: protocol expects OK byte 0x10 but got 0x14

avrdude error: protocol expects sync byte 0x14 but got 0x01
avrdude error: protocol expects sync byte 0x14 but got 0x10
avrdude error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 125kHz
        - use -F to override this check

avrdude error: unknown response=0x12

avrdude done. Thank you.

```

Another thing I tried was to burn Minicore ATMega8 bootloader onto my ATMega8 through Arduino IDE itself with the following steps,

1. Add `https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json` to `File -> Preferences -> Additional Board Managers`
2. Install MiniCore boards from `Board Manager`.
3. I used the exact same circuit & sketch as the previous attempt with `avrdude`.
4. I selected `Tools -> Boards -> Minicore -> ATMega8` on Arduino IDE. The port is `/dev/ttyACM0`.
5. I selected `Tools -> Programmer -> Arduino as ISP`.
6. I then clicked on `Tools -> Burn bootloader` but I got this error in IDE output,

```sh
Error: invalid device signature
Error: expected signature for ATmega8 is 1E 93 07
  - double check connections and try again, or use -F to carry on regardless
Failed chip erase: uploading error: exit status 1

```

I have two questions,

1. Am I doing something wrong or Am I missing a step?
2. How do I get the AVR code I've compiled onto my ATMega8 sitting on breadboard with Arduino acting as an ISP?

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [January 22, 2025, 10:59pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/2 "2025-01-22T22:59:44Z")

</div>

You have D10 on the Arduino connected to the wrong side of the reset resistor on your target. It should go direct to the reset pin, with the 10k resistor acting as a pullup.

---

<div class="post-metadata">

**Author:** ![isitayush](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isitayush/32/1129570_2.png) [@isitayush](https://forum.arduino.cc/u/isitayush)\
**Post date:** [January 23, 2025, 6:17am UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/3 "2025-01-23T06:17:15Z")

</div>

This is the new schematic,

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/c/0/9/c09c852da0b519609bab577a7983d402ae5d1d24.png)

The uno rev3 is runing the `Examples -> 11. Arduino ISP` sketch and I still the get the same errors when I click "Burn Bootloader" even after the D10 change,

```sh
Error: invalid device signature
Error: expected signature for ATmega8 is 1E 93 07
  - double check connections and try again, or use -F to carry on regardless
Failed chip erase: uploading error: exit status 1

```

Here's the screenshot of IDE and the options I've selected,

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/c/e/a/ceadc6c563141fea3f23401aee42750514ad631e.png)e  
 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/7/a/8/7a89a7bd169b8c56166938d5853ffd1a7ac75d6e.png)  
Trying this with avrdude results in,

```sh
➜ avr-test git:(master) ✗ avrdude -c arduino -p m8 -P /dev/ttyACM0 -b 19200 -U flash:w:main.hex

avrdude error: protocol expects OK byte 0x10 but got 0x14

avrdude error: protocol expects sync byte 0x14 but got 0x01
avrdude error: protocol expects sync byte 0x14 but got 0x10
avrdude error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 125kHz
        - use -F to override this check

avrdude error: unknown response=0x12

avrdude done. Thank you.

```

---

<div class="post-metadata">

**Author:** ![isitayush](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isitayush/32/1129570_2.png) [@isitayush](https://forum.arduino.cc/u/isitayush)\
**Post date:** [January 23, 2025, 10:27am UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/4 "2025-01-23T10:27:16Z")

</div>

Update: I retried all the pins and I can burn the bootloader now via `Tools -> Burn Bootloader` option. I think it was the pins. I still can't do it via `avrdude` CLI as I'm don't what command Arduino IDE executes for burning bootloader to my ATMega8 flash.

Before I close this, Can you tell me how I can get the C code I wrote onto the ATMega8 mcu after the MiniCore ATMega8 bootloader burn stage? I don't really have any adapters (FTDI, USBASP etc.) lying around so is it possible to do just via my Uno Rev3 board acting as ISP once again (in a similar process to earlier)? I've already compiled the code below to `main.hex`,

```C
#ifndef F_CPU
#define F_CPU 16000000
#endif

#include <avr/io.h>
#include <util/delay.h>

void toggle_led() {
  // enable PB0 (14) as output
  DDRB |= (1 << PB0);
  while(1) {
    // switch between high low
    PORTB ^= (1 << PB0);
    _delay_ms(500);
  }
}

int main(void) {
  toggle_led();
  return 0;
}

```

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 23, 2025, 12:07pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/5 "2025-01-23T12:07:49Z")

</div>

> [@isitayush](#):
>
> I still can't do it via `avrdude` CLI as I'm don't what command Arduino IDE executes for burning bootloader to my ATMega8 flash.

Enable _verbose output during upload_ under _File → Preferences_; you will see the exact command that is issued for the burning of the boot loader.

> [@isitayush](#):
>
> Can you tell me how I can get the C code I wrote onto the ATMega8 mcu after the MiniCore ATMega8 bootloader burn stage?

You can use the menu _Sketch → Upload Using Programmer_ and use the programmer.

---

<div class="post-metadata">

**Author:** ![isitayush](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isitayush/32/1129570_2.png) [@isitayush](https://forum.arduino.cc/u/isitayush)\
**Post date:** [January 23, 2025, 1:25pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/6 "2025-01-23T13:25:13Z")

</div>

Thank you so much! I was able to flash my code by erasing the mcu and then flashing my hex file by copying the custom commands ran by IDE. It works & the led blinks! May I ask you how do I know if I need a bootloader to run my compiled hex code?

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 23, 2025, 1:32pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/7 "2025-01-23T13:32:54Z")

</div>

You don't need a boot loader. There are two reasons for burning the boot loader

1. It's an easy way to set the fuses. But you can do that "manually" as well.
2. To be able to upload code over serial.

---

<div class="post-metadata">

**Author:** ![isitayush](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isitayush/32/1129570_2.png) [@isitayush](https://forum.arduino.cc/u/isitayush)\
**Post date:** [January 23, 2025, 1:50pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/8 "2025-01-23T13:50:17Z")

</div>

> 1. It's an easy way to set the fuses. But you can do that "manually" as well.

How do one know what fuse they have to set? I can see there are couple of actions one can perform which I think might have their own fuses. Actions such as erasing flash, eeprom and writing to them. Do you know a place where can I read more about these fuses especially the one's related to actions on my microcontroller (i.e. an atmega8a)?

For example, this is the avrdude command I ran for erasing flash that includes fuses: `avrdude -v -p atmega8 -c stk500v1 -P /dev/ttyACM0 -b 19200 -e -U lock:w:0xff:m -U efuse:w:{bootloader.extended_fuses}:m -U hfuse:w:0b11000111:m -U lfuse:w:0b10111111:m`

I then used this one to write my `main.hex` which also includes fuses: ` avrdude -v -p atmega8 -c stk500v1 -P /dev/ttyACM0 -b 19200 -U flash:w:main.hex:i -U lock:w:0xff:m`

> 1. To be able to upload code over serial.

I think I understand it now. Thank you once again!

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 23, 2025, 1:52pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/9 "2025-01-23T13:52:51Z")

</div>

> [@isitayush](#):
>
> Do you know a place where can I read more about these fuses especially the one's related to actions on my microcontroller (i.e. an atmega8a)?

The datasheet of the microcontroller.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 23, 2025, 3:00pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/10 "2025-01-23T15:00:13Z")

</div>

This is a useful tool when working directly with fuses:

> **[AVR Fuse Calculator for ATmega8](https://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega8)**
>
> A javascript web-based Atmel AVR microcontroller fuse calculator tool. Apply chip features to see fuse bit settings or apply fuse bit settings to match against known features.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 22, 2025, 3:00pm UTC](https://forum.arduino.cc/t/unknown-response-when-using-uno-rev3-as-an-isp-for-burning-hex-on-atmega8/1345526/11 "2025-07-22T15:00:33Z")

</div>

Closed on July 22, 2025, 3:00pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
