Programming the
54¢ MICRO
A Device Programmer and a Few Example
Programs are All You Need to Start
ATTINY11
FEATURES AND A
“PROBLEM”
The ATtiny11 is from the family of Atmel’s
AVR RISC (reduced instruction set computer)
microcontroller series. It is available in either an
eight-pin DIP or SOIC package. Either way, the
pinout is the same and is shown in Figure 1.
Other than the Vcc, RESET, and GND pins, it
offers a maximum of five digital I/O pins — PB0-
PB4 —including two analog inputs (PB0 and
PB1).
To release the XTAL1(PB3) and XTAL2(PB4)
pins for I/O use, you will need to use the internal
1 MHz RC oscillator as a clock source. For most
projects, this is fine and you won’t have to add an
external crystal. But keep in mind that the RC
oscillator frequency is less accurate, and is both
Vcc and temperature dependent. If you need precise timing, you will have to use a crystal.
PB1 can also act as an external interrupt
(INT0) pin and PB2 can act as a timer interrupt
(T0) pin. The chip has an interrupt handling
mechanism, and its eight-bit timer can be used
as a timer/counter in response to external or
internal events.
➥ by G. Y. Xu
The ATtiny11 has 1K bytes of Flash program
memory, and just as the other AVR micros,
it contains 32 general-purpose eight-bit wide
registers named R0-R31.
These resources make it a powerful MCU. It
may seem that the 1K of program space isn’t big
enough, but in many cases, it’s sufficient.
However, when it comes to the method used to
program the Flash memory, the situation is
different than other AVRs — and it presents a
unique problem.
For most other AVR MCUs, there is an SPI
(serial peripheral interface) port built in and it is
used for Flash programming with a single 5V
➥ Figure 1. ATtiny11 pinout diagram.
We all know that a microcontroller (MCU) is much
more complicated than a single TTL logic IC, such as
the 7400-series gates. And so it’s no surprise that an MCU
was much more expensive than a chip of “glue logic.” But
things have changed recently. MCU prices are falling into the
same range as TTL gates. Beginning this year, one of Atmel’s eight-bit
tiny MCUs, the ATtiny11, can be purchased for 54 cents — and even less if
you buy a hundred of them!
This is a great boon to both experimenters or developers. In this article, I’ll show you how to take
advantage of it. First, you’ll need to know what resources this chip has, and then how you can do
something useful with it.
February 2006 61