Sunteți pe pagina 1din 51

UGEA2633

Microprocessor & Microcontroller


System
Topic 1:
Microcontroller Concepts

Learning Outcomes

In this topic, we will discuss on:

History and evolution of microprocessors


Microprocessor system
Microcontroller
Microprocessor vs microcontroller
Computer architecture
Overview of the 8051 family
Comparing and choosing a microcontroller

History and Evolution of


Microprocessor

ENIAC (Electronic Numerical Integrator and Computer)

Technology: contained 17,468 vacuum tubes, 7,200 crystal diodes,


1,500 relays, 70,000 resistors, 10,000 capacitors
Size: roughly 8 x 3 x 100 feet, took up 1800 square feet (167 m2)
Power Consumption: 150kW

First generation Vacuum tubes

Slow, limited instructions, breakdown easily

The Manchester Mark 1

Second generation Transistors

Computers shrank in size

The IBM 7090

Third generation Integrated circuit (IC)

Thousands of transistors packed into a small


silicon

IBM 360

Fourth Generation Microprocessors

The microprocessor brought


generation of computers

the

IBM PC

fourth

Microprocessor System

Block diagram of a microprocessor system:

Clock

Central Processor Unit (CPU) also known


as Microprocessor Unit (MPU)
The CPU controls the microprocessor
system. Its carries out arithmetic and logic
operations internally.

Inside the microprocessor / CPU:

Components of a CPU:

Arithmetic Logic Unit (ALU)

Holds data temporarily


Carries out calculations (addition, subtraction) and
logic operations

Registers

High speed temporary data storage within the CPU


Permanent storage location in the CPU
Stores binary data for manipulation during the
execution of an instruction
There are different registers in a CPU

Special function registers in a CPU:

Program Counter (PC) Holds address of the next


instruction to be executed
Instruction Register (IR) Holds the actual instruction
being executed

Status Register Contains several 1-bit registers known as


flags. The flags changes as the instructions are executed.
Examples of flags:
Carry flag
Overflow flag
Zero flag
Instruction decoder Interprets the instruction fetched into
the CPU

Considerations for registers:

Bigger registers = better CPU, but higher cost


Better instruction decoders = More transistors to design

Memory stores the instructions and data that


would allow the microprocessor system to
perform a specific task

Instructions codes that tells the CPU to do


something useful

Data formation to be used by the instructions

E.g. Add two numbers together


E.g. The two numbers to be added together

Operations that can be performed on


memory:

Reading information from it


Writing information to it

Memory can be:

Read-Only Memory (ROM)


Random Access Memory (RAM).

Two main types of RAM:

Static RAM
Dynamic RAM

Static RAM

Faster access time


Consume more power
More expensive
Takes up more space - basically each chip stores
less.

Dynamic RAM

Require less power


Less expensive
Can store more data
Slower when compare to static type
Require extra circuits to refresh its content

Three types of buses in a microprocessor


system:

Control bus
Data bus
Address bus

Control bus

Used by CPU to direct other devices


Provides read or write signals to devices
Indicates if CPU is asking for information or
sending out information

Data bus

Sends information back and forth between the


CPU and other devices
More data buses = better speed but higher cost
Bidirectional Can receive or send data

Address bus

Used by the CPU to identify a device or


memory location
More address buses = higher number of devices
that can be addressed
Unidirectional Only sends out addresses

Microprocessor system applications:

Example 1: Cash Register

Clock

printer
scanner
display
keyboard

Example 2: Games Console

Clock

joystick

display

Microcontroller

Block diagram of a microcontroller:


ADC

Microcontroller contains the CPU and much


of a complete computer system on a single
chip
RAM, ROM, serial interface, parallel
interface, timer, ADC and interrupt circuit
are part of a microcontroller
RAM is limited - not a problem, since
microcontrollers are intended for various
applications

An important feature is the built-in interrupt


system:

Microcontrollers are often used to respond to


external interrupts in real-time
External components are usually required

Microcontrollers for embedded systems:

Microprocessor vs
Microcontroller

Microprocessors:

Contain no RAM, ROM or I/O ports on the


chip itself
Referred as general-purpose microprocessors
Requires addition of RAM, ROM, I/O ports and
timers externally for it to function
Addition of external components increases cost
Versatile in terms of design requirements

Microcontrollers:

