Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
28 views

Embedded Unit 1

Uploaded by

Aman Kumar Rai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Embedded Unit 1

Uploaded by

Aman Kumar Rai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 135

ARA 320

Embedded Systems

UNIT 1
WHAT IS AN EMBEDDED
SYSTEM?
 Embedded systems are devices used to control, monitor or assist the operation of
equipment, machinery or plant. “Embedded” reflects the fact that they are an
integral part of thesystem.
 An embedded system is some combination of computer hardware and software,
either fixed in capability or programmable, that is specifically designed for a
particular function.

SOFTWARE HARDWARE APPLICATION


WHAT IS INSIDE THE EMBEDDED SYSTEM?

HARDWARE SOFTWARE
 CPU  APPLICATION
 MEMORY  OS
 I/O DEVICES  DEVICE DRIVERS
EMBEDDED STEM
SY
Layered architecture of an Embedded System
Now let us see the details of the various building blocks of the
hardware of an embedded system.

• Central Processing Unit (CPU)


• Memory (Read only memory and Random access memory)
• Input Devices
• Output Devices
• Communication interfaces
• Application specific circuitry
This slide shows the Hardware architecture of an embedded
system
Features of an embedded system
Embedded systems do a very specific task, they cannot be programmed to do
different things.

• Embedded systems have very limited resources, particularly the memory.


Generally, they do not have secondary storage devices such as the
CDROM or the floppy disk.

• Embedded systems have to work against some deadlines. A specific job


has to be completed within a specific time. In some embedded systems,
called real-time systems, the deadlines are stringent. Missing a dead line
may cause a catastrophe – loss of life or damage to property.
• Embedded systems are constrained for power, As many embedded
systems operate through a battery, the power consumption has to be very
low.

• Embedded systems need to be highly reliable. Once in a while, pressing


ALT-CTRL-DEL is OK on your desktop, but you cannot afford to reset your
embedded system.

• Some embedded systems have to operate in extreme environmental


conditions such as very high temperatures and humidity.
• Embedded systems that address the consumer market (for example
electronic toys) are very cost-effective. Even a reduction of Rs.10 is lot of
cost saving, because thousands or millions systems may be sold.

• Unlike desktop computers in which the hardware platform is dominated


by Intel and the operating system is dominated by Microsoft, there is a
wide variety of processors and operating systems for the embedded
systems. So, choosing the right platform is the most complex task .
CLASSIFICATION OF EMBEDDED SYSTEMS

TYPES OF EMBEDDED
SYSTEM

BASED ON PERFORMANCE AND BASED ON PERFORMANCE OF


FUNCTIONAL REQUIREMENTS MICROCONTROLLER

REAL SMALL
TIME SCALE

STAND MEDIUM
ALONE SCALE
MOBILE
NETWORKED
SOPHISTICATED
BASED ON PERFORMANCE AND FUNCTIONAL REQUIREMENT

1.REAL TIME EMBEDDED SYSTEM


Real-time embedded systems are defined as those systems in which the correctness of
the system depends not only on the logical result of computation, but also on the time
at which theresults are produced.
 Hard real-time systems(e.g., Avionic control).
 Firm real-timesystems (e.g., Banking).
 Soft real-timesystems (e.g., Videoondemand).
2.STAND ALONE EMBEDDED SYSTEM
 A standalone device is able to function independently of other hardware. This means
it is not integratedinto another device.
 It takes the input from the input ports either analog or digital and processes,
calculates and converts the data and gives the resulting data through the connected
device-Which either controls, drives anddisplays theconnected devices.
 For example, a TiVo box that can record television programs , mp3 players are
standalone devices
3.NETWORKED EMBEDDED SYSTEM

 These typesof embeddedsystemsare related toanetwork toaccess theresources.

 The connected network can be LAN, WAN or the internet. The connection can be
any wired or wireless. This type of embedded system is the fastest growing area in
embeddedsystemapplications. .
4.MOBILE EMBEDDED SYSTEMS
 Mobile embedded systems are used in portable embedded devices like cell
phones, mobiles, digital cameras, mp3 players and personal digital
assistants, etc.
 The basic limitation ofthesedevices is the other resources and limitation of
memory.
Based onthePerformance of theMicrocontroller
Small Scale Embedded Systems
 These types of embedded systems are designed with a single 8 or 16-
bit microcontroller, thatmayevenbeactivatedbyabattery.
 For developing embedded software for small scale embedded systems, the main
programming tools are an editor, assembler, cross assembler and integrated
development environment (IDE).

MediumScale Embedded Systems


 These types of embedded systems design with a single or 16 or 32 bit
microcontroller, RISCs or DSPs.
 These types of embeddedsystems have bothhardware and softwarecomplexities.
 For developing embedded software for medium scale embedded systems, the
