You are on page 1of 6

Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors

and Microcontrollers
I. Learner Objectives:

At the conclusion of this unit, participants should be able to:


Identify the principal topics related to microprocessor and
microcontroller systems
Describe differences between microprocessors and microcontrollers
Summarize features of the Atmel ATmega64L AVR microcontroller
Outline the main subsystems of any microcontroller or microprocessor
Identify key peripheral devices
Identify prevalent microcontrollers and microprocessors

II. Prerequisites:

Before reading this unit, participants should be able to:


Sketch and design basic logic circuits
Evaluate Boolean expressions
Identify AND, OR, NOT, NAND, NOR, XOR, and XNOR gates
Produce truth tables describing the functionality of basic electronic
systems
Produce non-entered and entered variable K-maps
Create small programs in a high-level language (such as C, C++, or Java)

III. Keywords:

Microprocessor, microcontroller

IV. Instructional Material:

Most electronic devices are controlled by either a microcontroller (MCU) or a


microprocessor. Microcontrollers and microprocessors consist of four main
subsystems: memory, input/output, control unit, and arithmetic logic unit
(ALU). The central processing unit (CPU) is comprised of the control unit and
ALU. The control units range from 8-bit to high-speed 64-bit processors. The
input/output subsystem interfaces to serial and/or parallel ports. The memory
subsystem consists of RAM for data storage and ROM, EEPROM, and Flash for
program storage. Other key features include peripheral devices such as
timers/counters, pulse width modulation (PWM) channels, comparators,
watchdog timers, and universal synchronous asynchronous receiver transmitters
(USARTs). Aside from sharing these key components, the microcontroller and
microprocessor aim to serve different tasks.

The microcontroller is a special purpose computer on-a-chip. It usually is


embedded with an electronic device, such as a robot (neat-o!), cell phone, car
braking system, car cruise control system, washing machine, or microwave.
Thus, a MCU needs to be self-sufficient (independent of external device help)
and cost-effective (cheap enough to be embedded in everyday electronics). All

Andrew S. O’Fallon (Rev. 1/12/10) 1


Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors
and Microcontrollers
subsystems are contained within a single space efficient integrated circuit (IC).
A microcontroller consumes little power in comparison to microprocessors.

The microprocessor is a general purpose computer which interfaces with many


other independent devices and systems. Microprocessors are found in personal
computers and are used for interfacing with printers, monitors, keyboards,
speakers, and mice. Many microprocessors may operate at clock frequencies
approaching 3.5 to 4.0 GHz.

Atmel’s AVR microcontrollers use a RISC core that generally processes one
instruction per clock cycle. The core decreases the need for a large complex
instruction set (which is generally not used completely anyways). AVR Flash
microcontrollers have the capability to operate at clock frequencies of 20 MHz.
Hence, these microcontrollers may execute a maximum of 20 million
instructions per second (MIPS). AVR microcontrollers are considered high
performance microcontrollers. It uses the Harvard computer architecture and
supports 32 general purpose registers. The microcontroller also supports 16 and
32-bit arithmetic calculations. The instruction set consists of 130 instructions,
which lend themselves to high-density programs. Atmel’s AVR RISC family of
microcontrollers supports a variety of on-chip peripherals such as: EEPROMs,
ADCs, Timers, UARTs, PWMs, digital I/O, etc.

The Atmel AVR 8-bit RISC architecture allows for low power consumption. They
operate between 1.8 and 5.5 V, which allows them to be integrated into
embedded controllers, such as the Digilent Cerebot II, where power
consumption is a necessary concern. If robot control is the desired application
for the Atmel AVR microcontroller then 1.8 to 5.5 V translates to between 1
and 4 AA or AAA batteries. The AVR microcontrollers also support various sleep
modes for preserving power when it is not needed. Between real-time events
or interrupts most of the microcontroller does not consume power. The AVR 8-
bit RISC family of microcontrollers also allow for in-system development. The
microcontrollers support on-chip debuggers and in-circuit-emulators.

The block diagram given in Figure 1 shows the organization of the 8-bit AVR
ATmega64L. The ATmega64L uses a RISC architecture with all of its general
purpose registers directly connected to the arithmetic logic unit (ALU). The
ATmega64L supports the following features:
Operates between 0 – 8 MHz
Supply voltage between 2.7 – 5.5 V
6 sleep modes
64 KB of in-system programmable flash
2 KB of EEPROM
4 KB of SRAM
53 general purpose I/O lines
32 general purpose registers (common to all 8-bit AVR microcontrollers)
1 real time counter (RTC)

Andrew S. O’Fallon (Rev. 1/12/10) 2


Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors
and Microcontrollers
4 timer/counters with compare modes and pulse-width modulation
(PWM) – 2 8-bit and 2 16-bit
2 universal synchronous/asynchronous receivers/transmitters (USARTs)
1 8-channel, 10-bit analog-to-digital converter (ADC)
1 programmable watchdog timer
1 serial peripheral interface (SPI) port
1 IEEE standard 1149.1 compliant JTAG test interface

