Chapter 2 Typical Embedded System
Chapter 2 Typical Embedded System
PROPRIETARY MATERIAL. © 2009 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed
in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill
for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission.
1
@ McGraw-Hill Education
Memory
Communication Interface
System
I/p Ports Core O/p Ports
(Sensors)
(Actuators)
Other supporting
Integrated Circuits &
subsystems
Embedded System
Real World 2
@ McGraw-Hill Education
The core of the embedded system falls into any one of the following
categories.
5
@ McGraw-Hill Education
6
@ McGraw-Hill Education
Microprocessor Microcontroller
A silicon chip representing a Central A microcontroller is a highly integrated chip that
Processing Unit (CPU), which is capable of contains a CPU, scratch pad RAM, Special and
performing arithmetic as well as logical General purpose Register Arrays, On Chip
operations according to a pre-defined set of ROM/FLASH memory for program storage, Timer
Instructions and Interrupt control units and dedicated I/O ports
It is a dependent unit. It requires the It is a self contained unit and it doesn’t require
combination of other chips like Timers, external Interrupt Controller, Timer, UART etc for
Program and data memory chips, Interrupt its functioning
controllers etc for functioning
Most of the time general purpose in design Mostly application oriented or domain specific
and operation
Doesn’t contain a built in I/O port. The I/O Most of the processors contain multiple built-in I/O
Port functionality needs to be implemented ports which can be operated as a single 8 or 16 or 32
with the help of external Programmable bit Port or as individual port pins
Peripheral Interface Chips like 8255
Targeted for high end market where Targeted for embedded market where performance is
performance is important not so critical (At present this demarcation is invalid)
Limited power saving options compared to Includes lot of power saving features
microcontrollers
7
@ McGraw-Hill Education
RISC CISC
Lesser no. of instructions Greater no. of Instructions
Instruction Pipelining and increased Generally no instruction pipelining feature
execution speed
Orthogonal Instruction Set (Allows each Non Orthogonal Instruction Set (All instructions are
instruction to operate on any register and use not allowed to operate on any register and use any
any addressing mode) addressing mode. It is instruction specific)
Operations are performed on registers only, Operations are performed on registers or memory
the only memory operations are load and depending on the instruction
store
Large number of registers are available Limited no. of general purpose registers
Programmer needs to write more code to Instructions are like macros in C language. A
execute a task since the instructions are programmer can achieve the desired functionality
simpler ones with a single instruction which in turn provides the
effect of using more simpler single instructions in
RISC
Single, Fixed length Instructions Variable length Instructions
Less Silicon usage and pin count More silicon usage since more additional decoder
logic is required to implement the complex
instruction decoding.
9
With Harvard Architecture Can be Harvard or Von-Neumann Architecture
@ McGraw-Hill Education
The terms Harvard and Von-Neumann refers to the processor architecture design.
Microprocessors/controllers based on the Von-Neumann architecture shares a single
common bus for fetching both instructions and data. Program instructions and data are
stored in a common main memory
Microprocessors/controllers based on the Harvard architecture will have separate data
bus and instruction bus. This allows the data transfer and program fetching to occur
simultaneously on both buses
With Harvard architecture, the data memory can be read and written while the program
memory is being accessed. These separated data memory and code memory buses allow
one instruction to execute while the next instruction is fetched (“Pre-fetching”)
Program
CPU Data Memory
Memory
11
@ McGraw-Hill Education
Endianness specifies the order in which the data is stored in the memory by
processor operations in a multi byte system (Processors whose word size is
greater than one byte). Suppose the word length is two byte then data can be
stored in memory in two different ways
Higher order of data byte at the higher memory and lower order of data byte at
location just below the higher memory
Lower order of data byte at the higher memory and higher order of data byte at
location just below the higher memory
Little-endian means the lower-order byte of the data is stored in memory
at the lowest address, and the higher-order byte at the highest address.
(The little end comes first)
Big-endian means the higher-order byte of the data is stored in memory at
the lowest address, and the lower-order byte at the highest address. (The
big end comes first.)
12
@ McGraw-Hill Education
Little-endian Operation
Big-endian Operation
13
@ McGraw-Hill Education
The RISC processor instruction set is orthogonal and it operates on registers. The
memory access related operations are performed by the special instructions
load and store. If the operand is specified as memory location, the content of it
is loaded to a register using the load instruction. The instruction store stores
data from a specified register to a specified memory location
R1 R2 R3
1 3 3 1
load R1, x
load R2, y 2
x 00 add R3, R1, R2 3
y 7F ALU 3
store R3, z 4
z 23
14
@ McGraw-Hill Education
18
@ McGraw-Hill Education
20
@ McGraw-Hill Education
21
@ McGraw-Hill Education
22
@ McGraw-Hill Education
24
@ McGraw-Hill Education
25
@ McGraw-Hill Education
26
@ McGraw-Hill Education
Read/Write
Memory (RAM)
27
@ McGraw-Hill Education
Q5 Q6
Q2 Q4
Vcc
Word Line
SRAM cell implementation 28
@ McGraw-Hill Education
Word Line
+
-
30
@ McGraw-Hill Education
31
@ McGraw-Hill Education
Eg. Hall Effect Sensor which measures the distance between the cushion and
magnet in the Smart Running shoes from adidas
Actuator:
A form of transducer device (mechanical or electrical) which converts signals to
corresponding physical action (motion). Actuator acts as an output device
Eg. Micro motor actuator which adjusts the position of the cushioning element in
the Smart Running shoes from adidas
32
@ McGraw-Hill Education
33
@ McGraw-Hill Education
R
low’ or ‘Charging of battery’ for a battery operated
handheld embedded devices
LED is a p-n junction diode and it contains an anode and a
cathode. For proper functioning of the LED, the anode of it
should be connected to +ve terminal of the supply voltage GND
and cathode to the –ve terminal of supply voltage
The current flowing through the LED must limited to a
value below the maximum current that it can conduct. A
resister is used in series between the power supply and the
resistor to limit the current through the LED
34
@ McGraw-Hill Education
DP G F E D C B A
Common Anode LED Display Cathode
36
@ McGraw-Hill Education
Vcc
38
@ McGraw-Hill Education
GND
M
of a stepper motor is controlled by changing the direction of C
current flow. Current in one direction flows through one coil
B D
and in the opposite direction flows through the other coil. It is
easy to shift the direction of rotation by just switching the GND
terminals to which the coils are connected
39
@ McGraw-Hill Education
A C B D
GND
N
GND
M
M
40
@ McGraw-Hill Education
Full Step:
In the full step mode both the phases are energized simultaneously. The coils A,
B, C and D are energized in the order
41
@ McGraw-Hill Education
Wave Step:
only one phase is energized at a time and each coils of the phase are energized
alternatively. The coils A, B, C and D are energized in the order
42
@ McGraw-Hill Education
Half Step:
Half step uses the combination of wave and full step. It has the highest torque
and stability. The coils A, B, C and D are energized in the order
The rotation of the stepper motor can be reversed by reversing the order in
43
which the coil is energized
@ McGraw-Hill Education
Port Pins A
M
Driver IC C
Microcontroller
ULN2803 B D
Vcc
GND Vcc
44
@ McGraw-Hill Education
Relay Coil
Relay Coil
Relay Coil
Vcc
Freewheeling Diode
Relay Unit
46
@ McGraw-Hill Education
48
@ McGraw-Hill Education
4.7K
4.7K
4.7K
4.7K
Row 0
To Microcontroller/processor Port
Row 1
Row 2
Row 3
Column 1
Column 0
Column 3
Column 2
To Microcontroller/processor Port
49
@ McGraw-Hill Education
D7 D6 D5 D4 D3 D2 D1 D0
Control Register
50
@ McGraw-Hill Education
Processor/
82C55A
Controller Data Bus D0….D7 D0….D7
Data Bus Port
Pins 34 to 27
Latch
A0 Pin 9
(Eg: 74LS373) PA0….PA7
A1 Pin 8
Port A
ALE
A2….A7 PB0….PB7
Port B
Higher Order
Address Bus Address Bus Address
(A8….A15) CS\ Pin 6
decoder PC0….PC7
Port C
RD\ RD\ Pin 5
WR\ WR\ Pin 36
RESET OUT RESET Pin 35
52
@ McGraw-Hill Education
SDA
2.2K
Port Pins SCL
Slave 1
SCL I2C Device
Master SDA (Eg: Serial
(Microprocessor/ EEPROM)
Controller)
SCL Slave 2
SDA I2C Device
I2C Bus
55
@ McGraw-Hill Education
Master Out Slave In (MOSI): Signal line carrying the data from master to slave device.
It is also known as Slave Input/Slave Data In
(SI/SDI)
Master In Slave Out (MISO): Signal line carrying the data from slave to master device.
It is also known as Slave Output (SO/SDO)
Serial Clock (SCLK): Signal line carrying the clock signals
Slave Select (SS): Signal line for slave device select. It is an active low
signal
57
@ McGraw-Hill Education
MISO
SCL
MOSI MOSI Slave 1
SCL SPI Device
Master
MISO (Eg: Serial
(Microprocessor/
SS\ EEPROM)
Controller)
SS1\
SS2\
MOSI
Slave 2
SCL
SPI Device
MISO
(Eg: LCD)
SS\
SPI Bus
58
@ McGraw-Hill Education
59
@ McGraw-Hill Education
TXD TXD
UART UART
RXD RXD
61
@ McGraw-Hill Education
62
@ McGraw-Hill Education
Vcc
4.7K
DQ Slave 1
Port Pin
1-Wire Device
(Eg: DS2760 Battery
GND
monitor IC )
Master
(Microprocessor/
Controller) DQ Slave 2
1-Wire Device
(Eg: DS2431 1024
GND GND
Bit EEPROM )
63
@ McGraw-Hill Education
66
@ McGraw-Hill Education
D0 to Data Bus
Dx-1 Peripheral Device
RD\ RD\ (Eg: ADC)
WR\ WR\
Host Control Signals CS\
(Microprocessor/
Controller) Chip Select
67
@ McGraw-Hill Education
6 9 14 25
DB-25
68
DB-9
@ McGraw-Hill Education
Pin No:
Pin Name (For DB-9 Description
Connector)
TXD 3 Transmit Pin. Used for Transmitting Serial Data
RXD 2 Receive Pin. Used for Receiving serial Data
RTS 7 Request to send.
CTS 8 Clear To Send
DSR 6 Data Set ready
GND 5 Signal Ground
DCD 1 Data Carrier Detect
DTR 4 Data Terminal Ready
RI 9 Ring Indicator
69
@ McGraw-Hill Education
73
@ McGraw-Hill Education
76
@ McGraw-Hill Education
77
@ McGraw-Hill Education
Wi-Fi Router
Device 1
Device 2 Device 3
81
@ McGraw-Hill Education
84
@ McGraw-Hill Education
85
@ McGraw-Hill Education
Vz
the threshold voltage R3
Certain processors/controllers support built in brown-
out protection circuit which monitors the supply GND
voltage internally
If the processor/controller doesn’t integrate a built-in
brown-out protection circuit, the same can be
implemented using external passive circuits or
supervisor ICs 87
@ McGraw-Hill Education
Microcontroller Microprocessor
C : Capacitor
Y : Resonator
Crystal Oscillator
Oscillator
Unit
Quartz Crystal Clock Input Pin
Resonator C C
Y Oscillator
Unit 88
@ McGraw-Hill Education
Microoprocessor/
Controller
Watchdog
Free Running
Reset Pin
Counter
Watchdog Reset
System Clock
91