main programming tools are C, C++, JAVA, Visual C++, RTOS, debugger,
source code engineering tool, simulator andIDE.
SophisticatedEmbeddedSystems
 These types of embedded systems have enormous hardware and software
complexities, that may need ASIPs, IPs, PLAs, scalable or configurable
processors.
 Theyareusedforcutting-edgeapplicationsthatneedhardwareandsoftware Co-
design andcomponentswhich have toassemble in thefinal system.
Classification of Embedded Systems
Based on functionality and performance
requirements, embedded systems are
classified as :

• Stand-alone Embedded Systems


• Real-time Embedded Systems
• Networked Information Appliances
• Mobile Devices
Stand-alone Embedded Systems

As the name implies, stand-alone systems work in stand-alone mode. They


take inputs, process them and produce the desired output. The input
can be electrical signals from transducers or commands from a human
being such as the pressing of a button. The output can be electrical
signals to drive another system, an LED display or LCD display for
displaying of information to the users. Embedded systems used in
process control, automobiles, consumer electronic items etc. fall into
this category.
Real-time Systems

Embedded systems in which some specific work has to be done in a


specific time period are called real-time systems. For example, consider a
system that has to open a valve within 30 milliseconds when the humidity
crosses a particular threshold. If the valve is not opened within 30
milliseconds, a catastrophe may occur. Such systems with strict deadlines
are called hard real-time systems.
In some embedded systems, deadlines are imposed, but not adhering to
them once in a while may not lead to a catastrophe. For example,
consider a DVD player. Suppose, you give a command to the DVD player
from a remote control, and there is a delay of a few milliseconds in
executing that command. But, this delay won’t lead to a serious
implication. Such systems are called soft real-time systems .
Hard Real-Time Embedded System
Networked Information Appliances

Embedded systems that are provided with network interfaces and


accessed by networks such as Local Area Network or the Internet are
called networked information appliances. Such embedded systems are
connected to a network, typically a network running TCP/IP (Transmission
Control Protocol/Internet Protocol) protocol suite, such as the Internet or
a company’s Intranet.

These systems have emerged in recent years. These systems run the
protocol TCP/IP stack and get connected through PPP or Ethernet to an
network and communicate with other nodes in the network.
Here are some examples of such systems

• A networked process control system consists of a number of


embedded systems connected as a local area network. Each
embedded system can send real-time data to a central
location from where the entire process control system can be
monitored. The monitoring can be done using a web browser
such as the Internet Explorer.

• A web camera can be connected to the Internet. The web


camera can send pictures in real-time to any computer
connected to the Internet. In such a case, the web camera
has to run the HTTP server software in addition to the TCP/IP
protocol stack.
➢ The door lock of your home can be a small embedded system
with TCP/IP and HTTP server software running on it. When
your children stand in front of the door lock after they return
from school, the web camera in the door-lock will send an
alert to your desktop over the Internet and then you can open
the door-lock through a click of the mouse.
This slide shows a weather monitoring system connected to the Internet.
TCP/IP protocol suite and HTTP web server software will be running on
this system. Any computer connected to the Internet can access this
system to obtain real-time weather information.
The networked information appliances need to run the complete
TCP/IP protocol stack including the application layer protocols.
If the appliance has to provide information over the Internet,
HTTP web server software also needs to run on the system.
Mobile Devices

Mobile devices such as mobile phones, Personal Digital Assistants (PDAs),


smart phones etc. are a special category of embedded systems. Though
the PDAs do many general purpose tasks, they need to be designed just
like the ‘conventional’ embedded systems.
The limitations of the mobile devices – memory constraints, small size, lack of
good user interfaces such as full fledged keyboard and display etc. are
same as those found in the embedded systems discussed above. Hence,
mobile devices are considered as embedded systems.

However, the PDAs are now capable of supporting general purpose


application software such as word processors, games, etc.
APPLICATIONS OF EMBEDDED SYSTEMS
Industrial machines, automobiles, medical equipment, cameras, household
appliances, airplanes, vending machines and toys (as well as the more obvious
cellular phone and PDA) are among the myriad possible hosts of an embedded
system.
EmbeddedSystemsin Automobiles and EmbeddedSystemsin Smart Cards,
in telecommunications Missiles andSatellites
 Motor andcruisecontrol system  Securitysystems
 Body or Enginesafety  Telephoneandbanking
 Entertainmentandmultimediain car  Defenceandaerospace
 E-ComandMobile access  Communication
 Robotics inassemblyline
 Wireless communication
 Mobile computingandnetworking

EmbeddedSystemsin Consumer EmbeddedSystemsin Peripherals &


