Help regarding Atmega8

Hello!!
I hope everyone is doing great!!
I need Help Regarding Atmega8 programming.
I have recently shifted from atmega328p to atmega8.
I have successfully managed to upload my code in atmega8(DIP) but while uploading the same code in atmega8(SMD)(Facing such kind of issue first time), I am getting invalid signature error.

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 not changed connections. I am using ISP to upload code in my atmega.
What could be the reason??
Any help will be appreciated. Thanks in advance

Post the complete error. We cannot see what signature was read from the chip.

Also post close-up, bright, clear photos of the DIP and SMD chips so we can read the codes printed on the chips.

Hey Paul,
Thanks for the reply.
This is the complete error, I am getting. I have attached the images. Please check


Hi @rnd. I'm going to ask you to provide the full verbose output from an upload attempt.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compile in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see an "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a reply here on this forum topic by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to publish the post.
Avrdude version 8.0-arduino.1
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is C:\Users\Admin\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\8.0-arduino.1\etc\avrdude.conf

Using port            : COM5
Using programmer      : stk500v1
Setting baud rate     : 19200
AVR part              : ATmega8
Programming modes     : SPM, ISP, HVPP
Programmer type       : STK500
Description           : Atmel STK500 v1
HW Version            : 2
FW Version            : 1.18
Topcard               : Unknown
Vtarget               : 0.0 V
Varef                 : 0.0 V
Oscillator            : Off
SCK period            : 0.0 us
XTAL frequency        : 7.372800 MHz

AVR device initialized and ready to accept instructions
Device signature = FF 00 00
Error: expected signature for ATmega8 is 1E 93 07
  - double check chip or use -F to carry on regardless

Avrdude done.  Thank you.
Failed chip erase: uploading error: exit status 1

Hey ptillisch
Thank you for your reply. I have posted the complete error i can see chip signature is something else. Is that the reason??

I've had some similar error messages in an ATtiny13A project once. One set programmed without issues, while another set (from a different supplier) gave errors.
Eventually what worked for me was to do a high voltage fuse reset. I suspect the second set to be reclaimed chips that were programmed to use an external clock. Doing the fuse reset made them responsive to the programmer.

Hello Maxint-RD,

Thanks for your reply. This is the most basic—but important—thing I should have done earlier, and I truly appreciate your guidance.

I replaced the IC (taken from a different lot), and the good news is that the code was successfully uploaded. It seems the issue might have been due to a manufacturing defect or possibly because the chips from the first lot were configured to use an external clock.

Looking back, I realize I should have verified this much earlier—it would have saved a lot of time and effort. Lesson learned.

Could you please guide me on how to perform a fuse reset? As I have read they are very hard to reset. I’d like to try recovering those chips if possible. If I can reset the fuses, I might still be able to use them elsewhere.

Thank you once again for your support!

This error means the programmer expected the ATmega8 signature (0x1E9307), but got something else (either garbage or a valid but different signature). Use a multimeter to check continuity: VCC to VCC pin, GND to GND, MOSI/MISO/SCK/RESET all properly connected.

Hello ahsrabrifat,
Thank you for your reply.
I have check every basic things like you mentioned VCC/VCC GND/GND mosi miso sck everythings alright. Thats why i raised the issue on the forum.

I didn't find it very hard. For the fuse resetting I used a regular Arduino Uno clone with some extra bits. I just googled for "avr fuse restter" and found a few sketches, I don't quite remember which one worked best for me (can't find it right now). In this post by Nick Gammon you can find some background info and different sketched to try out.

As for the hardware required, the page with the fuse resetter gave some guidance. You can also google for "high voltage programmer". Basically you need something to provide 12V plus a transistor to switch that high voltage to the reset pin of the target chip.

For that 12V I used a boost converter, but you can also use batteries or an external supply. Just make sure to connect the GND of the 12V-supply to the GND of the Uno and be careful not to accidentally connect the +12 to anything else.

The Arduino sketch I used was easy to use. It supported many different Atmel chips including my ATtiny13A. It gave a serial prompt that allowed me to view the current fuse settings and to reset the fuses to their default.

To understand the meaning of the original and the default fuse settings, I think I used this fuse calculator.

Okay thank you maxint-rd. What i did is i added 16MHz on XTAL1 and XTAL2 and i kept clock frequency at 16MHZ external crystal and bootloader was successfully installed in my first lot atmega8. Now i can use those ICs in my product.
Thank you very much for your reply. Appreciate it!!

Excellent creative solution! Congratulations. Good confirmation that that they only had an external crystal set. If it was a different fuse setting (such as the reset pin disabled), high voltage fuse reset could be the only way to rescue them.