by William Smith
Microcontroller Fundamentals
As this is my last column, I wanted to finish with a topic I think needs to be covered.
Many of the programming books I’ve read over the years tend to skip over a major concern
for the beginner, which is how a microcontroller works and how to interface other electronics
to it. This final article will cover the fundamentals of working with a microcontroller.
I’ll use on one of my favorites: the Atom Nano.
What is a Microcontroller?
Everybody reading this has probably used a personal computer (PC) run by a microprocessor. The
PC’s central microprocessor has several support items that allow it to function. The memory — where
programs are stored — is known as a hard drive or ROM. The RAM — or temporary memory — is used by
the programs running in the microprocessor. And finally, the interface to the outside world through input
and output control is also known as the BIOS or I/O.
Through the I/O, the PC sends information to either be displayed on a screen or to a printer you send
documents to. The I/O also reads the keyboard and mouse position. Basically, everything the PC does with
a useful purpose to humans runs through the I/O. That describes what a PC is, but what if you could
shrink all those components — microprocessor, ROM, RAM, and I/O — into a single integrated circuit?
Well, that is exactly what a microcontroller is: a miniature computer in a single integrated circuit with
a small amount of ROM and RAM and lots of I/O. Figure 1 shows an Atom Nano microcontroller from
BasicMicro.com. The Atom Nano 18 features the following:
• 15 I/O pins
•7K of program memory
•256 bytes of EEPROM
•Internal oscillator
•Built-in Debugger
•Capture/compare/PWM
•Two Comparators
•Hardware USART
•Synchronous serial port
•Three-wire Serial Peripheral Interface (SPI™)
•I²C™ Interface
•Seven channels of 10-bit analog-to-digital converter
• 32 bit floating point math
• 32 bit integer math
•Over 13,200 Basic instructions per second
Figure 1. Basic Atom Nano 18-pin Interpreter Chip.
If you need more help, I recommend the book Programming the Basic
Atom Microcontroller written by Chuck Hellebuyck. It’s available from the
SERVO webstore at
www.servomagazine.com.
SERVO 12.2009 71