Monday, February 25, 2013



I bought some AVR microcontrollers a while ago, and while I still had the programmer out of its box since burning the ATmega328PUs I wanted to try to program the ATtiny13V. 


The ATtiny13V has:
"– Up to 20 MIPS Througput at 20 MHz
High Endurance Non-volatile Memory segments
– 1K Bytes of In-System Self-programmable Flash program memory
– 64 Bytes EEPROM
– 64 Bytes Internal SRAM
– On-chip Analog Comparator
• Operating Voltage:
– 1.8 - 5.5V for ATtiny13V" -
So as you realize this microcontroller has very little memory and only 1KB of flash memory for your programs... I just got it because its cheap

First thing is to put it on a breadboard, since all my good ones are used in the trilateration project I use this one without any power rails.

ATtiny13V on breadboard
In order to connect it properly I need the datasheet. From that I can see the pinout enabling me to connect it to the programmer.

From the datasheet
So the programming adapter has these nice clearly labeled pinout. So this makes it easy to connect.

Sparkfun programming adapter pinout

To use the Arduino IDE to program the microcontroller we need an Arduino core for it.

A fast googleing lead me here:

I downloaded the unzipped it and placed it in "arduino-1.0.3\hardware\arduino\cores" restarted the IDE. Hm nothing I guess that is since it is not in the "arduino-1.0.3\hardware\arduino\boards.txt"

A little more googleing I find this,89781.0.html with some instructions and the thing to add to boards.txt 13A standalone
I restart the IDE again and now there is a "Attiny 13A standalone" under Tools/Board/

I tried to compile but get error messages that it does not find Arduino.h...

Changed the path of the core to arduino-1.0.3\hardware\arduino\cores\core13

Now I can compile, and changed the blink sketch so that pin 2 is the led pin...

The following taken from shows the pins arduino names...

//                         +-\/-+
// ADC0 (D 5) PB5 1| |8 Vcc
// ADC3 (D 3) PB3 2| |7 PB2 (D 2) ADC1
// ADC2 (D 4) PB4 3| |6 PB1 (D 1) PWM1
//                  GND 4| |5 PB0 (D 0) PWM0
//                         +----+

 When I try to upload to the controller I get the following error

avrdude: AVR Part "attiny13a" not found.
I changed in the boards.txt to
And restarted the IDE once more... and now I can compile and upload!

And behold!

Its looking like the timer is a bit wrong...


  1. The programmed fuses don't match your FCPU which is why the timer is so wrong.
    Note that the fuses in boards.txt are not programmed by default