What is a
microcontroller?
It is essentially a small computer. A
comparison of a typical microcontroller with a typical desktop is shown in the
following table:
Atmega16
|
Typical Desktop
|
|
Clock frequency
|
16MHz
|
3GHz
|
CPU Data size
|
8 bits
|
32 bits
|
RAM
|
1kB
|
1GB
|
ROM
|
16kB
|
160GB
|
I/O
|
32 pins
|
Keyboard, monitor
|
Power Consumption
|
20mW
|
65W
|
Why use a microcontroller?
§ It is
programmable. It is fun!
§ A code
(typically written in C) decides what it does
§ Easier to
write a code than design and make a custom circuit for complex jobs
§ e.g. In a
micro-mouse, a single microcontroller controls the motors, finds distance from
the walls, explores and solves the maze
§ The same
microcontroller can be used in hundreds of applications
§ A glimpse
of the overwhelming potential of a chip as small as a microcontroller can be
seen on the Cornell
Website that
documents hundreds of projects on based on AVR Microcontrollers alone!
The AVR Microcontroller
There are plenty of
microcontroller families available, each having its own special feature or
convenience. However, in general, all microcontroller families have certain
common features like a Serial Communication unit, and ADC (Analog to Digital
Unit), general purpose Port pins etc. Commonly used microcontroller families
are - 8051, PIC, AVR, MSP430, ARM etc.
A very useful guide on how to
choose a microcontroller can be found on this Instructable.
In this section, we discuss and demonstrate the usage of AVR Microcontrolles.
Why AVR? They are cheap, extremely easy to use, fast and have loads of cool
features.
Typical features of ATMega16
Typical features of ATMega16, an
AVR Family Microcontroller are:
§ 16 KB
Flash memory
§ 1 KB of
SRAM
§ Up to 16
MHz clock
§ Four
8-bit I/O ports
§ ADC,
Timers, Serial Interface etc
§ 40 pin
DIP, operates at 5V