* you've got your arduino with atmega168 and you bought an atmega328 at you local electronics store. It doesn't have an arduino bootloader
* you want to make a project that doesn't use arduino - just a regular AVR chip (like the USBTinyISP) - you have a clean attiny2313/attiny48 etc that you want to burn firmware on.
Normally you would have to have an ISP (In System Programmer) like USBTinyISP to program your new chip. Having the arduino you can teach it to be a programmer thank to a great work done by Randall Bohn. He created Mega-ISP - an arduino sketch that works like a programmer.
Remove these ads by
Signing UpStep 1: What do you need ?
* a chip that you want to program (tested with atmega8,atmega168,atmega368, attiny2313, attiny13)
* a breadboard or a board with ISP header
* 3 leds + 3 resistors
* breadboard wires







































Visit Our Store »
Go Pro Today »




can you help me?
PC doesnt see my programmer. Everything is ok with wiring. I think i did something bad with firmware burning.
As i understood i should insert hex from spi folder only or I should compile makefiles in 1 hex from all folder?
Can u upload hex which you used?
btw great indestrustiabel
Great Instructables, thank you very much for this. very informative. In your poist you mention you could use this method to program attiny13 chips. How do you go about wiring it up? the image you show is an atmega chip i believe which has more pins.
Sorry for the noob question. This is my first attempt at programming a standalone chip!
Any help would be appreciated.
Thank you.
thanks!
Look at the attiny13 datasheet:
http://www.atmel.com/dyn/products/product_card.asp?part_id=3175
On page 2 you've got te pinout for an atmega. You need these signals :
13 - SCK
12 - MISO
11 - MOSI
10 - RST (Reset)
on attiny13 they are on pins::
SCK is pin 7
MISO - pin 6
MOSI - pin 5
RESET - pin 1
GND is pin 4 and VCC pin 8
Connect them like this and you should be ready to go. Look at step 2.
Hope that helps.
ONE FRIGGIN WIRE!!!!!!!!
(sorry)
I spent quite a while at this wondering where i went wrong (followed diagrams to the pin)
I didn't realize the reset resistor was supposed to be pull up, not pull down. Please fix the diagram.
Havne't gotten it working (yet) but made progress :)
Whats your actual problem ?
I used the method in this video:
http://www.youtube.com/watch?v=7LskShrK4vQ
plus I used your tutorial for the actual programmer and stuff.
Using a Pro Mini as the programmer and the Ardunio menu option to burn the bootloader I got an error.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.
I had to drop to a dos prompt and run the command by hand. I copied the hex file and conf file into the dir with avrdude to make things easy.
C:\>avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U flash:w:ATmegaBOOT_168_diecimila.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x1e940b
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_168_diecimila.hex"
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: writing flash (16294 bytes):
Writing | ################################################## | 100% 2.50s
avrdude: 16294 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_diecimila.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_diecimila.hex:
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_diecimila.hex contains 16294 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 22.43s
avrdude: verifying ...
avrdude: 16294 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I still need to test if it worked properly since I only have the pro-mini and some loose 168p chips.
By the way, I omited the external oscilator. So it's not mandatory for these chips.
avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U lfuse:w:0xff:m -U hfuse:w:0xdd:m
If you don't burn any fuses your chip will run at 1mhz. You can tell because 1. The blink program will take 16 seconds to blink the light AND you can't program from the arduino IDE.
If you burn the wrong fuses, you can ruin your chip until you can get it into a high power (12v) programmer, so be sure before you burn fuses.
id = "avrisp";
desc = "Atmel AVR ISP";
baudrate = 115200; # default is 115200
type = stk500;
First of all: Great project :-)
You said, all we need is the chip, 3 leds and 3 resistors (and the arduino of course).
I understand the additional 10kΩ resistor to prevent the chip of resetting, but what are the two capacitors at pin 9 and 10 for? Can I omit them? If I need them, what value should I use for the capacitors?
Bye from Bavaria :-)
Thanks.
the two capacitors are 22p for the crystal oscilator. it will probably work without them but its a good design to include them. You do need the 16mhz oscilator if you're going to program the chip on a breadboard.
If you have a Ceramic oscillator (this one has 3 legs) you don't need them cause ceramic oscilator has them built in.
the 16mhz oscilator (with the 22p caps) and reset resistor is used on the second soon-to-be arduino (Its the minimal number of needed components on an arduino)
Because I get my oscillators not until friday, I tried without the caps and clock crystal, but when I try to test my attiny2313 with avrdude the heartbeat-led freezes and I get an "The programmer is not responding"-error. Same with attiny45 and atmega168...
Do all of the atmel chips (esp: attiny2313 and attiny25/45/85) work with an 16MHz oscillator?
HTH
On the Fritzing-Graphic the Reset-Pin of the ic is connected (over the 10kΩ) to the ground -> the chip is nonstop resetting... Instead it should be pulled high to to the 5V, shouldn't it?
Well I will test it tomorrow and give feedback...
cya
I'll update the drawings when ill be back home
Well I couldn't wait until tomorrow and gues what: I was right :-)! just connect the 10kΩ resistor to 5V instead of ground and everything is working fine!
But thanks to this mistake I learned myself a lot by reading all arduino sites in the web to solve the error ;-)
Sorry if that sounded mean I only wanted to say that to someone.
np. every comment is welcome:)
Nevertheless it looks like the Atmega168 on the bread board is shifted on dot too far to the left.
According to Atmega168 pinout, power should connect to pin 20(AVCC)
SCK to 19 (in your fritzing sketch 20)
MISO to 18 (in your fritzing sketch 20)
MOSI to 17 (in your fritzing sketch 20)
Apart from RESET connecting to pin 1 all the other are shifted as well.
In any case, thanks for the instructable
ex: can i still run the blink sketch after?