Pages: [1]   Go Down
Author Topic: Use UNO & ArduinoISP to upload bootloader to ATmega8 using internal 8Mhz clock  (Read 3500 times)
0 Members and 1 Guest are viewing this topic.
Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had a couple of ATmega8A-PU chips laying about that had originally been loaded with a bootloader and the fuses set to use an external 16Mhz crystal. I wanted to change them so they used the internal 8Mhz clock instead as timing accuracy was no longer an issue due to use of external RTC.

I found this http://arduino.cc/en/Tutorial/ArduinoISP tutorial on how to use an UNO to program a bootloader onto breadboard ATmega8 and this blog http://todbot.com/blog/2009/05/26/minimal-arduino-with-atmega8 that had a suitable bootloader for the ATmega8 along with settings that need adding to the Arduino IDE.
After a few false starts with fuse bits being wrongly defined in the settings added from the blog, Arduno IDE refusing to compile sketches for the new 8Mhz board setting & me having to temporarily butcher my arduino clock for it's crystal and capacitors (ATMega8 was originally configured for external 16Mhz crystal and did not seem to run without one) this is what I did.
---
Download atmega8_noxtal.zip from http://todbot.com/blog/2009/05/26/minimal-arduino-with-atmega8 open the zip file and copy it entire atmega8_noxtal folder into the \hardware\arduino\bootloaders folder in the Arduino folder.
---
As I said earlier I had problems with fuse bit settings and compilation errors so instead of using the settings from the blog page use these instead.
Code:
##############################################################

atmega8.name=ATmega8-noxtal @8MHz

atmega8.upload.protocol=arduino
atmega8.upload.maximum_size=7168
atmega8.upload.speed=38400

atmega8.bootloader.low_fuses=0xe4
atmega8.bootloader.high_fuses=0xc2
atmega8.bootloader.path=atmega8_noxtal
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=8000000L
atmega8.build.core=arduino
atmega8.build.variant=standard

In the Arduino directory, there is a file called '/hardware/arduino/boards.txt'. Open that file in a text editor and add the above lines to the end of it. You will need to restart the Arduino IDE before you can see the new board settings.
---
Follow the instructions from the tutorial here http://arduino.cc/en/Tutorial/ArduinoISP on how to load, connect & program the ATmega8. Don't forget the 10uF capacitor across reset/ground on the UNO. The target board should exist as 'ATmega8-noxtal @8MHz'.

After burning the bootloader I disconnected the UNO and connected my FDTI to the breadboard ATmega and tested uploading a simple sketch. And it worked!

Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Pages: [1]   Go Up
Jump to: