Hi, I'm trying to upload sketch to my newly bought Atmega8. I burned OptiLoader Bootloader in my atmega using an Arduino.
In board manager, I installed MCUDUDE's MightyCores boards. There are few boards such as Atmega1284, Atmega644, Atmega324, Atmega164, Atmega32, Atmega16 and Atmega8535. But as I have a Atmega8A microcontroller, there's no name such as Atmega8A or just Atmega8. So, I'm little confused here and thought to ask arduino experienced community.
For trial, I select Atmega8535 with a led blink sketch then I got error as below when uploaded using Arduino ISCP
An error occurred while uploading the sketch
avrdude: Expected signature for ATmega8535 is 1E 93 08
Double check chip, or use -F to override this check.
Please let me if you have gone through this and how you solved!
I installed Minicore and I was able to install bootloader in ATmega8 with Arduino Uno.
But when I tried to upload blink sketch I got below error
avrdude: Expected signature for ATmega8 is 1E 93 07
Double check chip, or use -F to override this check.
Wrong microcontroller found. Did you select the right board from the Tools > Board menu?
It's Atmega8A but I didn't find it in Tools->Variant->
In Preferences, turn on "Show verbose output during: [ ] compilation [X] upload". One of the verbose messages will tell you what signature was received in place of the expected one. A signature of 00 00 00 or FF FF FF generally means the wiring is bad. If you get an ATmega328P signature (1E 95 0F) it means your UNO is resetting and you are talking to the UNO bootloader and not the ArduinoISP sketch. Put a 1uF (or higher) capacitor between Reset (+) and GND (-) on the UNO board to prevent that.
I added 10uF capacitor between ATmega8A RESET Pin and Ground. Uploaded ArduinoISP sketch to arduino. I'm using 16Mhz crystal with 22pf disc capacitor. Connected ISCP connections properly and then selected ATmega8 from Minicore boards. Selected 16Mhz external crystal and finally selected programmer as Arduino as ISP(Minicore).
Compiled blink sketch and uploaded and I got following error with upload verbose ON
Arduino: 1.8.19 (Windows 10), Board: "ATmega8, Yes (UART0), EEPROM retained, BOD 2.7V, LTO enabled, External 16 MHz"
Sketch uses 720 bytes (9%) of program storage space. Maximum is 7680 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 1015 bytes for local variables. Maximum is 1024 bytes.
C:\Users\sunnyg\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude -CC:\Users\sunnyg\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf -v -patmega8 -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\sunnyg\AppData\Local\Temp\arduino_build_862550/df.ino.hex:i
avrdude: Version 6.3-20201216
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\sunnyg\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf"
Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega8
Chip Erase delay : 10000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
efuse 0 0 0 0 no 0 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATmega8 is 1E 93 07
Double check chip, or use -F to override this check.
avrdude done. Thank you.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
So, here AVRDUDE confusing with Atmega8A and the Arduino Programmer itself?
The capacitor goes on the UNO, not on your target. Add the capacitor after the ArduinoISP sketch is loaded.
When avrdude connects to the UNO, a LOW pulse is sent to the Reset pin to give control to the UNO's bootloader. The capacitor is to absorb that pulse so the UNO does not stop the ArduinoISP sketch to give control to the bootloader. The UNO bootloader and the ArduinoISP sketch both speak the same protocol so things don't go wrong until avrdude gets an unexpected signature.
The previous issue is solved and new issue has generated
First I upload ArduinoISP Sketch to arduino. Inserted 10uF capacitor between +Reset and -Ground. Tried to upload my blink sketch and waited for few sec (approx 7 sec uploading) and threw below error.
Arduino: 1.8.19 (Windows 10), Board: "ATmega8, Yes (UART0), EEPROM retained, BOD 2.7V, LTO enabled, External 16 MHz"
Sketch uses 720 bytes (9%) of program storage space. Maximum is 7680 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 1015 bytes for local variables. Maximum is 1024 bytes.
C:\Users\sunnyg\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude -CC:\Users\sunnyg\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf -v -patmega8 -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\sunnyg\AppData\Local\Temp\arduino_build_862550/df.ino.hex:i
avrdude: Version 6.3-20201216
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\sunnyg\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf"
Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe4
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.
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I used to use the printer port in the old days for programing atmega chips. Now I use a USBasp programmer with the Zadig driver and AVRDUDESS to upload sketches.
STK500 is the protocol shared by the Arduino as ISP sketch and the Arduino UNO bootloader. It was created for early AVR ISP devices. STK500V2 is the extended version for larger memory, like the Arduino Mega.
While uploading bootloader to ATmega8A you have to select YES(UART0) from Arduino IDE->Tools->Bootloader->YES(UART0)
There's no point in selecting "Bootloader: Yes (UART0)" if you're not going to use a bootloader for uploading programs. Instead, select "Bootloader: No bootloader" and then click the "Burn Bootloader" button. Now it's only setting the fuse bits, and not writing a bootloader.
I know it can be a bit confusing, but the Arduino IDE doesn't let 3rd party cores like MiniCore to change the label on the "Burn Bootloader" button. It says "Burn Bootloader" regardless of what 3rd part cores configures it to do...