Programming ATtiny13, Problems...

Hi all, I'm trying to program a ATtiny13A just have a play.
I'm using my good old Mega2560 for programming,

I have given this tut ago, but I'm struggling

With GitHub - tekstop/attiny at Arduino1

*** modified boards.txt [ATtiny13 can be programmed using Arduino as ISP]
*** NOTE: A change has to be made to the wiring.c file in the arduino core for this to work correctly. The wiring.c file has an error where it does not set the correct TIMER for ATTiny13 only. This change will not impact any other boards.

in arduino1/hardware/arduino/cores/arduino/wiring.c

Line 44 should be supplemented with an additional condition for ATtiny13

#if defined(AVR_ATtiny24) || defined(..) ... [Add this] || defined(AVR_ATtiny13)
SIGNAL(TIM0_0VF_vect)
....

Do I need to add this or has it been done? I'm confused.

#if defined(__AVR_ATtiny24__) || defined(..) ... [Add this] || defined(__AVR_ATtiny13__)
SIGNAL(TIM0_0VF_vect)

Pin 9 LED is fading, indicating the program is working.
When I open serial monitor I input

Burn Bootloader > Arduino as ISP

Pin 9 LED stays on, and Pin 8 LED light's up, Pin 7 has remained off.

My wires check out, what can I do to figure out what I have missed or done wrong.

// pin name: not-mega: mega(1280 and 2560)
// slave reset: 10: 53
// MOSI: 11: 51
// MISO: 12: 50
// SCK: 13: 52

Is there anything more I can add to help you guys out to help me?

Cheers.

I have just try'd this,

Choose Tools->Board->Arduino Mega 2560 //The Programming board
Uploaded Sketch Examples->ArduinoISP //The programming software
Choose Tools->Board->Arduino ATtiny13 //The target chip type to be programmed
Choose Tools->Programmer->Arduino as ISP //Tells the IDE to use software programmer
Choose Tools->Burn Bootloader //Uploads the bootloader to the Diecimila (programmer) than burns it to the target

But I get this,

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny13
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Just going to check my wires again.

I had the wires wrong, oops.

I now get this..

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny13
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny13

What does this mean?

It is just a warning that can be ignored.

Did you try the blink sketch?

Erni:
It is just a warning that can be ignored.

Yes, it's the ATTiny equivalent of "success" :slight_smile:

I uploaded "Blink", it works a treat.
Some one needs to write up a good tut for noobs like me, with this one. Lots of pic's... I might give it ago.

I have a guide for Attiny85
http://www.ernstc.dk/arduino/attiny85.html
and attiny2313
http://www.ernstc.dk/arduino/2313.htm

Maybe I should make one for Attiny13. On the other hand you have already done that! :smiley:

Very nice Erni, pictures help so much.
For the Tiny13A wiring.c just needs the string added in below.

|| (__AVR_ATtiny13__)

From this,

#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
SIGNAL(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
#endif

To this,

#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || (__AVR_ATtiny13__)
SIGNAL(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
#endif

When I opened the file up in notepad, it was very tricky to find, all the text run horizontally. It was a nightmare, but if you know what to look out for it's still tricky. In the end I just to used word.
Pasted as (Keep text Only). Oh yes! Be sure to make a copy off the original, if you FUBAR it you can role back with the original!!
My file was located here,

C:\Arduino\arduino-1.0.3\hardware\arduino\cores\arduino

This tut is good, newb's like me will struggle, some parts are vague.. I still don't know what "fuse bytes" are or what they are used for. I had disregard it all but plugged away...

Interesting. It seems that the wiring.C, at least in IDE 1.6.4 is already adapted.
At the same time however, if I use the Attiny13 core from Smeezekitty, it expects TIMER0_OVF_vect instead of TIM0_OVF_vect