Using an arduino as a AVR Programmer
I managed to use an arduino as an isp programmer for my ATTiny13. I first i tried to use the avr910 program described in this blogpost from Randall Bohn, but avrdude could not flash my hex file :-/
then i found a newer version of the code that emulates an avrisp at googlecode
To make use of the programm place your attiny13 on a breadboard and connect the +5V and The ground from the arduino to it. Add a small condensator between the VCC and the GND pin.
Then add a wire from pin 10 (arduino) to the RST pin (pin 1 of the attiny)
connect pin 11 (arduino) to pin 5 (MOSI attiny13) connect pin 12 (arduino) to pin 6 (MISO attiny13) connect pin 13 (arduino) to pin 7 (SCK attiny13)
then add a led and a resistor to pin 9 of the arduino (this shows if the program is running)
When everything is running upload the pde from the google-code link to your arduino.
copy the following code to a file named test.c
#include <avr/io.h>
#define F_CPU 1000000UL
#include <util/delay.h>
int main(void) {
int n;
DDRB |= ( 1 << 4 );
while (1) {
PORTB &= ~(1 << 4 );
_delay_ms(1000);
PORTB |= ( 1 << 4 );
_delay_ms(1000);
}
return 0;
}
This program makes a led on pin 4 blink every second.
Compile and link the program and convert it to a hex file
avr-gcc -g -Os -c -mmcu=attiny13 test.c
avr-gcc -mmcu=attiny13 test.o -o test.elf
avr-objcopy -O ihex -R .eeprom test.elf test.hex
and finally write it to the ATTiny13
avrdude -P /dev/ttyUSB2 -p t13 -c avrisp -b 19200 -U test.hex
now connect a led with a pull up resistor to PB4 and enjoy the blinkenlights :-)
See also:
YesNoBot
from now on you shalt be called miditron
Midified Monotron first track
RadioPI - debugging
Sweet! I've been wanting to do this but the other approaches I've seen were based on creating a shield. I knew there had to be an easier way.
Just wanted to say thank you for this great note. I tried it with an ATTINY13V-10SU and it worked perfectly. On Windows I used -P COM3 instead of -P /dev/ttyUSB2
I've built a shield for this to make it easier to burn ATtiny's. I've got a couple of ATtiny25's and 2313, I know the 2313 will work according to some other doc's, but do you know if the 25 will work ?
I haven't tried a ATtiny25/45 yet, but they use the same pin layout as the attiny13 chips and as far as i can see from the specs i think they should work.
With Attiny13, i am getting the error define PAGEL and BS2, looking for some help here.
Nice. Got tiny13 working on a breadboard - a simple shield is next. Latest ArduinoISP file adds useful Err and Tx indicator signals on pins 7 & 8. WinAVR version of avrdude worked better than the one with Arduino IDE. Thanks.
Nice !!! but for the tiny13 it`s possible to program it with 3 simple resistors (dasa) I think thats much esier if your arduinos are in use for other projects XD
I just could not depart your site before suggesting that I extremely enjoyed the standard info a person provide to your guests? Is gonna be back often to investigate cross-check new posts
Wow, marvelous blog format! How lengthy have you ever been blogging for? you make running a blog glance easy. The entire glance of your site is excellent, let alone the content material!
Thanks for some other informative web site. The place else may I am getting that kind of info written in such an ideal manner? I have a challenge that I'm simply now running on, and I've been at the look out for such information.