Electronics ComputerNetworking
 Digital Cameras  Displays andMonitors
 Set topBoxes  NetworkingSystems
 HighDefinition TVs  ImageProcessing
 DVDs  Networkcards andprinters
HOWDO WE IMPLEMENT THEM?

 Wedosoby usingmicrocontrollers (or microprocessor basedsystems)

 Or simply by using digital circuits thatperformthefunction wewant.

Digital circuits Microprocessor based systems


Faster Slower
 Only propagation delay  Technology Dependent

Inflexible Flexible
 Functions they perform can’t be  We need only to update the
changed software.
easily.
Example: Example:
Communication Personal
system Ciphering computer,PDA’s
algorithm Mobile phones,PLC’s
•An embedded system is some combination of computer
hardware and software.

• An embedded system is housed on a single


microprocessor board with the programs stored in ROM.

•Virtually all appliances that have a digital interface -- watches,


microwaves, VCRs,cars -- utilize embedded systems.
Various recent trends in embedded system are :-

1. SoC (System on a Chip)


2. Wireless Technology
3. Multi-core Processor
4. Multi-language support
5. User interface
6. Use of open Source Technology
7. Inter-operatability
8. Automation
9. Security
10.Power consumption
•A system on a chip (SoC) is an integrated circuit (IC) that
integrates all components of a computer or other
electronic system into a single chip.

•SoCs are very common in the mobile electronics market because


of their low power consumption. A typical application is in the area
of embedded systems.
•The term "wireless" refers, in the most basic and obvious sense, to
communications sent without wires or cables.

•It is a broad term that encompasses all sorts of wireless


technologies and devices, including cellular communications,
networking between computers with wireless adapters, and wireless
computer accessories.

•Wireless communications travel over the air via electromagnetic


waves (radio frequencies, infrared, satellite, etc).
A multi-core processor is an integrated circuit (IC) to which two or
more processors have been attached for enhanced performance,
reduced power consumption, and more efficient simultaneous
processing of multiple tasks.
•Embedded system provides us facility of multiple languages. For
example ATM is a typical example of embedded system.

•In ATM there are three types of languages are used like
Hindi,Punjabi,English.
•Visual part of computer application or operating system through
which a user interacts with a computer or a software.

•It determines how commands are given to the computer or


the program and how information is displayed on the screen.
•Open source technology refers to a program in which the source
code is available to the general public for use and/or modification
from its original design free of charge, i.e., open.

•Open source code is typically created as a collaborative effort in


which programmers improve upon the code and share the
changes within the community.
•Ability to work with each other. In the loosely coupled
environment of a service-oriented architecture, separate
resources don't need to know the details of how they each
work, but they need to have enough common ground to
reliably exchange messages without error or
misunderstanding.

•Interoperability is when services can interact with each other


without encountering such problems.
Data shared with
•Automation or automatic control, is the use of various control
systems for operating equipment such as machinery, processes
in factories, switching in telephone networks, steering and
stabilization of ships, aircraft and other applications with minimal
or reduced human intervention. Some processes have been
completely automated.

•The biggest benefit of automation is that it saves labor, however,


it is also used to save energy and materials and to improve
quality, accuracy and precision.
• Secure Design
Capture system security and performance requirements and develop a secure
architecture

•Threat Model Analysis


Ensure your system is analyzed without bias and based on expert knowledge of
the attack landscape

• Software & Code Testing


Uncover serious problems early and avoid crash-causing defects in code

• Crypto Implementation
Leverage our expertise to ensure crypto is implemenented securely
•Power consumption has traditionally been something
influenced only by hardware developers. But power
consumption depends not only on the hardware, but also
on how it is used and how it is controlled by the system
software.

•Through power consumption – it becomes possible to test


and tune for power optimisation.
Embedded System Design
Level Abstraction

requirements

specification

architecture

component
design

system
integration

56
Development Process

57
H/W and S/W Co-Design

58
Levels of Abstraction from Top to Bottom
• Requirements
• Specifications
• Architecture
• Components
• System Integration

59
Requirement
Complete clarity of:
• Required Purpose
• Inputs
• Outputs
• Functioning
• Design metrics
• Validation requirements for finally developed
system specifications
• Consistency in the requirements

60
Specifications
• Clear specification of customer expectations
from the product
• Needs specification for
– H/W, eg: Peripherals, Divices,Processors and
memory specifications
– Data types and processing specifications
• Expected system behavior specifications
• Constraints of design
• Expected lifecycle specifications of the
product
61
Specifications
• Process specifications analyzed by making list
of I/Ps on event list, O/Ps on events, process
activated on each event

62
Architecture

63
Components of Embedded system
 H/W
- Processor
- Power source and clock
- Reset circuit
- Memory Unit
- Interrupt Handler
- Linking Embedded System H/W
- I/O communication Unit

 S/W
