What is a Microcontroller?
A microcontroller is a computer. All computers -- whether we are talking about a personal
desktop computer or a large
mainframe computer or a microcontroller -- have several things in common:
- All computers have a CPU
(central processing unit) that executes programs. If you are sitting at
a desktop computer right now reading this article, the CPU in that
machine is executing a program that implements the Web browser that is
displaying this page.
- The CPU loads the program from somewhere. On your desktop machine, the browser program is loaded from the hard disk.
- The computer has some RAM (random-access memory) where it can store "variables."
- And the computer has some input and output devices so it can talk to people. On your desktop machine, the keyboard and mouse are input devices and the monitor and printer are output devices. A hard disk is an I/O device -- it handles both input and output.
The
desktop computer you are using is a "general purpose computer" that can
run any of thousands of programs. Microcontrollers are "special purpose
computers." Microcontrollers do one thing well. There are a number of
other common characteristics that define microcontrollers. If a computer
matches a majority of these characteristics, then you can call it a
"microcontroller":
- Microcontrollers are "embedded"
inside some other device (often a consumer product) so that they can
control the features or actions of the product. Another name for a
microcontroller, therefore, is "embedded controller."
- Microcontrollers are dedicated to one task and run one specific program. The program is stored in ROM (read-only memory) and generally does not change.
- Microcontrollers are often low-power devices.
A desktop computer is almost always plugged into a wall socket and
might consume 50 watts of electricity. A battery-operated
microcontroller might consume 50 milliwatts.
- A microcontroller has a dedicated input device and often (but not always) has a small LED or LCD display for output.
A microcontroller also takes input from the device it is controlling
and controls the device by sending signals to different components in
the device. For example, the microcontroller inside a
TV takes input from the remote control and displays output on the TV screen. The controller controls the channel selector, the speaker system and certain adjustments on the picture tube electronics such as tint and brightness. The engine controller
in a car takes input from sensors such as the oxygen and knock sensors
and controls things like fuel mix and spark plug timing. A microwave oven controller takes input from a keypad, displays output on an LCD display and controls a relay that turns the microwave generator on and off.
- A microcontroller is often small and low cost. The components are chosen to minimize size and to be as inexpensive as possible.
- A microcontroller is often, but not always, ruggedized
in some way. The microcontroller controlling a car's
engine, for example, has to work in temperature extremes that a normal
computer generally cannot handle. A car's microcontroller in Alaska has
to work fine in -30 degree F (-34 C) weather, while the same
microcontroller in Nevada might be operating at 120 degrees F (49 C).
When you add the heat naturally generated by the engine,
the temperature can go as high as 150 or 180 degrees F (65-80 C) in the
engine compartment. On the other hand, a
microcontroller embedded inside a VCR hasn't been ruggedized at all.
.
No comments:
Post a Comment