Introduction: Standalone Atmega8-16pu With Arduino Optiboot Bootloader

This instructable is made because I experienced various problems to make Atmega8-16pu to run Optiboot Bootloader, so I want to share how I finally can use Atmega8-16pu with Optiboot Bootloader

There are many advantages of using Optiboot Bootloader, including:

1. Larger uploadable sketch size due to bootloader's smaller size.

2. Faster startup (Instant startup vs Arduino NG Bootloader's 8-10seconds startup)

Step 1: Parts & List

You are going to need:

1. Atmega8-16pu (1)

2. 22pF Capacitor (2)

3. 16MHz Crystal (1)

4. Arduino UNO (1)

5. 10K Resistor (1)

6. Jumper Wires

Step 2: Breadboarding

Assemble the components according to the picture above.

At Atmega 8:

Pin 1 > 10K resistor to +5V & Wire to Pin 10 Arduino UNO

Pin 7 > +5V

Pin 8 > Ground

Pin 9 > 22pF Capacitor to ground & Crystal

Pin 10 > 22pF Capacitor to ground & Crystal

Pin 17 > Pin 11 Arduino UNO

Pin 18 > Pin 12 Arduino UNO

Pin 19 > Pin 13 Arduino UNO

Pin 20 > +5V

Pin 22 > Ground

Step 3: Burning the Optiboot Bootloader Using OptiLoader

Download and upload optiLoader sketch to Arduino UNO ( Link: https://github.com/WestfW/OptiLoader )

Open serial monitor and set Baudrate to 19200 with Both NL & CR

Type 'G' if nothing appears in Serial Monitor

The burning process should be started

The finished process should be appears like the second image above

Step 4: Uploading Sketch to Optiboot Burned Atmega8

Plug your Atmega8 to Arduino UNO (Replace the Atmega328)

(or use some kind of FTDI Adapter to program it)

Download and extract Arduino IDE 1.0.5 ( Link: http://arduino.googlecode.com/files/arduino-1.0.5-... )

Open the extracted folder and navigate to \hardware\arduino and open the board.txt file using WordPad (don't use Notepad)

Go to the lowest line and paste this text:

##############################################################
opti8.name=Arduino Optiboot-Atmega8-16

opti8.upload.protocol=arduino

opti8.upload.maximum_size=7680

opti8.upload.speed=115200

opti8.bootloader.low_fuses=0xbf

opti8.bootloader.high_fuses=0xcc

opti8.bootloader.path=optiboot

opti8.bootloader.file=optiboot_atmega8-16.hex

opti8.bootloader.unlock_bits=0x3F

opti8.bootloader.lock_bits=0x0F

opti8.build.mcu=atmega8

opti8.build.f_cpu=16000000L

opti8.build.core=arduino

opti8.build.variant=standard

##############################################################

Save it and run arduino.exe in the root directory of the extracted folder

Choose Arduino Optiboot-Atmega8-16 in Tools>Board

Choose your Serial Port in Tools>Serial Port

You should can upload sketch without any problems. (I tested to upload Blink sketch)

Step 5: Enjoy!

Congratulations!

Your Atmega8-16pu now loaded with Optiboot Bootloader and you can use it just like Atmega328p-pu with instant startup and larger sketch room.

The pin diagram is the same with Atmega328p-pu ( Image from: https://www.instructables.com/file/F2SFHSDH3Z3V3P4/ )

Credits:

Optiboot ( https://code.google.com/p/optiboot/wiki/Installing... )

WestfW's OptiLoader ( https://github.com/WestfW/OptiLoader )

board.txt modification from wkws20's eBay Listing (http://www.ebay.com/itm/3pcs-Arduino-MCU-ATMEGA8-1... )

Step 6: