January 2011 workshop report on programming ATTiny13

On January 14, 2011, we had a workshop on programming Atmel ATTiny13 chips. The ATTiny13 is an 8 pin microcontroller that can do a lot, and costs about $2 in low volume. The workshop was conducted by Dale Wheat and he did an excellent job. Dale’s guide is available here.(VeryTinyDevelopment). This is just my notes. They don’t give all the nice detail Dale had. They are intended to add some information that I think might help on our future projects. Since the February 2011 project will use the same programmer we learned about this month, but use the ATTiny45 or the ATTiny85, I will show where the differences matter to us.

Dale found some inexpensive chip programmers for AVR chips. They are compatible with the Atmel AVRISP mkii and cost about $10 each. Here is a picture of one.
Clone of Atmel AVRISP mk ii

To connect the programmer to the breadboard containing the ATTiny, we use a breakout board developed by Dale and a 10 pin ribbon cable. Here is a picture of a breadboard with the board plugged in with an ATTiny chip in it.
Board to connect ribbon cable for programming 8 pin ATTiny on breadboard

Dale had a nice exercise that showed us how to program the chip and run a program to blink 1 to 4 LEDs. Here is what the populated breadboard looked like.
breadboard with 4 LEDs and Dales breakout which goes to AVRISP mk ii

Resources:
Datasheet on Atmel ATTiny 25/45/85
http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf

Datasheet on Atmel ATTiny 13/13V
http://www.atmel.com/dyn/resources/prod_documents/doc2535.pdf

Important differences between ATTiny13a and ATTiny85
1. ATTiny85 has more memory
2. ATTiny85 pin 2, 3 have added function of XTAL and OC1B
3. ATTiny85 pin 5, 6, 7 have slightly different functions
4. AtTiny85 has a superset of the machine instruction set of ATTiny13a
5. memory(flash/eeprom/sram) AtTiny13 1K/64/64 ATTiny85 8K/512/512
6. sample compile options for ATTiny13a/ATTiny45/ATTiny85
avr-gcc -mmcu=attiny13a blink.c -o blink.o
avr-gcc -mmcu=attiny45 blink.c -o blink.o
avr-gcc -mmcu=attiny85 blink.c -o blink.o
7. sample program upload options for ATTiny13a/ATTiny45/ATTiny85
sudo avrdude -p attiny13 -c avrispmkii -P usb -U flash:w:blink.hex
sudo avrdude -p attiny45 -c avrispmkii -P usb -U flash:w:blink.hex
sudo avrdude -p attiny85 -c avrispmkii -P usb -U flash:w:blink.hex

To find out which AVR chips your compiler and assembler support, type
avr-as –help

Information to add. Someone in the group found a nice way to avoid having to upload the program using sudo. Document that here.

Tags »

Author:
Date: Tuesday, 8. February 2011 1:36
Trackback: Trackback-URL Category: Uncategorized

Feed for the post RSS 2.0 Comment this post

Submit comment