I would like to replace the ATmega328 from my arduino uno with an ATmega8. Is this possible? The one catch is that I do not have the ATmega328 to use as an ISP programmer (well, I do but it’s busy). However I do have a home-built USBasp and a target board for my ATmega8, which I can program using XtremeBurner.
Why, you ask? I can’t get hold of a replacement ATmega328, so I want to use my spare ATmega8. I want to use it in the Uno board to make use of the serial terminal (for debugging).
I have tried loading various bootloaders via the USBasp and then putting the ATmega8 into the Uno board. But when I try to program it via the Arduino IDE, it says it can’t communicate with the board. I’m not sure what board and other settings to choose.
I have many questions:
Which bootloader should I use? There are a bunch in the Arduino IDE sub folders.
Am I right to simply burn the bootloader .hex file with the USBasp?
Do I need to set the ATmega8 to use an internal clock (via the fuse bits)? I think it can only go up to 8MHz but the Uno board has a 16MHz oscillator…
What ‘Board’ and ‘programmer’ etc do I select in the Arduino IDE?
I added the MiniCore package and tried burning the bootloader (via Arduino IDE v1.8.19), with the atmega8 in my target board and my home-built USBasp. The options I selected were
Board: MiniCore > ATmega8
Clock: Internal 8MHz (I also tried 4MHz and 2MHz)
Programmer: USBasp (MiniCore) and also USBasp slow (MiniCore) with jumper inserted.
I always got the same error:
avrdude: Warning: cannot query manufacturer for device: No such file or directory
avrdude: Warning: cannot query product for device: No such file or directory
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
avrdude done. Thank you.
Error while burning bootloader.
So I'm thinking there is something weird with arduino IDE talking to my USBasp. So instead I downloaded the Minicore package and found the bootloader file: optiboot_flash_atmega8_UART0_115200_8000000L_B5.hex and loaded this via my USBasp and Xtremeburner. The write operation was fine. I then put the ATmega8 into the arduino Uno, but I cant seem to upload any sketches. I am using the blinker sketch from the example library and using the following settings:
I just tried what you did by plugging a Atmega8 in my Uno and then I burned the (minicore) bootloader via a USBASP connected to the 6 pin ICSP header on the UNO board.
That worked flawless, so the first thing I would do if I were you is try out a different USB driver for your USBASP
The driver that works for me is the libusbK (my current driver). When you check I suspect you have the WinUSB driver, that sometimes gives me trouble recognizing the USBASP.
When playing a bit with the AT8 UNO I noticed that after I upload a (blink ) test sketch via the bootloader I could not re-use the ICSP header to program via USBASP. I got the exact same error you had.
I just wanted to reply to say thanks for your help! I got distracted after your last post and I never actually got back to this, but soon I should have some time again.
Just didn't want your effort to seem unappreciated - it very much is!