This is for all who are having problems in burning the Arduino Bootloader on an Atmega8 or any other Atmega Processor using a Arduino Board like Arduino Uno.
-
The processor for the first time burning will have to be used with an external oscillator. I was trying without the external oscillator (was depending on the internal oscillator - setup the fuses also properly) and was banging my head.
-
The Arduino Uno (or any other board that you are using) will have to be burned with the ArduinoISP code. (Files -> Examples -> ArduinoISP -> ArduinoISP)
-
Don't bother about the Chip Configurations (and/or binary) that are available on the net, especially if you are looking to use the external oscillator. None works properly.Find a board from the existing list that uses the same Processor.
-
For Atmega8 use the "Arduino NG or older" from the boards list. That board should also work for Atmega168
-
If you are using a 8MHZ crystal then open the "boards.txt" files under "Program Files (x86)\Arduino\hardware\arduino\avr". And edit the "atmegang.build.f_cpu". Change it to "8000000L".
-
If you will be using the Internal Oscillator then you will have to change the fuse values to proper ones in the above board configuration.
-
I had problems with high bitrate while burning. So I changed it to "9600" (atmegang.upload.speed=9600).
-
After you are done with the configurations and connections use the option "Burn Bootloader" under Tools in the Arduino IDE
I also found tutorials where it was suggested to remove the processor from board (UNO board) which is being used as programmer. Don’t do that.
Putting the chip in an UNO board didn’t work for me. I don’t know why but it didn’t.
What I found is the Atmega8 works best with the external oscillator. With an internal oscillator I was having problems after running the chip continuously for quite some time.
The connections with an Arduino UNO ------------------ -------------------------- Arduino Uno Atmega 8 or other ------------------ -------------------------- 10 Reset (1 on Atmega8) 11 MOSI (17 on Atmega8) 12 MISO (18 on Atmega8) 13 SCLK (19 on Atmega8) And the AVCC pin should be externally connected to VCC, even if the ADC is not used.
And like many suggested on the Internet already, a standalone programmer is the best. I got a USBasp from eBay.
And I guess it is better to invest in a 328p processor due to limited resource of Atmega8 chip. More or less same price.
Atmega8 IC can be used as standalone IC, that is without using the whole Arduino board. Please see this article for details : Using Atmega8 or Atmega328p directly without using Arduino boards and Atmega8 to Arduino pin mapping
2 thoughts on “Burning Arduino Bootloader to Atmega8 or other Atmega”