Programming Attiny85 & ATtiny13

30 views
Skip to first unread message

萨克森气势

unread,
May 6, 2012, 1:32:44 PM5/6/12
to xinch...@googlegroups.com
I got all recently ordered ATtiny85 and ATMega328 programmed. I was finding some tutorial to program the ATtiny13 as well but before I do it I want to ask, if somebody already successful did it.
The hardware setup should be the same like for the ATtiny85 but just some changes in two files have to be done....so far I understood.

~Lutz

ourstuff888

unread,
May 6, 2012, 10:09:10 PM5/6/12
to xinch...@googlegroups.com

"hardware setup should be the same like for the ATtiny85" - if you mean ISP programming then yes, but the pin numbers change.

ISP signal

ISP
6 pin

AtTiny

85

ATtiny
2313

ATmega
328P

Arduino board
Con. pin

GND

6

4

10

8, 22

8

Vcc

2

8

20

7, 20

7

RESET

5

1

1

1

Reset

MOSI

4

5

17

17 (PB3)

11

MISO

1

6

18

18 (PB4)

12

SCK

3

7

19

19 (PB5)

13



"just some changes in two files" - do you mean when writing code burning the program via the in Arduino GUI? If so, then yes there are probably two files to modify, but there are also a lot of files to add!

Most comprehensive (for many AtTiny) project, that I know of, is here http://code.google.com/p/arduino-tiny/, and another one with good info (but not on 2313) is http://hlt.media.mit.edu/?p=1695.

The install info in the readme for the arduino-tiny project is out of date as it only refers to one Attiny, where the code now includes many more.  Just upack ALL files into the ...\Arduino\hardware directory. 

Previously I had success programming an Attiny 85, but today with the latest version of this library for 85 & 2313, I can't get past a compile error:I have also got as far as reading the Attiny2313As I have via ISP programmer. So will have to look further (anyone got any ideas?)

In file included from /usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:44:0,
                 from /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/delay.h:37,
                 from /home/bf/Desktop/arduino-0022/hardware/arduino/cores/arduino/wiring_private.h:30,
                 from /home/bf/Desktop/arduino-0022/hardware/arduino/cores/arduino/WInterrupts.c:34:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected identifier or '(' before 'double'
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected ')' before '>=' token


Using the Arduino system to program AtTiny's will be a quick way to get started, but I think we will need to take steps to "trim the fat" to fit all the code we need in, for example:-

  • remove unnecessary Arduino libraries (not sure if this can be done or how easy/hard it would be)
  • switch to C and use AVR libraries - not so hard once you have used Arduino and start with some examples - eg http://www.roxlu.com/blog/entry/59/attiny2313avrdude-and-arduino-avrisp
  • assembler - a bit more effort getting up to speed, but again not too hard - especially with examples ( I assume - as I have not done assembler for 30+ years!)

Spencer

ourstuff888

unread,
May 6, 2012, 10:56:24 PM5/6/12
to xinch...@googlegroups.com
... now have successfully programmed a blinking LED on AtTiny2313A via Arduino GUI - I switched to a fresh built Windows XP box and fresh Arduino install - worked first time!

萨克森气势

unread,
May 6, 2012, 11:11:56 PM5/6/12
to xinch...@googlegroups.com
Thanks Spencer, will try it as soon as I get the chance.
To program the ATtiny85 was not a problem since I already have a shield build for that one.

Next will be the breadboard test of the ATiniy13 and 2313.

~Lutz


2012/5/7 ourstuff888 <ourst...@gmail.com>
Reply all
Reply to author
Forward
0 new messages