9.1 Computer vs Microcontroller
Computers. Everyone is familiar with the use of a general purpose computer (eg, a laptop), a simplified block diagram of which is shown below.
A computer is comprised of a central processing unit (CPU) as well as storage: mass storage for programs and other content, volatile RAM for storing information needed by the CPU during program operation, and ROM for booting the computer. The RAM is volatile, meaning that its contents are emptied when the computer is shut off, whereas the ROM is non-volatile: memory contents are permanently placed into ROM so that they are available to provide boot-up instructions on power-up. The I/O block contains familiar devices that allow the user to interact with the computer.
Consider the physical space, weight, and power requirements for any computer: the CPU is a single IC chip, which, along with ROM, RAM, and other devices, is installed on a mother-board (circuit board). The other devices are either integrated within the housing, as in a laptop, or are arranged as desk-top peripherals. Current laptops typically weigh 1-2 kg and occupy volumes of, perhaps, 30 cm x 30 cm x 2 cm ~ 2000 cm3. Laptops are powered by internal rechargeable batteries with typical capacity of 2800 mAh at 14 V, and these batteries are charged using AC adapters that consume ~ 80 W (80 J/s). Laptops typically cost ~ $1000 – $2000.
A microcontroller, or microcontroller unit (MCU) is a small, low-power computer with CPU, memory, and I/O all integrated on single integrated circuit chip. The chip is typically installed on a printed circuit board along with power supply and arrangement of sensors and actuators to form an embedded control system. Such a circuit might draw only a few mA of current, and hence consume energy at a few mJ/s when operated at a voltage level of 5V. The circuit, with power supply and packaging might be smaller than a deck of cards and cost only a few dollars. This is is marked contrast to the larger size, weight, cost, and power consumption of a general purpose laptop computer.
A photograph of the ATmega 328P MCU is shown below. This is the MCU installed in the Arduino Uno development board, which we will be working with for the remainder of this book.
Photograph of the Adafruit Trinket microcontroller board. The on-board microcontroller is the ATtiny85 which has 8K of flash memory, 512 byte of SRAM and 512 bytes of EEPROM. This board is an example of a microcontroller development board produced for the making community.