Skip to content
March 31, 2014 / Karthikeyan Natarajan

Programming Atmega8 using Arduino Uno (Rev3)

I started playing with Arduino Uno recently. I had bought one Atmega8L to make USBASP. But earlier I could not get burn it with Arduino as ISP.

When uploading Bootloader I got the following error.

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x11
avrdude: Send: V [56] @ [40] . [00] . [00]   [20]   [20] 
avrdude: Recv: . [12] 
avrdude: stk500_cmd(): programmer is out of sync

In order to avoid such errors, don’t use the examples>Arduino ISP. Use this file’s content

This is because the Arduino ISP for Arduino Uno will work for 9600 baud rate only.

Today, I started with connecting atmega8 to Arduino Uno with the following diagram


After connection, I chose

Board > Arduino UNO
Programmer > USBasp

Open the downloaded ArduinoISP.ino and Click Upload.

After this, I created a file  /home/karthikeyan/sketchbook/hardware/breadboard/board.txt Optiboot8



Close and open the Arduino IDE. Now choose

Board > Arduino Optiboot8
Programmer > Arduino as ISP

Now you can choose ‘Burn Bootloader’ or open any example and Upload.
This has been tested with Ubuntu. It will work for windows too.

If you want to test with example programs (eg. Blink), open it and choose ‘Upload using Programmer‘.

Advanced understanding:

Note that, the upload protocol is stk500v1 and speed is  9600.
‘arduino:optiboot’ means folder optiboot in /usr/share/arduino/hardware/arduino folder (arduino installed folder).
‘arduino:standard’ means variant standard in arduino installed folder.
If you want to have locally installed variant, bootloaders, cores, remove ‘arduino:’ in board.txt. Create directory structure similar to arduino installed folder at /home/karthikeyan/sketchbook/hardware/breadboard

If you get errors, in Preferences, enable verbose output for upload and check the error.
If you want to burn your own hex file (like usbasp hex file), copy the command used for burning in verbose mode and just change the file name/location.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: