Hardware Reference
In-Depth Information
of the most popular microcontrollers at the time. Today there is much interest in
the AVR architecture because it is at the heart of the very popular open-source
Arduino embedded controller platform.
The AVR architecture is implemented in three classes of microcontrollers, list-
ed in Fig. 1-15. The lowest class, the tinyAVR is designed for the most area-, pow-
er- and cost-constrained applications. It includes an 8-bit CPU, basic digital I/O
support, and analog input support (for example, reading temperature values off a
thermistor). The tinyAVR is so small that its pins work double duty, such that they
can be reprogrammed at run time to any of the digital or analog functions sup-
ported by the microcontroller. The megaAVR, which is found in the popular
Arduino open-source embedded system, also adds serial I/O support, internal
clocks, and programmable analog outputs. The top end of the bottom end is the
AVR XMEGA microcontroller, which also incorporates an accelerator for crypto-
graphic operations plus built-in support for USB interfaces.
Chip
Flash
EEPROM
RAM
Pins
Features
tinyAVR
0.5-16 KB
0-512 B
32-512 B
6-32
Tiny, digital I/O, analog input
megaAVR
8-256 KB
0.5-4 KB
0.25-8 KB 28-100 Many peripherals, analog out
AVR XMEGA
16-256 KB
1-4 KB
2-16 KB
44-100 Crypto acceleration, USB I/O
Figure 1-15. Microcontroller classes in the AVR family.
Along with various additional peripherals, each AVR processor class includes
some additional memory resources. Microcontrollers typically have three types of
memory on board: flash, EEPROM, and RAM. Flash memory is programmable
using an external interface and high voltages, and this is where program code and
data are stored. Flash RAM is nonvolatile, so even if the system is powered down,
the flash memory will remember what was written to it. Like flash, EEPROM is
also nonvolatile, but unlike flash RAM, it can be changed by the program while it
is running. This is the storage in which an embedded system would keep user con-
figuration information, such as whether your alarm clock displays time in 12- or
24-hour format. Finally, the RAM is where program variables will be stored as the
program runs. This memory is volatile, so any value stored here will be lost once
the system loses power. We study volatile and nonvolatile RAM types in detail in
Chap. 2.
The recipe for success in the microcontroller business is to cram into the chip
everything it may possibly need (and the kitchen sink, too, if it can be reduced to a
square millimeter) and then put it into an inexpensive and small package with very
few pins. By integrating lots of features into the microcontroller, it can work for
many applications, and by making it cheap and small, it can serve many form fac-
tors. To get a sense of how many things get packed onto a modern microcontroller,
let's take a look at the peripherals included in the Atmel megaAVR-168:
 
Search WWH ::




Custom Search