- ROM image/Applications/w
- Programming Languages
- Device Drivers
- Program Models

64
Components of Embedded system
 RTOS/EOS

 S/W Tools
- Development tools
- Simulator
- Project Manager
- IDE

65
Difference between RISC and CISC
RISC CISC
Reduced instruction set Complex Instruction set

Maximum instructions are Variable size Instructions,so


single cycle(fixed size),thus generally do not have
supports pipelining pipelining
Orthogonal instruction set Non-Orthogonal

Operations are performed on Operations are performed on


registers, so large no of both registers and memory.
Registers. Limited number of GPRs
For memory only Load and
Store

Friday, September 04, 2015 By AMRUTA CHINTAWAR 66


Difference between RISC and CISC
RISC CISC

Hardwired Control unit Microcode control Unit

Small in size with resp to die area Comparatively large in size since
and No.of pins more complex instruction needs
to be implemented.

Harvard architecture Harvard or Von-Neuman

Eg:PIC18,ARM 8051,8086

Friday, September 04, 2015 By AMRUTA CHINTAWAR 67


Design
Challenges
in
Embedded
Systems
Challenges faced during embedded
system design:

 Type and amount of hardware needed.


 Optimising the power dissipation and energy consumption
 Process deadlines
 Flexibility and ability to upgrade
 Reliability
Challenges in embedded system
design
Type and amount of Hardware based on SoC or VLSI design has very high NRE cost
hardware and hardware design on a circuit board depends on available
chips.
Power dissipation Power is energy dissipated per second
Energy Consumption Energy consumption per unit talk time in a phone needs to be
controlled so that battery requires 24-hour battery charging after
the 4 hours of talk during the day.
Process deadlines Meeting the deadline of all processes in the system while keeping
the memory, power dissipation, processor clock rate and cost at
minimum is a challenge.
Flexibility Flexibility in design at little cost overhead is a challenge.
Ability to upgrade Ability to upgrade the design while keeping the cost minimum
Challenges in Embedded Challenges in Embedded System Design:
Optimizing the Design System Design: Optimizing the Design
Metrics

 Power dissipation, physical size, number of gates and engineering,


prototype development and manufacturing costs.
Design challenges

 Unit cost
 NRE cost
 Size
 Performance
 Flexibility
 Time-to-market
 Time-to-prototype
 Correctness
 safety
Unit cost and NRE cost

 Unit Cost: the monetary cost of manufacturing each


copy of the system, excluding NRE cost.

 NRE cost (Non-Recurring engineering cost): the one-


time monetary cost of designing the system.
size

 The physical space required by the system

 Individually or part of a system


Cost and type of hardware needed

 Optimizing the microprocessors, ASIPs and single purpose processors in


the system.
 Hardware software participation
 How much H/W How much S/W?
 Optimization – according to the performance, power dissipation, cost and
other design metrics the system.
 Optimizing hardware (memory RAM, ROM or internal and external flash
or secondary memory in the system, peripherals and devices internal and
external to the system, ports and buses in the system and power source or
battery in the system)
Considering design metrics

 Power dissipation
 Physical size, number of gates and engineering
 Prototype development and manufacturing costs.
Power dissipation optimizing

 Clock rate reduction


 Operating voltage reduction
 Wait, stop and cache disable instructions
 Disabling or controlling certain units when not needed is one method of
saving power during execution.
 Small size, low weight
 Real time/ reactive operation
Deadlines

 Challenging is reducing cost by meeting the deadline of all processes in the


system while keeping the memory, power dissipation, processor clock rate.
Flexibility

 Different versions of a product for marketing


 The ability to change the functionality of the system without incurring
heavy NRE cost
 Upgrading and releasing advanced versions
Reliability and safety

 Designing reliable product


 Testing, verification and validation is a challenge
 Assured safety
Testing

 Find errors and to validate that the implemented product is as per the
specifications and requirements to get reliable product.
verification

 Ensure specific functions are correctly implemented


Time-to-prototype, Time-to-market

 The time needed to build a working version of the system.


 The time required to develop a system to the point that it can be released
and sold to customers.
Maintainability

 The ability to modify the system after its initial release


 Correctness, safety
Validation

 To ensure that the system that has been created is a s per requirements
agreed upon at the analysis phase, and to ensure its quality
Summary

 Discussed the different challenges in embedded system design


 Explained the need for optimization in design and production
 Discussed the importance of power utilization and minimization
Difference between microprocessor and microcontroller