Contain a CPU (microprocessor), RAM, ROM


or I/O ports on a single chip
Reduced design versatility as external memory,
I/O and timers cannot be added
Ideal for applications where cost and space are
more critical than computing power

Computer Architecture

Two main computer architectures:

Von-Neumann Computer Model


Harvard Architecture

The Von-Neumann Computer Model:

Central Processing Unit (CPU): Control Unit


(instruction decode , sequencing of operations),
Datapath (registers, arithmetic and logic unit,
buses)
Memory: Instruction and operand storage

Input/Output (I/O)
The stored program concept: Instructions from
an instruction set are fetched from a common
memory and executed one at a time
Memory
(instructions,
data)

Computer System

Control

Input

Data path
registers
ALU, buses

Output

CPU

I/O Devices

The path joining the CPU and the memory has


been called the Von Neumann bottleneck

The Von Neumann bottleneck is one of the


limiting factors of the Von Neumann machine
The width of the information path sets a limit to
the maximum possible volume and speed of
information flow between the CPU and the
memory

The Harvard Architecture:

Data and program are kept separate


The benefit is that there are independent paths
to the data and memory.
Both can be used simultaneously; this leads to a
higher effective system speed

Overview Of The 8051 Family

A brief history of the 8051:

In 1981, Intel Corporation introduced an 8-bit


microcontroller called the 8051
This microcontroller had 128 bytes of RAM, 4K bytes
of on-chip ROM, two timers, one serial port, and four
ports (each 8-bits wide) all on a single chip
The 8051 is an 8-bit processor, meaning that the CPU
can work on only 8 bits of data at a time
Data larger than 8 bits has to be broken into 8-bit pieces
to be processed by the CPU

The 8051 has a total of four I/O ports, each 8 bits wide
Although the 8051 can have a maximum of 64K bytes
of on-chip ROM, many manufacturers have put only
4K bytes on the chip
The 8051 became widely popular after Intel allowed
other manufacturers to make and market any flavors of
the 8051 they please with the condition that they remain
code-compatible with the 8051
This has led to many versions of the 8051 with different
speeds and amounts of on-chip ROM marketed by more
than half a dozen manufacturers

8051 microcontroller:

Features

8052 microcontroller:

The 8052 is another member of the 8051 family


The 8052 has all the standard features of the
8051 as well as an extra 128 bytes of RAM and
an extra timer
8052 has 256 bytes of RAM and 3 timers
It has 8K bytes of on-chip program ROM
instead of 4K bytes

8031 microcontroller:

Referred as a ROM-less 8051 since it has 0K bytes of


on-chip ROM
External ROM need to be added to use it
External ROM contains the program that the 8031 will
fetch and execute
The ROM containing the program attached to the 8031
can be as large as 64K bytes
Two ports are lost in the process of adding external
ROM to the 8031
To solve this problem, add an external I/O to the 8031
The 8031 can be interfaced with memory and I/O ports
such as the 8255 chip

Various 8051 microcontrollers:

Available in different memory types, such as UV-EPROM, flash,


and NV-RAM, all of which have different part numbers
The UV-EPROM version of the 8051 is the 8751
The flash ROM version is marketed by many companies including
Atmel Corp. and Dallas Semiconductor
The Atmel Flash 8051 is called AT89C51, while Dallas
Semiconductor calls theirs DS89C4xO (DS89C420/430/440)
The NV-RAM version of the 8051 made by Dallas Semiconductor
is called DS5000
There is also an OTP (one-time programmable) version of the 8051
made by various manufacturers

AT89S52 from Atmel Corporation

This is the chip


used in this
course

Comparing and choosing a


microcontroller

Comparison of 8051 family members

Versions of 8051/52 Microcontroller From


Dallas Semiconductor (Maxim):

Versions of 8051 From Atmel (All ROM


Flash)

Choosing a microcontroller:

Capable of handling the task at hand efficiently


and cost effective

Speed
Packaging
Power consumption
RAM, ROM amount
Number of I/O pins and timer
Upgradeability to higher performance or lower
power consumption versions
Cost per unit

Convenience in developing products around it

Availability of assembler, debugger, code-efficient


C language compiler
Emulator
Technical support
In-house and outside expertise

Ready availability in needed quantities both


now and in the future

S-ar putea să vă placă și