Getting Started with Microcontrollers
Microcontrollers are everywhere, there are dozens in your home: inside your TV, video recorder, fax, answering machine, microwave oven, washing machine, and then there's your car ...
They're used whenever you need something that will:
All of these can be done with digital logic, or timer chips but the elegance of a microcontroller solution is that to make it do something different, you don't have to rewire, just reprogram.
Simple Problem - Multiple Solutions
As a simple example, consider that you need to make a pin do the following:
------- -------- ------ | 1.6ms | 17ms | 43ms | one hour |1.6ms | |________| |_____________|again
You could certain do this with timer chips but how much rewiring would it need to reverse the order (starting at step 5), or changing all the time constants.
Doing it with a Microcontroller
Below is the complete program to generate the above sequence on an AVR micrcontroller - even the baby 8 pin AVR costing a few dollars. The only other parts would be a crystal and a couple of capacitors.
But consider changing the sequence, repeating it 33 times and then stop ...
We're only using one pin of output pins and the micro is spending most of it's time waiting, but
The easiest way to get started is by choosing a microcontroller that:
The are many microcontroller families (the chips are programmed using the same language but have different numbers of I/O lines, times, serial ports ...
PIC or AVR
These are different, some are better for one job, some for another My suggestion is the AVR family - it's fast, inexpensive, has good software support and is widely used. The same can be said of the PIC but there's effort involved in learning how to use any new tool and the BASCOM compiler for the AVR family is the simplest development environment I've found - and the introductory version is FREE.
All rights reserved © 1999-2005 Giovanni Moretti Palmerston North, New Zealand