MICROPROCESSOR MICROCONTROLLER
• Microprocessor assimilates • A microcontroller can be
the function of a central considered as a small
processing unit (CPU) on to a computer that has a
single integrated circuit (IC). processor and some other
• Microprocessors are basic components in order to make
components of personal it a computer.
Computers. • Microcontrollers are
• A Microprocessor-based generally used in embedded
system can perform numerous systems.
tasks. • A Microcontroller-based
• The clock frequency is very system can perform single or
high usually in the order of very few tasks.
giga Hertz • The clock frequency is less
• Instruction throughout is usually in the order of
given higher priority than MegaHertz.
interrupt latency. • In contrast, microcontrollers
are designed to optimize
interrupt latency.
Difference
between
RISC and
CISC
Definition of Harvard architecture and
Von Neumann architecture
• Harvard architecture:-The Harvard architecture is a computer architecture with
separate storage and signal pathways for instructions and data. It contrasts with the
von Neumann architecture, where program instructions and data share the same
memory and pathways.

 Von Neumann architecture:- Von Neumann architecture is the design upon which many
general purpose computers are based. The key elements of von Neumann architecture are:
data and instructions are both stored as binary digits. data and instructions are both stored
in primary storage.
Harvard Architecture
Von Neumann
Architecture
Difference between Harvard and Von Neumann Architectures
1.2 Harvard and Von-Neumann architecture.

A Basic Computer Model


Harvard and Von-Neumann
architecture.

Architecture of a micro computer or a micro


controller refers to the arrangement of the CPU
with respect of the RAM and ROM.

Von-Neumann and Harvard architecture


are the two ways through which the
micro controller can have its
arrangement of the CPU with RAM and
ROM.
Harvard architecture..
In Harvard architecture, the CPU is connected with both the
data memory (RAM) and program memory (ROM), separately.

It requires more hardware since it will be requiring separate


data nd address bus for each memory..

This requires more space.

Speed of execution is faster because the processor fetches


data and instructions simultaneously

It results in wastage of space since if the space is left in the


data memory then the instructions memory cannot use the
space of the data memory and vice-versa.

Controlling becomes complex since data and instructions are


to be fetched simultaneously.
Harvard architecture.

Harvard architecture require


separate bus for instruction and data.

Processor can complete an


instruction in one cycle .

Easier to pipeline, so high


performance can be achieve.

Comparatively high cost.


Von-Neumann architecture..
There is no separate data and program memory. Instead, a
single memory connection is given to the CPU.

requires less hardware since only a common memory needs


to be reached.

requires less space.

Speed of execution is slower since it cannot fetch the data


and instructions at the same time.

Space is not wasted because the space of the data memory


can be utilized by the instructions memory and vice-versa.

Controlling becomes simpler since either data or instructions


are to be fetched at a time.
Von-Neumann
architecture..
Von Neumann architecture require
only one bus for instruction and data.

Processor needs two clock cycles to


complete an instruction.

Low performance as compared to


Harvard architecture.

Comparatively low cost.


COMPARISON OF HARVARD AND VON NEUMANN ARCHITECTURE

⚫ Harvard ◦ Von Neumann


◦ Separate memory for ◦ Single memory for
Instruction and Data Instruction and Data
◦ Requires separate and ◦ Requires separate and
dedicated bus for dedicated bus for
instruction and data
instruction and data
◦ Design is completed
◦ Design is simple
◦ Instruction and data can
be fetched ◦ Instruction and data has
simultaneously which to be fetched in
increases speed sequence which reduces
speed
RISC AND CISC ARCHITECTURE
CISC Architecture :
Theory
CISC is an acronym for Complex Instruction Set Computer

Earliest machines were programmed in assembly language and memory


was slow and expensive, CISC make efficient use of memory.

Most common microprocessor Intel 80x86 and Motorola 68K series use
CISC philosophy.

But at present there is vast changes in software and hardware technology .

CISC are modified and implemented with other RISC principles.

CISC was developed to make compiler development simpler. It tried to reduce burden of
generating machine instructions to the processor. Instead of having to make a compiler write long
machine instructions to calculate a square-root, a CISC processor itself could do it.
Attributes of CISC

CISC instructions sets some common characteristics:

(constraints : small amounts of slow memory, most early machines were programmed in assembly
language)

A 2-operand format, where instructions have a source and a destination. Register to register,
register to memory, and memory to register commands. Multiple addressing modes for memory,
including specialized modes for indexing through arrays

Variable length instructions where the length often varies according to the addressing mode

Instructions which require multiple clock cycles to execute.

E.g. Pentium is considered a modern CISC processor


CISC Disadvantages

As the CISC generation processor advanced, the older instruction set and
hardware need to be there to support the new version. This increased the
complexity .

Different instructions will take different amounts of clock time to execute,


slowing down the overall performance of the machine. Complex and efficient
machine instructions

Many specialized instructions aren't used frequently. Relatively fewer registers

