Go Down

Topic: Programming ATtiny13, Problems... (Read 1 time) previous topic - next topic

TronSR

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
http://tekstop.wordpress.com/2011/12/30/programming-attiny13-using-arduino-isp-and-all-the-hacking-involved/
With https://github.com/tekstop/attiny/tree/Arduino1

Quote
*** 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.

Code: [Select]
#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
Quote
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.
Quote
// 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.

TronSR

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,

Code: [Select]
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. 

TronSR

I had the wires wrong, oops.

I now get this..

Code: [Select]
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?

Erni

It is just a warning that can be ignored.

Did you try the blink sketch?

strykeroz


It is just a warning that can be ignored.
Yes, it's the ATTiny equivalent of "success" :)
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

TronSR

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.

Erni

#6
Jan 22, 2013, 01:13 pm Last Edit: Jan 22, 2013, 01:29 pm by Erni Reason: 1
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!  :D

TronSR

Very nice Erni, pictures help so much.
For the Tiny13A wiring.c just needs the string added in below.
Code: [Select]
|| (__AVR_ATtiny13__)

From this,
Code: [Select]
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
SIGNAL(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
#endif


To this,
Code: [Select]
#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,
Quote
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...
http://tekstop.wordpress.com/2011/12/30/programming-attiny13-using-arduino-isp-and-all-the-hacking-involved/

Go Up