1. By: Ritesh Maheshwari
3rd
Yr student of Electronics Instr. & Control Engg.
Spring 2007
“In the name of God”
GIT Student Of EIC Branch Presents:
Seminar On
2. Embedded Systems
What is an Embedded System?
Where are Embedded Systems used?
Typical Embedded Systems Hardware
Embedded OS and Software
Why study Embedded System?
Microprocessors
Microcontrollers
The 8051 Microcontroller
A simple project using AT89C51
References
4. A specialized computer system that is part of a larger system or machine.
Typically, 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.
Some embedded systems include an operating system, but many are so
specialized that the entire logic can be implemented as a single program.
5. It is specially designed to perform a few tasks in the most
efficient way.
Interacts with physical elements in our environment viz.,
controlling & driving a motor, sensing temperature etc. i.e.
“ An embedded system can
be defined as those control systems which are
designed either by microprocessor or microcontroller
for a specific tasks. ”
OR
“ An embedded system is
some combination of computer hardware & software,
either fixed in capability or programmable, that is
specifically designed for a particular kind of application
device. ”
6. Where are Embedded Systems used?
Signal processing systems
Real-time video, DVD players, Medical equipment.
Distributed control
Network routers, switches, firewalls, mass transit systems, Elevators
“Small” systems
Mobile phones, pagers, home appliances, toys, smartcards, MP3 players,
PDAs, digital cameras, sensors, pc keyboard & mouse
Modern cars: Up to 100 or more processors
Engine control unit
ABS systems (Anti Lock Brake systems)
Emissions control
Diagnostics and Security systems
Accessories (doors, windows etc)
7. EMBEDDED SYSTEM IN DAILY LIFE
Washing machine
cell phone
microWave oven
sensor based Washbasin
9. Typical Embedded Systems Hardware
Commercial off-the-shelf components (COTS)
e.g. wireless radios, sensors, I/O devices
Cheap
Application-Specific ICs (ASICs)
ICs tailored to meet application needs
Good performance for their intended task(s)
Original ESs were ASICs only
Domain-specific processors
DSPs
Microcontrollers
Microprocessors
General Purpose Processors
10. Embedded Operating Systems:
Office-style OSes
PalmOS
WindowsCE
RTOSes
VxWorks
QNX
Linux
Linux is already ubiquitous
Hundreds of different devices are using it
http://www.linuxdevices.com/articles/AT4936596231.html
Numerous commercial + open source products
Mobile OS
Symbian
Others
TinyOS
11. Why Study Embedded Systems?
• Embedded systems are playing important roles in our livesEmbedded systems are playing important roles in our lives
every day, even though they might not necessarily be visible.every day, even though they might not necessarily be visible.
• Some of the embedded systems we use every day control theSome of the embedded systems we use every day control the
menu system on television, the timer in a microwave oven, a cellmenu system on television, the timer in a microwave oven, a cell
phone, an MP3 player or any other device with some amount ofphone, an MP3 player or any other device with some amount of
intelligence built-in.intelligence built-in.
• In fact, recent poll data shows that embedded computerIn fact, recent poll data shows that embedded computer
systems currently outnumber humans in the USA.systems currently outnumber humans in the USA.
• Embedded systems is a rapidly growing industry where growthEmbedded systems is a rapidly growing industry where growth
opportunities are numerous.opportunities are numerous.
12. CPU
General-
Purpose
Micro-
processor
RAM ROM I/O
Port
Timer
Serial
COM
Port
Data Bus
Address Bus
General-Purpose Microprocessor System
CPU for Computers
No RAM, ROM, I/O on CPU chip itself
Example--Intel’s x86: 8086,8088,80386,80486, Pentium
Motorola’s 680x0: 68000, 68010, 68020,68030,6040
Many chips on mother board
General-purpose microprocessor
13. Microprocessor
A microprocessor is a programmable digital electronic
component that incorporates the functions of a central
processing unit (CPU) on a single semiconducting integrated
circuit (IC).
The prime use of a microprocessor is to read data, perform
extensive calculations on that data, and store those
calculations in a mass storage device or display the results for
human use.
The programs used by the microprocessors are stored in the
mass storage device & loaded into RAM as the user directs.
15. Microcontroller
An embedded microcontroller is a microcomputer that
contains most of its peripherals & required memory inside
a single integrated circuit along with the CPU.
They have a high concentration of on-chip facilities such
as serial ports, parallel input/output ports, timers,
counters, interrupt control, analog-to-digital converters,
random access memory, read only memory, etc.
The prime use of a microcontroller is to control the
operation of a machine using fixed program that is stored
in ROM & that does not change over the lifetime of the
system.
16. Microcontroller
Uses:
1. Microcontrollers have become common in many areas, and
can be found in home appliances, computer equipment, and
instrumentation.
2. They are often used in automobiles, and have many industrial
uses as well, and have become a central part of industrial
robotics.
3. Because they are usually used to control a single process and
execute simple instructions, microcontrollers do not require
significant processing power.
17. Uses conti…..
4. Microcontrollers are hidden inside a surprising
number of products these days.
5. If your microwave oven has an LED or LCD screen
and a keypad, it contains a microcontroller.
6. All modern automobiles contain at least one
microcontroller. The engine is controlled by a
microcontroller, as are the anti-lock brakes, the cruise
control and so on..
18. 1. Meeting the computing needs of the task efficiently and cost
effectively
• speed, the amount of ROM and RAM, the number of I/O
ports and timers, size, packaging, power consumption
• easy to upgrade
• cost per unit
2. Availability of software development tools
• assemblers, debuggers, C compilers, emulator, simulator,
technical support
3. Wide availability and reliable sources of the microcontrollers.
Three criteria in Choosing a Microcontroller
19. The necessary tools for a
microprocessor/controller
CPU: Central Processing Unit
I/O: Input /Output
Bus: Address bus & Data bus
Memory: RAM & ROM
Timer
Interrupt
Serial Port
Parallel Port
20. Why do we need to learn
Microprocessors/controllers?
The microprocessor is the core of computer
systems.
Nowadays many communication, digital
entertainment, portable devices, are
controlled by them.
A designer should know what types of
components he needs, ways to reduce
production costs and product reliable.
21. Microprocessor
CPU is stand-alone, RAM,
ROM, I/O, timer are
separate
designer can decide on the
amount of ROM, RAM and
I/O ports.
expansive
versatility
general-purpose
Ex. 8085,8086 mp, Motorola
6800, Intel’s 8086, etc.
Microcontroller
• CPU, RAM, ROM, I/O and
timer are all on a single chip
• fix amount of on-chip ROM,
RAM, I/O ports
• for applications in which cost,
power and space are critical
• single-purpose
• Ex. 8051, PIC mc, Motorola
MC’s, Phillips, etc.
Microprocessor v/s Microcontroller
22.
23. The 8051 Microcontroller:
The 8051 is the first microcontroller of the MCS-51 family
introduced by Intel Corporation at the end of the 1970’s.
The 8051 family characteristics:
4K Bytes ROM
128 Bytes RAM
two timer/counters (16 bit)
A serial port
4 general purpose parallel input/output port
Interrupt controller
The 8051 can address 64K of external data memory and
64K of External program memory.
39. Timers/Counters
A timer is a counter that is increased with every time an
instruction is executed e.g. 8051 with 12MHz increases a
counter every 1.085 µs
General 8051 has 3 timer:
Two 16-bit timer
One 16-bit timer with extra-functionality (introduced with
the 8052)
The counters are divided into two 8-Bit registers called the
timer low (TL0, TL1) and high (TH0, TH1) bytes.
All counters action is controlled by bit states in the timer
mode control register (TMOD), the timer/counter control
register (TCON), and certain program instructions.
40. Timers/counters
Timer: measures time intervals
To generate timed output events
e.g., hold traffic light green for 10 s
To measure input events
e.g., measure a car’s speed
Based on counting clock pulses
E.g., let Clk period be 10 ns
And we count 20,000 Clk pulses
Then 200 microseconds have passed
16-bit counter would count up to 65,535*10
ns = 655.35 microsecond., resolution = 10 ns
Top: indicates top count reached, wrap-
around
16-bit up
counter
Clk
Cnt
Basic timer
Top
Reset
16
41. Counters
Counter: like a timer, but
counts pulses on a general
input signal rather than clock
e.g., count cars passing over a
sensor
Can often configure device as
either a timer or counter
16-bit up
counter
Clk
16
Cnt_in
2x1
mux
Mode
Timer/counter
Top
Reset
Cnt
42.
43. TMOD Register:
Gate : When set, timer only runs while INT(0,1) is high.
C/T : Counter/Timer select bit.
M1 : Mode bit 1.
M0 : Mode bit 0.
44. TF1: Timer 1 overflow flag.
TR1: Timer 1 run control bit.
TF0: Timer 0 overflag.
TR0: Timer 0 run control bit.
IE1: External interrupt 1 edge flag.
IT1: External interrupt 1 type flag.
IE0: External interrupt 0 edge flag.
IT0: External interrupt 0 type flag.
51. We can Interfaced a number of modules
such as
» LED and 7-segment Display
» LCD
» Keyboard
» Real Time Clock (RTC)
» DAC
» ADC
» Sensors
» EEPROM
» RS-232
52. Light Emitting diode
It is single light display that include incandescent
and are treated as single binary points to be
switched off and on by program instructions
.
It has two pins, first is connected to port and
second one is grounded (vss).
It requires a high logic to glow from the port pin.
54. Seven-segment displays commonly contain LED
segments which arranged as an 8 with a common
lead (cathode or anode) and 7 individual leads for
each segment.
Block Diagram shows a common cathode type of
segment
In common cathode to lit a segment a high input
logic is required.
In common anode to lit a segment a low input logic
is required.
56. LCD
It is an Intelligent Alphanumeric display which can
be used to display numbers, characters, and graphics.
It has 14 pins as shown in pin diagram.
Display contains 2 internal byte wide registers, one
for command (RS=0) and one for display (RS=1).
There are certain commands to be send to the Lcd
for making some setting such as clear screen, force
the cursor to home position and blink the cursor.
R/W pin is set to 1 for reading and to 0 for writing.
EN pin is set to 1 for enabling display.
DB0-DB7 are pins for 8-bit data bus.
57. Interfacing LCD with 8051
8051
^^^^^^
4×16 Character LCD Display
E RS R/W VeeGnd Vcc
+5v
10k
D0
D7
P1.0
P1.7
P2.0
P2.1
P2.2
63. Interrupt Handling
Code that deals with
interrupts: Interrupt
Handler or Interrupt
Service Routines (ISRs)
Address space in
code space
64. Interrupt OverheadsInterrupt arrives
Complete current instruction
Save essential register information
Vector to ISR
Save additional register information
Execute body of ISR
Restore other register information
Return from interrupt and restore essential
registers
Resume task
Interrupt
Latency
Interrupt
Termination
68. Summary: InterruptsDefinition of ‘Interrupt’:
Event that disrupts the normal execution
of a program and causes the execution of
special instructions
Handling can be enabled/disabled
Prioritized
Internal or External
External Interrupts:
Level-triggered
Edge-triggered
8051: 3 timer interrupts, 2 external
interrupts & a serial port interrupt
threshold
Level-triggered
Edge-triggered
trigger point
trigger point
t
t
69.
70.
71. • In this project we try to give the same prototype for this type of trains.
•The train is designed for three stations, named as Jaipur railway station,
Sitapura & GIT College.
• The stoppage time is of 3 sec & time between two consecutive stations is 6
sec.
• There are indicators, which are used to show the train direction i.e. UP path &
Down path.
• Before stopping at station the train blows the buzzer.
• It also includes an emergency brake system due to which the train stops as
soon as the brakes are applied and resumes journey when the emergency situation
is over.
• The coding of the metro train prototype is given in the assembly language.
72. Why we choose this project ?
Our approach is to gain knowledge of Interfacing different
devices with Microcontroller for useful applications and to
fulfill the Hardware Module requirement of college
authorities.
This is such a project which can be used to perform any
kind of application depend on the modules which are
interfaced.
These leads us to Microcontroller Based Embedded
System.
73. Applications
By interfacing STEPPER MOTOR with Microcontroller, we
can make the trainer kit which controls the motion of
train.
We can also generate various types of waves such as
square, triangular and saw tooth in accordance with the
programme fed in 8051, 89c51, etc. chip.
Initially we interfaced LED, 7-segment and Keyboard and
check programme which is the purpose of trainer Kit.
In these way we go step by step for each module interface
and accomplish the goal of making a well-functioning
Trainer Kit.
Finally we will add some features by interfacing Sensors