Extensive Addressing Capabilities for memory operation


RISC
Acronym
RISC, or Reduced Instruction Set Computer.

Utilizes a small, highly-optimized set of instructions. Instead of highly specialized set of


instructions often found in other types of architectures.

The first RISC projects came from IBM, Stanford, and UC-Berkeley in the late 70s and early
80s. The IBM 801, Stanford MIPS, and Berkeley RISC 1 and 2 were all designed with a similar
philosophy which has become known as RISC. Certain design features have been
characteristic of most RISC processors:

One cycle execution time: RISC processors have a CPI (clock per instruction) of one cycle.

Large number of registers: the RISC design philosophy generally incorporates a larger
number of registers to prevent in large amounts of interactions with memory

Pipelining: A technique that allows for simultaneous execution of parts, or stages, of


instructions to process the instruction efficiently
Attributes of RISC

RISC processors are more or less the opposite of the above:

⚫ Reduced instruction set.

⚫ Less complex, simple instructions.

⚫ Hardwired control unit and machine instructions.

⚫ Few addressing schemes for memory operands with only two basic
instructions, LOAD and STORE

⚫ Many symmetric registers which are organized into a register file.


RISC Disadvantages
⚫ By making the hardware simpler, RISC architectures put a greater burden on
the software. Is this worth the trouble because conventional microprocessors
are becoming increasingly fast and cheap anyway?

CISC and RISC Convergence


 Because a number of advancements are used by both RISC and CISC processors,
the lines between the two architectures have begun to blur.
 In fact, the two architectures almost seem to have adopted the strategies of the
other.
 Because processor speeds have increased, CISC chips are now able to execute
more than one instruction within a single clock. This also allows CISC chips to
make use of pipelining. With other technological improvements, it is now possible
to fit many more transistors on a single chip.
CISC versus RISC

CISC RISC
Emphasis on hardware Emphasis on software
Includes multi-clock Single-clock,reduced
complex instructions instruction only
Memory-to-memory:"LOAD" Register to
and "STORE“ incorporated in register:
instructions “LOAD" and
STORE“
are independent instructions
Small code sizes, high cycles Low cycles per second, large
per second code sizes
Transistors used for storing Spends more transistors on
complex instructions memory registers
Why a microcontroller ?

A microcontroller is a single silicon chip with memory and all Input/Output


peripherals on it. Hence a microcontroller is also popularly known as a
single chip computer. Normally, a single microcomputer has the following
features :
➢ Arithmetic and logic unit
➢ Memory for storing program
➢ EEPROM for nonvolatile data storage
➢ RAM for storing variables and special function registers
➢ Input/output ports
➢ Timers and counters
➢ Analog to digital converter
➢ Circuits for reset, power up, serial programming, debugging
➢ Instruction decoder and a timing and control unit
➢ Serial communication port
So, its no wonder to say that the microcontroller is the most sought after
device for designing an efficient embedded system.
A

Microcontroller 8051
General-purpose Microprocessors
🠶 CPU
🠶 No RAM
🠶 No ROM
🠶 No I/O ports

Microprocessor
Address bus

CPU RAM ROM Printer Disk Monitor Keyboard

Read/ Data bus


Write
Control bus
General-purpose Microcontroller
🠶 CPU (microprocessor)
🠶 RAM
🠶 ROM
🠶 I/O ports
🠶 Timer
🠶 ADC and other peripherals
Microcontroller

CPU RAM ROM

Seri
I/O Timer al
CO
M
Port
Features Of 8051
🠶 128 bytes of RAM
🠶 4 K bytes of on-chip ROM
🠶 Two timers
🠶 One serial port
🠶 Four I/O ports, each 8 bits wide(i.e. 32 I/O pins.)
🠶 6 interrupt sources
🠶 Commercially available version of 8051 run on 12 MHz to 18 MHz
Architecture Of 8051
Interrupts

On-chip Etc.
Interrupt On-chip
ROM Timer 0
Control for code RAM Timer 1

CPU

OSC Bus I/O Serial


Control Ports Port

P0P1P2 P3 TXD RXD


Arch8051
Arch8051 Functional Description Block
 Accumulator
- SFR
- It can be accessed through its SFR adder 0E0H.
 B Register
- Use as temporary register .
- store upper bit Result of MUL & DIV.
- access through SFR adder 0F0H.
 Stack Pointer
- Define anywhere on chip 128 byte RAM.
- It is Initialised to 07H address (after rest) .
 Data Pointer
- 16 bit register
-Access external memory up to 64KB.
Arch8051 Functional Description Block
 Program Status Word
- Reflect status ALU performing operation.
 Port 0 to 3
-Each latch and corresponding drivers of port 0 to 3 is allotted to the
corresponding on chip I/O port.
 Serial Data Buffer