Andrew S. O’Fallon (Rev. 1/12/10) 3


Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors
and Microcontrollers
Figure 1: ATmega64 Block Diagram (from page 3 of the ATmega64 ref
manual)

Many microcontrollers and microprocessors exist. Below is a small list of them.

Prevalent Microcontrollers:
Atmel – AT89, AT90, ATtiny, ATmega series, AT91SAM, AVR32
Xilinx – Microblaze, Picoblaze
NEC – 17K, V25, 75X, 78K, V850
Intel – MCS-48, MCS-51, 80960

Prevalent Microprocessors:
AMD - K5, K6, K6-2, K6-III, Duron, Athlon, Athlon XP, Athlon MP, Athlon
XP-M, Athlon 64, Athlon 64 FX, Athlon 64 X2, Opteron, Sempron, Turion
64
Intel – 8085, 8086, 8088, 80186, 80188, 80286, 80386, 80486, Pentium,
Pentium Pro, Celeron, Pentium II, Pentium III, Xeon, Pentium 4, Pentium
M, Pentium D, Celeron M, Celeron D, Itanium
Motorola – 6800, 68000, 88000
IBM/PowerPC

Topics needed for complete picture of a microprocessor or microcontroller:


Data types
Digital circuits
Architectures
Addressing modes
Interrupts
Timers/counters
Comparators
Coprocessors
DMA
Programmers models
Instructions sets
Subroutines and modules
Documentation
BIOS and DOS programming
Macros
Debugging
Testing
Compilers
Development tools
Hardware specifications
Memory interfaces
I/O interfaces
Bus interfaces
High-speed memory interfacing and cache

Andrew S. O’Fallon (Rev. 1/12/10) 4


Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors
and Microcontrollers

V. Conclusion:

There are clear differences between traditional microprocessors and


microcontrollers. Microcontrollers are designed to be self-sufficient and cost-
effective, whereas these requirements do not necessarily apply to traditional
microprocessors. Both microcontrollers and microprocessors contain four
central subsystems: memory, input/output, ALU, and control unit. Atmel 8-bit
RISC AVR microcontrollers have many features such as flash memory, 32
general purpose registers, 130 instructions, and on-chip peripherals.
Specifically the Atmel ATmega64L demonstrates these features with the
capability of being embedded on a controller board for robotics applications.

VI. Links:

Atmel: http://www.atmel.com/
Digilent: http://www.digilentinc.com/
Xilinx: http://www.xilinx.com/
AVR programming help: http://www.avrbeginners.net/
AVR community: http://www.avrfreaks.net/
AVR Projects: http://www.avrprojects.net/

VII. Instructions of the Day:

The instructions that you need to know for the day include: ADD and MOV. ADD
is considered an arithmetic instruction while MOV is a data transfer instruction.
ADD requires two registers (coming soon), a source (Rr) and destination register
(Rd), as operands. The contents of the two registers are added together the
result is stored in the destination register. This instruction only requires 1 clock
cycle (coming soon) to execute. An example usage is as follows:
ADD R1, R2, where R1 and R2 are accessible general purpose registers
and R1 is the destination and R2 is the source
MOV requires two registers as well. The contents of the source register is
copied and placed in the destination register. This instruction also only
required 1 clock cycle to execute. One example on how to use the instruction is
as follows:
MOV R1, R2, where R1 is the destination and R2 is the source
Notice the general pattern that the first operand is always the destination and
the second operand is always the source where appropriate.

VIII. Questions:

1. Which of the following is NOT a major subsystem of a microcontroller or


microprocessor?

(a) Control unit

Andrew S. O’Fallon (Rev. 1/12/10) 5


Microprocessor Systems Week 1 Unit 1: Introduction to Microprocessors
and Microcontrollers
(b) Memory
(c) Input/output (I/O)
(d) Program unit
(e) Arithmetic/logic unit (ALU)
(f) None of the above

2. Key peripheral devices the may be interfaced with microcontrollers include


which of the following?

(a) Control unit


(b) Memory
(c) Timers/counters
(d) Comparators
(e) All of the above
(f) c and d only
(g) b, c, and d only

3. Microcontrollers have which of the following features?

(a) Power efficient


(b) Physical space efficient
(c) Relatively low cost
(d) Faster than standard microprocessors
(e) All of the above
(f) b, c and d only
(g) a, b, and c only

4. Which of the following does NOT apply to Atmel’s AVR RISC microcontrollers?

(a) Operate between 1.8 and 5.5 V


(b) Operate at clock frequencies of up to 20 MHz
(c) Designed around a von Neumann architecture
(d) Supports 130 instructions
(e) None of the above

5. Which of the following does NOT apply to the Atmel ATmega64L?

(a) 4 KB of internal SRAM


(b) 2 KB of internal EEPROM
(c) 32 general purpose registers
(d) Operation of up to 20 MHz
(e) None of the above

Andrew S. O’Fallon (Rev. 1/12/10) 6

You might also like