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" - datasheet
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|
|From the datasheet|
|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: http://sourceforge.net/projects/ard-core13/
I downloaded the core13_017.zip 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 http://arduino.cc/forum/index.php/topic,89781.0.html with some instructions and the thing to add to boards.txt
attiny13.name=Attiny 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 http://elabz.com/site/ shows the pins arduino names...
// ATMEL ATTINY13 / ARDUINO
// 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
attiny13.build.mcu=attiny13And restarted the IDE once more... and now I can compile and upload!
Its looking like the timer is a bit wrong...