- Two Independent Register : TX Buffer (8bit) & RX Buffer(8bit).
 Program Counter
- 16 bit wide
- Point to address of next instruction to be executed .
Arch8051 Functional Description Block
 Timing & Control Unit
- Deriver signal required for Internal operation of circuit .
- Control signal required for controlling External System
Bus.
 Oscillator
- Generate basic timing control signal for operation of
circuit using crystal oscillator.
 ALU
- Perform 8 bit operation.
- Through TMP1 and TMP2 (each 8 bit).
- Not access by User.
 SFR Register Bank
- lie in range of 80H to 0FFH .
- It can addressed using their respective address .
Pin Configuration P1.0 1 40 VCC

OF 8051 P1.1
P1.2
2
3
39
38
P0.0(AD0)
P0.1(AD1)
P1.3 4 37 P0.2(AD2)
🠶 VCC & VSS
P1.4 5 36 P0.3(AD3)
🠶 RESET P1.5 6 35 P0.4(AD4)
🠶 ALE/PROG P1.6 7 34 P0.5(AD5)
P1.7 8 33 P0.6(AD6)
-It is used for demultiplexing RST P0.7(AD7)
9 32
address and data . EA/VPP
(RXD)P3.0 10 31
-It is valid only for External (TXD)P3.1 11 30 ALE/PROG
memory accesses. (INT0)P3.2 12
8051 29 PSEN
(INT1)P3.3 13 28 P2.7(A15)
🠶 EA/VPP
(T0)P3.4 14 27 P2.6(A14)
- EA/VPP =0 : Execute program on
(T1)P3.5 15 26 P2.5(A13)
external memory.
(WR)P3.6 16 25 P2.4(A12)
-EA/VPP =1 : Execute program on (RD)P3.7 17 24 P2.3(A11)
internal memory. XTAL2 18 23 P2.2(A10)
-Receives 21 v for programming XTAL1 19 22 P2.1(A9)
of the on chip EPROM. VSS 20 21 P2.0(A8)
PIN8051
Pin Configuration P1.0 1 40 VCC

OF 8051 P1.1
P1.2
2
3
39
38
P0.0(AD0)
P0.1(AD1)
P1.3 4 37 P0.2(AD2)
🠶 PSEN P1.4 5 36 P0.3(AD3)
P1.5 6 35 P0.4(AD4)
-Acts as a strobe to read the P1.6 7 34 P0.5(AD5)
external program memory. P1.7 8 33 P0.6(AD6)
-It is low during external program RST 9 32 P0.7(AD7)
(RXD)P3.0 10 31 EA/VPP
memory accesses.
(TXD)P3.1 11 30 ALE/PROG
🠶 Port 0 (P0.0-P0.7) (INT0)P3.2 12
8051 29 PSEN
-8 bit bidirectional bit addressable (INT1)P3.3 13 28 P2.7(A15)
(T0)P3.4 14 27 P2.6(A14)
I/O port.
(T1)P3.5 15 26 P2.5(A13)
- Allotted an address in SFR (WR)P3.6 16 25 P2.4(A12)
address range. (RD)P3.7 17 24 P2.3(A11)
-Act as Multiplexed A/D lines XTAL2 18 23 P2.2(A10)
during external memory access. XTAL1 19 22 P2.1(A9)
VSS 20 21 P2.0(A8)
PIN8051
Pin Configuration P1.0 1 40 VCC

OF 8051 P1.1
P1.2
2
3
39
38
P0.0(AD0)
P0.1(AD1)
P1.3 4 37 P0.2(AD2)
P1.4 5 36 P0.3(AD3)
🠶 Port 1 (P1.0-P1.7) P1.5 6 35 P0.4(AD4)
P1.6 7 34 P0.5(AD5)
-8 bit bidirectional bit addressable P1.7 8 33 P0.6(AD6)
port.
RST 9 32 P0.7(AD7)
- Allotted an address in SFR (RXD)P3.0 10 31 EA/VPP
address range. (TXD)P3.1 11 30 ALE/PROG
(INT0)P3.2 12
8051 29 PSEN
(INT1)P3.3 13 28 P2.7(A15)
🠶 Port 2 (P2.0-P2.7)
(T0)P3.4 14 27 P2.6(A14)
-During external memory, It emits (T1)P3.5 15 26 P2.5(A13)
higher 8 bits of address when (WR)P3.6 16 25 P2.4(A12)
ALE =1 & EA=0 . (RD)P3.7 17 24 P2.3(A11)
-Also receives higher order XTAL2 18 23 P2.2(A10)
address bit during programming of XTAL1 19 22 P2.1(A9)
on chip EPROM. VSS 20 21 P2.0(A8)
PIN8051
Pin Configuration P1.0 1 40 VCC

OF 8051 P1.1
P1.2
2
3
39
38
P0.0(AD0)
P0.1(AD1)
P1.3 4 37 P0.2(AD2)
P1.4 5 36 P0.3(AD3)
🠶 Port 3 (P3.0-P3.7) P1.5 6 35 P0.4(AD4)
P1.6 7 34 P0.5(AD5)
-8 bit bidirectional bit addressable P1.7 P0.6(AD6)
8 33
port. RST P0.7(AD7)
9 32
- Allotted an address in SFR (RXD)P3.0 10 31 EA/VPP
(TXD)P3.1 11 30 ALE/PROG
address range.
(INT0)P3.2 12
8051 29 PSEN
(INT1)P3.3 13 28 P2.7(A15)
🠶 XTAL1 & XTAL2 (T0)P3.4 14 27 P2.6(A14)
(T1)P3.5 15 26 P2.5(A13)
-A Crystal is to be connected (WR)P3.6 16 25 P2.4(A12)
externally between these two pins (RD)P3.7 17 24 P2.3(A11)
to complete the feedback path to XTAL2 18 23 P2.2(A10)
start oscillations. XTAL1 19 22 P2.1(A9)
- Controller can be operated on VSS 20 21 P2.0(A8)
external clock .
 The 8051 is a 40 pin device, but out

of these 40 pins, 32 are used for I/O

 Many pins of 8051 are used for

more than one function.


 32 I/O pins = 4 eight bit ports
= P0, P1, P2 and P3

 All ports are bidirectional

 Each ports consist of latch, an output

driver and an input buffer.


 40 pin DIP

 +5 volts DC.

 Among the 40 pins , 32 pins = four parallel ports P0, P1, P2


and P3 . Remaining pins are VCC, GND, XTAL1, XTAL2, RST, EA ,

PSEN, ALE.

 P0.0- P0.7(AD0-AD7) (32-39)

 The port 0 pins multiplexed with (low order byte) Address/data


pins .

 If the microcontroller is accessing external memory, these pins


will act as address/data pins otherwise, they are used for Port 0
pins.
 P1.0- P1.7 (1 – 8)

 These 8-pins are dedicated for Port 1 to perform input or


output port operations.

 P2.0- P2.7(A8-A15) (21-28)

 The port 2 pins are multiplexed with the higher order


address pins .

 When the microcontroller is accessing external memory


these pins provide the higher order address byte
otherwise they act as Port 2 pins.
 P3.0- P3.7 : (10- 17)
 These 8-pins are meant for Port3 operations and also for some
control operations like Read, Write, Timer0, Timer1, INT0,
INT1, RXD and TXD.

SYMBOL POSITION ALTERNATE USE


𝑅𝐷 P 3.7 External memory read signal
𝑊𝑅 P 3.6 External memory write signal
T1 P 3.5 External timer 1 input
T0 P 3.4 External timer 0 output
𝐼𝑁𝑇1 P 3.3 External interrupt 1 input
𝐼𝑁𝑇0 P 3.2 External interrupt 0 input
TXD P 3.1 Serial data output
RXD P 3.0 Serial data input
 Pin 40 & pin 20
 Pin 40 = Vcc = +5v
 Pin 20 = Vss = GND

 XTAL1(Pin 19), XTAL2(Pin 18)


 These two pins are connected to Quartz crystal oscillator
which runs the on-chip oscillator.
 For generating an internal clock signal, the external
oscillator is connected at these two pins.
 If we use a source other than the crystal oscillator, it will be
connected to XTAL1 and XTAL2 is left unconnected.
 ALE – pin 30(Address Latch Enable)

 This is an output pin, which is active high.

 When connected to external memory , port 0 provides both

address and data i.e address and data are multiplexed

through port 0 .

 This ALE pin will demultiplex the address and data bus

.When the pin is High , the AD bus will act as address bus

otherwise the AD bus will act as Data bus.


 RST – pin 9(RESET)
 The RESET pin is an input pin and it is an active high pin.
 When a high pulse is applied to this pin the microcontroller will reset
and terminate all activities.
 It held high at least for two machine cycles, while oscillator is running

 PSEN– pin 29(Program Store Enable) :


 This is an output pin which is active low.
 When the microcontroller is accessing the program code stored in the
external ROM, this pin is connected to the OE (Output Enable) pin of the
ROM.
 It is activated every six oscillator periods while reading external memory
 𝑬𝑨 – pin 31 (External Access):

 This pin is an active low pin.

 This pin is connected to ground when microcontroller is


accessing the program code stored in the external memory
and connected to Vcc when it is accessing the program
code in the on chip memory.

 This pin should not be left Unconnected.

You might also like