Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 47

CS 404 Embedded Systems

Module 1
Introduction to Embedded System: Understanding the Basic Concepts, the Typical
Embedded System – Characteristics and Quality attributes.(6)
1.1 Introduction to Embedded System
 An ES is an electronic/electro-mechanical system designed to perform a specific
function. And a combination of both hardware and firmware (software).
 Every ES is Unique and hardware as well as the firmware is highly specialized to the
application domain
 ES are becoming an inevitable part of any product or equipment in all fields including
household appliances, telecommunications, medical equipment, industrial control,
consumer products, etc.
Embedded Systems - Classification based on Generation

 First Generation: The early embedded systems built around 8-bit microprocessors like
8085 and Z80 and 4-bit microcontrollers
EX. stepper motor control units, Digital Telephone Keypads etc.

 Second Generation: Embedded Systems built around 16-bit microprocessors and 8 or


16-bit microcontrollers, following the first generation embedded systems
 EX.SCADA, Data Acquisition Systems etc.

 Third Generation: Embedded Systems built around high performance 16/32 bit
Microprocessors/controllers, Application Specific Instruction set processors like Digital
Signal Processors (DSPs), and Application Specific Integrated Circuits
(ASICs).Theinstruction set is complex and powerful.
 EX. Robotics, industrial process control, networking etc

 Fourth Generation: Embedded Systems built around System on Chips (SoC’s), Re-
configurable processors and multicore processors. It brings high performance, tight
integration and miniaturization into the embedded device market
 EX Smart phone devices, MIDs etc

Embedded Systems - Classification based on Complexity & Performance

 Small Scale: The embedded systems built around low performance and low cost 8 or
16 bit microprocessors/ microcontrollers. It is suitable for simple applications and
where performance is not time critical. It may or may not contain OS.
 Medium Scale: Embedded Systems built around medium performance, low cost 16
or 32 bit microprocessors / microcontrollers or DSPs. These are slightly complex in
hardware and firmware. It may contain GPOS/RTOS.
1
 Large Scale/Complex: Embedded Systems built around high performance 32 or 64
bit RISC processors/controllers, RSoC or multi-core processors and PLD. It requires
complex hardware and software. These system may contain multiple
processors/controllers and co-units/hardware accelerators for offloading the
processing requirements from the main processor. It contains RTOS for scheduling,
prioritization and management

Embedded Systems - Classification Based on deterministic behavior:

It is applicable for Real Time systems. The application/task execution behavior for an
embedded system can be either deterministic or non-deterministic

 These are classified in to two types


1. Soft Real time Systems: Missing a deadline may not be critical and can be
tolerated to a certain degree
2. Hard Real time systems: Missing a program/task execution time deadline can
have catastrophic consequences (financial, human loss of life, etc.)

Embedded Systems - Classification Based on Triggering:

These are classified into two types

Event Triggered : Activities within the system (e.g., task run-times) are dynamic and
depend upon occurrence of different events .
Time triggered: Activities within the system follow a statically computed schedule (i.e.,
they are allocated time slots during which they can take place) and thus by nature are
predictable
1.1.1 Comparison of ES & General Purpose Computing System

Criteria General Purpose Computer Embedded System


Contents A system which is a combination of aA system which is a combination of special
generic hardware and a Generalpurpose hardware and embedded
Purpose Operating System forOS/firmware for executing a specific set of
executing a variety of applications. applications

OS It contains a general It may or not contain an OS


purpose operating system (GPOS). for functioning.
Alterations Applications are alterable by the user. Applications are not-alterable by
the user.
Key factor Performance is key factor. Application specific requirements are key
factors.
Power More Less
Consumption
2
Response Time Not critical Critical for some applications

Execution Need not be deterministic Deterministic for certain types of ES like


‘Hard Real Time’ systems.

1.1.2 Major Application Areas of ES

1. Consumer electronics: Camcorders, cameras, etc.


2. Household appliances: Television, DVD players, washing machine, fridge, microwave
oven, etc.
3. Home automation and security systems: Air conditioners, sprinklers, intruder detection
alarms, closed circuit television cameras, fire alarms, etc.
4. Automotive industry: Anti-lock breaking systems (ABS), engine
control ignition systems,automatic navigation systems etc
5. Telecom: telephones,telephone switches, handset, multimedia applications,
etc.
6. Computer peripherals: Printers, scanners, fax machines, etc.
7. Computer Networking systems: Network routers, switches,
hubs, firewalls, etc.
8. Healthcare: Different kinds of scanners, EEG, ECG machines etc.
9. Measurement & Instrumentation: Digital multi meters, digital CROs, logic analyzers PLC
systems, etc.
10. Banking & Retail: Automatic teller machines (ATM) and currency counters, point of
sales (POS).
11. Card Readers: Barcode, smart card readers, hand held devices, etc

1.1.3 Purpose of ES

 Each embedded system is designed to serve the purpose of any one or a combination of
the following tasks:
1. Data collection/Storage/Representation
2. Data Communication
3. Data (signal) processing
4. Monitoring
5. Control
6. Application specific user interface

 Data Collection/Storage/Representation
 Embedded systems designed for the purpose of data collection performs
acquisition of data from the external world.
 Data collection is usually done for storage, analysis, manipulation and
transmission.
 Data can be either analog (continuous) or digital (discrete).

3
 Embedded systems with analog data capturing techniques collect data directly in
the form of analog signal whereas embedded systems with digital data collection
mechanism converts the analog signal to the digital signal using analog to digital
(A/D) converters and then collects the binary equivalent of the analog data.
 If the data is digital, it can be directly captured without any additional interface
by digital embedded systems.
 A digital camera is a typical example of an embedded system with data
collection/storage/representation of data.
 Images are captured and the captured image may be stored within the memory of
the camera. The captured image can also be presented to the user through a
graphic LCD unit.
 Data Communication
 Embedded data communication systems are deployed in applications ranging
from complex satellite communication systems to simple home networking
systems.
 The transmission is achieved either by a wire-line medium or by a wire-less
medium.
 Data can either be transmitted by analog means or by digital means.
 The data collecting embedded terminal itself can incorporate data communication
units like Wireless modules (Bluetooth, ZigBee, Wi- Fi, EDGE, GPRS, etc.) or
wire-line modules (RS-232C, USB, TCP/IP, PS2,etc).
 Network hubs, routers, switches, etc. are typical examples
of dedicated data transmission embedded systems.
 Data (Signal) Processing
 Embedded systems with
signal processing functionalities are employed in applications demanding signal
processing like speech coding, synthesis, audio video codec, transmission
applications, etc.
 A digital hearing aid is a typical example of an embedded system employing data
processing.
 Digital hearing aid improves the hearing capacity
of hearing impaired persons.
 Monitoring
 Almost all embedded products coming under the medical domain are with
monitoring functions only.
 Electro cardiogram machine (ECG) is intended to do the monitoring of the
heartbeat of a patient but it cannot impose control over the heartbeat.
 Other examples with monitoring function are digital CRO, digital multimeters,
and logic analyzers.
 Control
 A system with control functionality contains both sensors and actuators.
 Sensors are connected to the input port for capturing the changes in environmental
variable or measuring variable.
4
 The actuators connected to the output port are controlled according to the
changes in the input variable.
 Air conditioner system used in our home to control the room temperature to a
specified limit is a typical example for ES for CONTROL purpose.
 Applications specific user interface
 Buttons, switches, keypad, lights, speakers, display units, etc. are application-
specific user interfaces.
 Mobile phone is an example of application specific user interface.
 In mobile phone the user interface is provided through the keypad, graphic LCD
module, system speaker, vibration alert, etc.

1.2 Typical Embedded System


 A typical embedded system contains a single chip controller, which acts as the master
brain of the system.

 The controller can be a Microprocessor or a microcontroller or a Field Programmable


Gate Array (FPGA) device or a Digital Signal Processor (DSP) or an Application
Specific Integrated Circuit (ASIC)/ Application Specific Standard Product (ASSP).

 Embedded hardware/software systems are basically designed to regulate a physical


variable or to manipulate the state of some devices by sending some control signals to
the Actuators or devices connected to the o/p ports of the system, in response to the input
signals provided by the end users or Sensors which are connected to the input ports.

 Keyboards, push button switches, etc. are examples for common user interface input
devices whereas LEDs, liquid crystal displays, piezoelectric buzzers, etc. are examples
for common user interface output devices for a typical embedded system.

 For example, if the embedded system is designed for any handheld application, such as a
mobile handset application, then the system should contain user interfaces like a
keyboard for performing input operations and display unit for providing users the status
of various activities in progress.

5
1.2.1 Core of Embedded Systems
The core of the embedded system falls into any of the following categories:

1. General Purpose and Domain Specific Processors


i. Microprocessors
ii. Microcontrollers
iii. Digital Signal Processors
2. Application Specific Integrated Circuits (ASICs)
3. Programmable Logic Devices (PLDs)
4. Commercial off-the-shelf Components (COTS)

i. General Purpose and Domain Specific Processors

a. Microcontrollers and Microprocessors

A microprocessor is a silicon chip representing a central processing unit.A


microprocessor is a dependent unit and it requires the combination of other hardware like
memory, timer unit, and interrupt controller, etc. for proper functioning. A microcontroller is a
highly integrated chip that contains a CPU, scratch pad RAM, special and general purpose
register arrays,on chip ROM/FLASH memory for program storage , timer and interrupt control
units and dedicated I/O ports.

6
 Microcontrollers are designed to perform specific tasks. Microprocessors are
designed to perform unspecific tasks like developing software, games, website, photo
editing, creating documents, etc.

 Depending on the input, some processing for microcontroller needs to be done and
output is defined. However, the relationship between input and output for microprocessor
is not defined.

 Since the applications of microcontroller are very specific, they need small resources like
RAM, ROM, I/O ports etc. and hence can be embedded on a single chip.
Microprocessors need high amount of resources like RAM, ROM, I/O ports etc.

 The clock speed of Microprocessor is quite high as compared to the


microcontroller. Whereas the microcontrollers operate from a few MHz (from 30 to 50
MHz), today’s microprocessor operate above 1 GHz as they perform complex tasks.

 Microprocessor cannot be used stand alone. They need other peripherals like RAM,
ROM, buffer, I/O ports etc and hence a system designed around a microprocessor is quite
costly.

 Application areas of microcontroller: Mobile phones, CD/DVD players, Washing


machines, Cameras, Security alarms, microwave oven, etc.

 Application areas of microprocessor: Calculators, Accounting Systems, Games Machine,


Complex Industrial Controllers, Data Acquisition Systems, Military applications,
Communication systems, etc.

7
b. Digital Signal Processors

 DSPs are powerful special purpose 8/16/32 bit microprocessors designed specifically
to meet the computational demands and power constraints of today’s embedded audio,
video, and communications applications.

 Digital signal processors are 2 to 3 times faster than the general


purpose microprocessors in signal processing applications.

 A typical digital signal processor incorporates the following key units:

i. Program Memory: Memory for storing the program required by DSP to process
the data.
ii. Data Memory: Working memory for storing temporary variables/information and
data/signal to be processed.
iii. Computational Engine: Performs the signal/math processing , accessing the
program from the Program Memory and the data from the Data Memory.
iv. I/O Unit : Acts as an interface between the outside world and DSP. It is
responsible for capturing signals to be processed and delivering the processed
signals.

8
Application areas : Audio video signal processing, telecommunication and multimedia
applications. DSP employs a large amount of real-time calculations, Sum of products
(SOP) calculation, convolution, fast Fourier transform (FFT), discrete Fourier
transform (DFT), etc. are some of the operations performed by digital signal
processors.

c. RISC vs CISC Processors/Controllers

RISC CISC
Lesser number of instructions Greater number of Instructions
Instruction pipelining and increased Generally no instruction pipelining
execution speed feature

Orthogonal instruction set Non-orthogonal instruction set


Operations are performed on registers Operations are performed on registers or memory
only, the only memory operations are load depending on the instruction.
and store.
A large number of registers are available. Limited number 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.

With Harvard Architecture Can be Harvard or Von-Neumann


Architecture

9
d. Harvard vs Von-Neumann Processor

Microprocessors/controllers based on the Von-Neumann architecture shares a single


common bus for fetching both instructions and data. Single bus is used for both data
transfers and instruction fetches, and therefore data transfers and instruction fetches must
be scheduled - they cannot be performed at the same time. Harvard architecture has
separate data and instruction busses, allowing transfers to be performed simultaneously
on both bus.

Harvard architecture Von-Neumann architecture

1. It has separate buses for 1. It shares single common bus


instruction as well as data for Instruction and
fetching. fetching.

2. Easier to pipeline, so high 2. Low performance As


performance can be achieve. compared to Harvard
architecture.
3. Comparatively high cost. 3. It is cheaper.
4. Since data memory and 4. Accidental corruption Of
program memory are stored program memory may occur if
physically in different locations, data memory and program
no chances exist for accidental memory are stored physically
corruption of program memory. in the same chip

e. Big-Endian vs Little Endian Processor

 Endianness specifies the order in which a sequence of bytes are stored in computer
memory.

10
 Little-endian is an order in which the “little end”/ the lower-order byte of the data
(least significant value in the sequence) is stored in memory at the lowest address.
(The little end comes first.)
 For example, a 4 byte long integer Byte3, Byte2, Byte1, Byte0 will be stored in the
memory as shown

Base Address+0 Byte 0 Byte 0

Base Address+1 Byte 1 Byte 1

Base Address+2 Byte 2 Byte 2

Base Address+3 Byte 3 Byte 3


Example : 90AB12CD (Hexadecimal)

 Big-endian is an order in which the “big end” / the higher-order byte of the data
(most significant value in sequence) is stored in memory at the lowest address. (The big
end comes first.)

 For example, a 4 byte long integer Byte3, Byte2, Byte1, Byte0 will be stored in the
memory as shown below:

Base Address+0 Byte 3 Byte 3

Base Address+1 Byte 2 Byte 2

Base Address+2 Byte 1 Byte 1

Base Address+3 Byte 0 Byte 0

Example : 90AB12CD (Hexadecimal)

11
2. Application Specific Integrated Circuits (ASICs)

 ASICs is a microchip design to perform a specific and unique applications.


 Because of using single chip for integrates several functions there by reduces the
system development cost.
 Most of the ASICs are proprietary (which having some trade name) products, it is
referred as Application Specific Standard Products(ASSP).
 As a single chip ASIC consumes a very small area in the total system. Thereby helps
in the design of smaller system with high capabilities or functionalities.

3. Programmable Logic Devices (PLDs)

 A PLD is an electronic component. It used to build digital circuits which are


reconfigurable.
 A logic gate has a fixed function but a PLD does not have a defined function at the
time of manufacture.
 PLDs offer customers a wide range of logic capacity, features, speed, voltage
characteristics.
 PLDs can be reconfigured to perform any number of functions at any time.
 A variety of tools are available for the designers of PLDs which are inexpensive and
help to develop, simulate and test the designs.
 PLDs having following two major types.
1) CPLD(Complex Programmable Logic Device):

CPLDs offer much smaller amount of logic up to 1000 gates.


2) FPGAs(Field Programmable Gate Arrays):

It offers highest amount of performance as well as highest logic


density, the most features.
Advantages of PLDs :-
1. PLDs offer customer much more flexibility during the design cycle.

12
2. PLDs do not require long lead times for prototypes or production parts
because PLDs are already on a distributors shelf and ready for
shipment.
3. PLDs can be reprogrammed even after a piece of equipment is shipped
to a customer

4. Commercial off-the-shelf Components (COTS)

 A Commercial off the Shelf product is one which is used 'as-is'.


 The COTS components itself may be develop around a general purpose or domain
specific processor or an ASICs or a PLDs.
 The major advantage of using COTS is that they are readily available in the market,
are chip and a developer can cut down his/her development time to a great extent
 The major drawback of using COTS components in embedded design is that the
manufacturer of the COTS component may withdraw the product or discontinue the
production of the COTS at any time if rapid change in technology occurs.
Advantages of COTS:
 Ready to use
 Easy to integrate
 Reduces development time
Disadvantages of COTS:
 No operational or manufacturing standard (all proprietary)
 Vendor or manufacturer may discontinue production of a particular COTS product

1.3 Memory
 Memory is an important part of a processor/controller based embedded systems.
 Some of the processors/controllers contain built in memory and this
 memory is referred as on-chip memory.
 Others do not contain any memory inside the chip and requires external memory
to be connected with the controller/processor to store the control algorithm. It is
called off-chip memory.

13
 There are different types of memory used in embedded system applications:

i. Program Storage Memory (ROM)


 Masked ROM (MROM)
 Programmable Read Only Memory (PROM)/ (OTP)
 Erasable Programmable Read Only Memory (EPROM)
 Electrically Erasable Programmable Read Only Memory (EEPROM)
 FLASH
ii. Read-Write Memory/Random Access Memory (RAM)
 Static RAM (SRAM)
 Dynamic RAM (DRAM)
 NVRAM

i. Program Storage Memory (ROM)

 The program memory or code storage memory of an embedded system stores the
program instructions and it can be classified into different types as shown

 The code memory retains its contents even after the power to it is turned off. It is
generally known as non- volatile storage memory.

14
 Depending on the fabrication, erasing and programming techniques they are classified
into the following types.

Classification of ROM

 Mask ROM : Masked ROM is a static ROM which comes programmed into an
integrated circuit by its manufacturer. Masked ROM makes use of the hardwired
technology for storing data. It is a good candidate for storing the embedded firmware for
low cost embedded devices. The primary advantage of this is low cost for high volume
production. The limitation with MROM based firmware storage is the inability to modify
the device firmware against firmware upgrades. They are used in network operating
systems, server operating systems, storing of fonts for laser printers, sound data in
electronic musical instruments.

 PROM/ OTP : Unlike MROM, One Time Programmable Memory (OTP) or PROM is
not pre-programmed by the manufacturer. The end user is responsible for programming
these devices. They have several different applications, including cell phones, video
game consoles, RFID tags, medical devices, and other electronics.

 EPROM : EPROM gives the flexibility to re-program the same chip. EPROM stores the
bit information by charging the floating gate of an FET and contains a quartz crystal
window for erasing the stored information. Even though the EPROM chip is flexible in
terms of re- programmability, it needs to be taken out of the circuit board and put in a
UV eraser device for 20 to 30 minutes. So it is a tedious and time-consuming process.

 EEPROM : The information contained in the EEPROM memory can be altered by using
electrical signal at the register/Byte level. They can be erased and reprogrammed in-
circuit. These chips include a chip erase mode and in this mode they can be erased in a
few milliseconds. It provides greater flexibility for system design. The only limitation is
their capacity is limited when compared with the standard ROM (a few kilobytes). It is
used for storing the computer system BIOS.

 FLASH : It is an enhanced version of EEPROM. It combines the re-programmability


of EEPROM and the high capacity of standard ROMs. FLASH memory is organized as
sectors (blocks) or pages. FLASH memory stores information in an array of floating gate
MOS-FET transistors. The erasing of memory can be done at sector level or page level
without affecting the other sectors or pages. Each sector/ page should be erased before
re-programming. The typical erasable capacity of FLASH is 1000 cycles. Many modern
PCs have their BIOS stored on a flash memory chip, called as flash BIOS and they are
also used in memory cards, USB flash drives, modems as well.

ii. Read-Write Memory/Random Access Memory (RAM)

15
The Random Access Memory (RAM) is the data memory or working memory
of the controller/processor. Controller/processor can read from it and write to it.RAM is
volatile, meaning when the power is turned off, all the contents are destroyed. RAM
generally falls into three categories: Static RAM (SRAM), dynamic RAM (DRAM)
and non- volatile RAM (NVRAM).

 SRAM : SRAM stores data in the form of voltage. They are made up of flip-flops.
A flip-flop for a memory cell takes four or six transistors (or 6 MOSFETs) along with
some wiring, four of the transistors are used for building the latch (flip-flop) part of the
memory cell and two for controlling the access. SRAM is fast in operation due to its
resistive networking and switching capabilities. The major limitations of SRAM are low
capacity and high cost.

 DRAM : DRAM stores data in the form of charge. They are made up of MOS
transistor gates. The advantages of DRAM are its high density and low cost compared
to SRAM. The disadvantage is that since the information is stored as charge it gets
leaked off with time and to prevent this they need to be refreshed periodically.
Special circuits called DRAM controllers are used for the refreshing operation. The
refresh operation is done periodically in milliseconds interval. The MOSFET acts as the
gate for the incoming and outgoing data whereas the capacitor acts as the bit storage unit

 NVRAM: Non-volatile RAM is a random access memory with battery backup. It


contains static RAM based memory and a minute battery for providing supply to the
memory in the absence of external power supply. The memory and battery are packed
together in a single package.NVRAM is used for the non-volatile storage of results of
operations. The life span of NVRAM is expected to be around 10 years. DS1744 from
Maxim/Dallas is an example for 32 KB NVRAM.

16
1.4 Sensors and Actuators
1.4.1 Sensor
 A Sensor is used for taking Input
 It is a transducer that converts energy from one form to another for any
measurement or control purpose
0 Ex. A Temperature sensor
1
1.4.2 Actuator

 Actuator is used for output.


 It is a transducer that may be either mechanical or electrical which converts
signals to corresponding physical actions.

1.4.3 I/O Subsystem

 The I/O subsystem of the embedded system facilitates the interaction of the
embedded system with the external world.
 The interaction happens through the sensors and actuators connected to the
input and output ports respectively of the embedded system.
 The sensors may not be directly interfaced to the input ports, instead they may
be interfaced through signal conditioning and translating systems like ADC,
optocouplers, etc.

i. Light Emitting Diode (LED)


ii. 7-Segment LED Display
iii. Optocoupler
iv. Stepper Motor
v. Relay
vi. Piezo Buzzer
vii. Push Button Switch
viii. Keyboard
ix. Programmable Peripheral Interface (PPI)

Light Emitting Diode (LED)

 LED is an important output device for visual indication in any embedded system.
LED can be used as an indicator for the status of various signals or situations.
Typical examples are indicating the presence of power conditions like ‘Device ON’,
‘Battery 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 and cathode to the –ve terminal of the supply voltage. The current
flowing through the LED must be limited to a value below the maximum current that
17
it can conduct. A resistor is used in series between the power supply and the LED to
limit the current through the LED.

7-Segment LED Display

 The 7-segment LED display is an output device for displaying


alphanumeric characters. It contains 8 light-emitting diode (LED) segments arranged
in a special form. Out of the 8 LED segments, 7 are used for displaying
alphanumeric characters and 1 is used for representing ‘decimal point’ in decimal
number display.
 The LED segments are named A to G and the decimal point LED segment is named
as DP.

Optocoupler

 Optocoupler is a solid state device to isolate two parts of a circuit.


Optocoupler combines an LED and a photo-transistor in a single housing
(package). Figure illustrates the functioning of an optocoupler device.

18
Stepper Motor
 A stepper motor is an electro-mechanical device which generates discrete
displacement (motion) in response to dc electrical signals.
 It differs from the normal dc motor in its operation.
 The dc motor produces continuous rotation on applying dc voltage whereas a
stepper motor produces discrete rotation in response to the dc voltage applied
to it.
 Stepper motors are widely used in industrial embedded applications,
consumer electronic products and robotics control systems.
 The paper feed mechanism of a printer/fax makes use of stepper motors for
its functioning.
 Based on the coil winding arrangements, a two-phase stepper motor is
classified into two. They are:
 Unipolar
 Bipolar

Relay

 Relay is an electro-mechanical device. In embedded application, the ‘Relay’


unit
 acts as dynamic path selectors for signals and power.
 The ‘Relay’ unit contains a relay coil made up of insulated wire on a metal
core and a metal armature with one or more contacts.
 ‘Relay’ works on electromagnetic principle. When a voltage is applied to the
relay coil, current flows through the coil, which in turn generates a magnetic
field.
 The magnetic field attracts the armature core and moves the contact point.
The movement of the contact point changes the power/signal flow path.
 ‘Relays’ are available in different configurations.

Piezo Buzzer

 Piezo buzzer is a piezoelectric device for generating audio indications in


 embedded application.
 A piezoelectric buzzer contains a piezoelectric diaphragm which produces
audible sound in response to the voltage applied to it.
 Piezoelectric buzzers are available in two types:
‘Self-driving and ‘External driving’.
 The ‘Self-driving’ circuit contains all the
necessary components to generate sound at a predefined
tone. It will generate a tone on applying the voltage.

 External driving piezo buzzers supports the generation of different


tones. The tone can be varied by applying a variable pulse train to the
piezoelectric buzzer.
19
Push Button Switch
 It is an input device. Push button switch comes in two configurations, namely
‘Push to Make’ and ‘Push to Break’.
 In the ‘Push to Make’ configuration, the switch is normally in the open
state and it makes a circuit contact when it is pushed or pressed.
 In the ‘Push to Break’ configuration, the switch is normally in the closed
state and it breaks the circuit contact when it is pushed or pressed.
 In the embedded application push button is generally used as reset and start
switch.
ii. Keyboard
 Keyboard is an input device for user interfacing. If the number of keys
required is very limited, push button switches can be used and they can be
directly interfaced to the port pins for reading.
 Matrix keyboard is an optimum solution for handling
large key requirements. It greatly reduces the number of interface
connections.
 For example, for interfacing 16 keys, in the direct interfacing technique 16
port pins are required, whereas the matrix keyboard only 8 lines are required.
The 16 keys are arranged in a 4 column*4 row matrix.

Programmable Peripheral Interface (PPI) 8255


 Programmable Peripheral Interface (PPI) devices are used or extending the
I/O capabilities of processors/controllers

1.5 Communication Interface


 For an embedded product, the communication interface can be viewed in two
different perspectives; namely; Device/board level communication interface
(Onboard Communication Interface) and Product level communication
interface (External Communication Interface).
 Embedded product is a combination of different types of components
(chips/devices) arranged on a printed circuit board (PCB). Serial interfaces
like I2C, SPI, UART, 1-Wire, etc and parallel bus interface are examples of
‘Onboard Communication Interface’.

1.5.1 Onboard Communication Interfaces

Onboard Communication Interface refers to the different


communication channels/buses for interconnecting the various integrated circuits and
other peripherals within the embedded system. The various interfaces for onboard
communication are as follows:
 Inter Integrated Circuit (I2C) Bus
 Serial Peripheral Interface (SPI) Bus
 Universal Asynchronous Receiver Transmitter (UART)
 1-Wire Interface
 Parallel Interface
20
Inter Integrated Circuit (I2C) Bus
 The Inter Integrated Circuit Bus is a synchronous bi-directional half duplex
two wire serial interface bus. The I2C bus comprise of two bus lines, namely;
Serial Clock-SCL and Serial Data-SDA.
 SCL line is responsible for generating synchronization clock pulses
 SDA is responsible for transmitting the serial data across devices.
 Devices connected to the I2C bus can act as either ‘Master’ device or ‘Slave’
device.
 The ‘Master’ device is responsible for controlling the communication by
initiating/terminating data transfer, sending data and generating necessary
synchronization clock pulses.
 ‘Slave’ devices wait for the commands from the master and respond upon
receiving the commands. ‘Master’ and ‘Slave’ devices can act as either
transmitter or receiver. I2C supports multi masters on the same bus.

I2C Bus Interfacing

Serial Peripheral Interface (SPI) Bus


 The Serial Peripheral Interface Bus (SPI) is a synchronous bi- directional full
duplex four-wire serial interface bus.
 SPI is a single master multi-slave system.
 SPI requires four signal lines for communication. They are Master Out Slave
In (MOSI), Master In Slave Out (MISO), Serial Clock (SCLK) and Slave
Select (SS).
 When compared to I2C, SPI bus is most suitable for applications requiring
transfer of data in ‘streams’.
21
SPI bus interfacing

UART (universal asynchronous Receiver Transmitter)


 Asynchronous form of data transmission
 Serial data transmission doesn’t require a clock signal to synchronize the end
of transmission
 It relies upon the pre defined agreement between the devices
 For proper communication the transmit line of the sending device should be
connected to the receiving device
 It also provides h/w handshaking signal support for controlling the serial data
flow
 Nowadays most the microprocessors are available with integrate UART
functionality

1-wire interface

asynchronous half duplex communication protocol


 It makes use of only a single signal line called DQ for communication and
follows master-slave communication model
 It allows power to be sent along the signal wire as well.(I2C uses internal
capacitor to power the device)
 Supports a single master and one or more slave devices
 Every 1-wire device contains a globally unique 64 bit id no stored within it
for addressing
 Communication over the 1-wire bus is divided into timeslots of 60micro sec

22
Parallel interface
 Used for communicating with peripheral device which are memory mapped to
the host of the system
 Device which supports parallel bus can directly connect to this bus
 Controlled by the control signal interface between the device and the
host(rd/wr,select)
 Always initiated by host processor, if device wants to initiate then it should
use interrupts
 Direction of data is controlled by rd/wr
 Decoder circuit activates the chip select line to activate the device

1.5.2 External communication interface

 Channels/buses use by the embedded system to communicate with the external world.
The various interfaces for external communication are as follows
i. RS-232 C & RS-485
ii. Universal Serial Bus (USB)
iii. IEEE 1394 (Firewire)
iv. Infrared (IrDA)
v. Bluetooth (BT)
vi. Wi-Fi
vii. ZigBee
viii. General Packet Radio Service (GPRS)

i. RS-232 C & RS-485

 RS-232C is a legacy, full duplex, wired, asynchronous serial communication interface.


RS-232 supports two different types of connectors, namely; DB-9; 9-Pin connector and
DB-25: 25-Pin connector. RS-232 supports only point-to-point communication and not
suitable for multi-drop communication.
 RS-485 is the enhanced version of RS-422 and it supports multi-drop communication
with up to 32 transmitting devices (drivers) and 32 receiving devices on the bus.

ii. Universal Serial Bus (USB)

Wired high speed serial bus for data communication


 Follows star topology with a USB host at the centre and one or more USB peripheral
devices connected to it.
 Transmits data in packet format
 Improves the noise immunity
 Has the ability to supply power to the connecting devices

23
 Mini and micro USB connectors are available for small form factor devices like portable
media player
 Supports four different types of data transfers
1 control: s/w to query, configure and issue commands to the USB device
2 Bulk: for sending block of data to a device,
3 Isochronous data: for real time data communication (data transmitted as streams in real
time. Does not support error checking and retransmission. Audio devices and medical
equipment)
4 Interrupt transfer: for transferring small amount of data.

iii. IEEE 1394 (Firewire)


 IEEE 1394 (Firewire) is a wired, isochronous high speed serial communication bus. It is
also known as High Performance Serial Bus (HPSB).
 1394 is a popular communication interface for connecting embedded devices like Digital
Camera, Camcorder, Scanners to desktop computers for data transfer and storage.
 Unlike USB interface,IEEE 1394 doesn’trequire a host for communicating
between devices. For example, you can directly connect a
scanner with a printer for printing. The data rate supported by 1394 is far higher than the
one supported by USB 2.0 interface. The 1394 hardware implementation is much costlier
than USB implementation.

iv. Infrared Data Association (IrDA)

 serial, half duplex, line of sight based wireless technology for data( remote control of TV)
 Supports point to point and point to multipoint communication
 Communication range 10cm to 1m
 IR supports data rates ranging from 9600 bits/s to 16 Mbps
 Infrared light emitting diode is the IR source and photodiode acts as receiver
 Has two parts , physical link part and a protocol part
 Popular for file exchange and data transfer in low cost devices
 The remote control of your TV, VCD player, etc works on Infrared data communication
principle.
v. Bluetooth (BT)
 Bluetooth is a low cost, low power, short range wireless technology for data and voice
communication. Bluetooth supports point-to-point (device to device) and point-to-
multipoint (device to multiple device broadcasting) wireless communication.
 A Bluetooth device can function as either master or slave. When a network is formed
with one Bluetooth device as master and more than one device as slaves, it is called a
Piconet. A Piconet supports a maximum of seven slave devices.
 Bluetooth is the favorite choice for short range data communication in handheld
embedded devices. Bluetooth technology is very popular among cell phone users as they
are the easiest communication channel for transferring ringtones, music files,
pictures,media files, etc between neighboring Bluetooth enabled phones.

24
 It supports a data rate of up to 1 Mbps and a range of approximately 30 feet for data
communication.

vi. Wi-Fi
 wireless fidelity is popular for wireless communication for networked communication
 Supports IP protocol
 Each device is addressed by IP address
 Wi-Fi based communications require an intermediate agent called wi-fi router
 Supports data rate 1Mbps- 150 Mbps
 Offers range of 100- 300ft

vii. ZigBee

 ZigBee is a low power, low cost, wireless network communication


 protocol based on the IEEE 802.15.4-2006 standard.
 ZigBee is targeted for low power, low data rate and secure applications for Wireless
Personal Area Networking (WPAN).
 Supports distance upto 100m
 Supports Data rate of 250Kbps
 3 device category ( coordinator, router, end device)
 Coordinator- acts as the root of the n/w. responsible of initiating the n/w and can store
information about the n/w
 Router-for passing information from one device to other
 End device-for data communication

viii. General Packet Radio Service (GPRS)


 GPRS is a communication technique for transferring data
over a mobile communication network like GSM.
 GPRS supports a theoretical maximum transfer rate of 17.2 kbps.
 Data is sent as packets
 At receiving end reconstructed by combining packets
 The radio channel is shared between several users instead of dedicating to a cell phone
user
 Supports IP protocol and PP protocol
 Mainly for mobile enabled embedded devices

1.6 Embedded firmware


 Refers to the control algorithm and or the configuration settings that an embedded system
developer dumps into the memory of the embedded system
 Various methods-
 Write program in high level languages like embedded C
 Write the program in assembly language using the instructions supported by your
application’s target processor
 These should be converted to machine code before loading to the memory which
is called ‘ HEX file creation’
25
 For a beginner it is better to use HLL.(writing code is easy, highly portable, not
developer dependent )
 Assembly language is tedious , time consuming and highly dependent on
developer

1.7 Other System Components

 The other system components refer to the components/circuits/ICs which are necessary
for the proper functioning of the embedded system.
 Reset Circuit, Brown-out Protection Circuit, Oscillator Unit, Real- Time Clock (RTC),
Watchdog Timer are examples of circuits/ICs which are essential for the proper
functioning of the processor/controllers.

Reset circuit
To ensure that the device is not operating at a voltage level when the device is not
guaranteed to operate when power ON
 Reset signal starts the execution from the reset vector from the address 0x0000
 Either active H or active L
 Some micro processors/controllers contains built in reset circuitry
Brown-out protection circuit
 protection circuit prevents the processor/controller from unexpected program execution
behavior when the supply voltage falls below a specified voltage
 May lead to data corruption
 Essential for battery powered devices
 This holds the processor in reset state until it rises above the threshold voltage

Oscillator unit
 is responsible for generating the clock for the processor

26
 Certain processors integrate built in oscillator and simply require an external quartz
crystal for producing the clock
 Speed of the processor depends on clock frequency
 Power consumption increases with increase in clock frequency
 Accuracy of the program execution depends on accuracy of clock signal

Real time clock


 for keeping track of time
 Holds information like current time, date, month, year and day of the week etc.
 Should function even in the absence of power. So contains a battery back up
 Available in the form of IC s
 Essential for synchronizing the operations of the OS kernel
 Can interrupt the OS by asserting the interrupt line
 OS kernel identifies the interrupt ( IRQ no)
 The kernel can perform necessary operations like system date time updation , managing
s/w timers etc
Watchdog timer
 To monitor the firmware execution and reset the system processor when the program
execution hangs up.
 ( alt+ctl+del)
 It’s a h/w timer
 It inc/dec a counter with each clock pulse and generates a reset signal when reaches 0
 Most processors implement as built in or using an external IC
 When watchdog timeout occurs an interrupt is generated instead of resetting in modern
systems and interrupt handler handles the situation in an appropriate fashion

PCB and passive components


 Backbone is PCB
 After finalizing the components and the connection a schematic design is created and
PCB is fabricated
 Apart from subsystems You can have resistor, capacitor, diodes etc on your board

1.8 Characteristics of an embedded system

27
Unlike general purpose computing system, embedded system posses certain specific
characteristics and these are unique.
 Application and domain specific: An embedded system is designed for a specific
purpose only.
 It will not do any other task.
 You can not replace an embedded control unit developed for a particular domain say
telecom with another control unit designed to for another domain like consumer
electronics
 Reactive and real time: embedded systems are in constant interaction to the real world
 Any changes happening in the real world (event)are captured by the sensors or i/p
devices
 The event may be periodic or unpredicted one(should not miss)
 So emb.sys. are generally reactive
 Timing behavior or the system should be deterministic
 Should not miss deadlines
Operates in harsh environment: the environment in which the emb.sys. deployed may
be a dusty one or high temperature zone
 System placed in such areas should be capable to with stand all operating conditions
Distributed: The term distributed means that embedded systems may be a part of a
larger system.
 Automatic vending m/c contains card reader, vending unit etc.
 They are independent but work together to achieve a common goal
Small size and weight: size, weight, shape etc will be one of the deciding factors to
choose a product
 Most applications demands small sized and low weight products
Power concerns: designed in such a way as to minimize the heat dissipation
 May require cooling fan which occupies additional space
 Even it’s a critical constraint battery operated systems, more the power consumption the
less the battery life.

1.9 Quality attributes of ES

QA are the non-functional requirements that need to be documented properly in any


system design.

 If the quality attributes are more concrete and measurable it will give a positive impact on
the end product and QA are classified into two.
 Operational QA
 Non-operational QA

1.9.1 Operational Quality Attributes

28
The operational quality attributes represent the relevant quality attributes related to
the embedded system when it is in the operational mode or ‘online’ mode. The important
quality attributes coming under this category are listed below:
i. Response
ii. Throughput
iii. Reliability
iv. Maintainability
v. Security
vi. Safety
Response: quickness of the system
 How fast the system is tracking the changes in input variables
 In flight control application any response delay in the system will create potential
damages to the safety of the flight
 Response time for a toy is not time critical
Throughput: efficiency of the system
 Rate of production or operation of a defined process
 Rates can be expressed in terms of units of products , batched produced, or any other
meaningful measurements.
 In case of card reader like the ones used in buses, throughput means how much
transactions the Reader can perform in a minute or hour or day.

Reliability: how much % you can rely upon the proper functioning of sys. Mean time
between failure MTBF (frq of failure in hrs/weeks/months) & mean time to repair
MTTR ( how long the system is allowed to be out of order following a failure ) are the
terms used in defining the system reliability
Maintainability: deals with the support and maintenance to the end user in the case of
technical issues and failures or on the basis of a routine checkup

 Two types (preventive or corrective maintenance

1. Scheduled or Periodic Maintenance (Preventive Maintenance)


2. Maintenance to Unexpected Failures (Corrective Maintenance)

 User should replace the cartridge after n number of printouts (scheduled /


periodic /preventive)
 If paper feeding part of the printer fails required immediate repairs
(maintenance to unexpected failure/ corrective)
 Ideal value for availability is expressed
 A = MTBF / (MTBF + MTTR)
Security: confidentiality( from unauthorized disclosure), integrity ( from unauthorized
modification) , availability ( from unauthorized users)

29
Safety: Safety deals with the possible damages that can happen to the operators, public
and the environment due to the breakdown of an embedded system or due to the
emission of radioactive or hazardous materials from the embedded products

1.9.2 Non operational quality attributes


The quality attributes that needs to be addressed for the product ‘not’ on the
basic of operational aspects are grouped under this category. The important quality
attributes coming under this category are listed below:
i. Testability & Debug-ability
ii. Evolvability
iii. Portability
iv. Time to prototype and market
v. Per unit and total cost
Testability: & debug ability: how easily one can test her design and by which mean she
can test it.
 h/w testing( peripherals and total h/w function) and firmware testing
 Debugging the product as such for figuring out the probable sources that create
unexpected behavior in the system
 h/w level debugging ( issues created by h/w problems) and firmware debugging
( errors that appear as a result of flaws in the firmware)
Evolvability: related to biology.
 Ease with which the embedded product can be modified to take advantage of new f/w
or h/w technologies
Portability : measure of system independence
 If the product is capable of functioning as such in various environments
processors/controllers/os
 Product can be ported to a new platform
 Should be flexible and portable
 Assembly language portability is poor

Time to market: time elapsed between the conceptualization of a product and time at
which the product is ready for selling
 It’s a critical factor because embedded technology is one where rapid technology
change is happening
Time to prototype: its an informal kind of rapid product development in which the
important features of the product under consideration are developed
 If prototype is developed faster, the actual development time can be brought down
significantly. Product prototyping helps a lot in reducing time-to-market
Per unit cost and revenue: cost will be closely monitored by both end users
 Proper market study should be carried out before deciding per unit cost
 During design and development only investment no returns
 Once the product is ready to sell and its introduced to the market – product
introduction stage
 In growth phase product grabs high market share
30
 During maturity phase the growth and sales will be steady and revenue reaches at its
peak
 Product retirement/decline phase starts with the drop in sales volume, market share
and revenue
 At some point of decline stage the manufacturer announces discontinuing of the
product
 Unit cost is very high during the introductory stage

Module II

Hardware Software Co-Design and Program Modelling – Fundamental Issues,


Computational Models- Data Flow Graph, Control Data Flow Graph, State
Machine, Sequential Model, Concurrent Model, Object oriented model, UML(9)

Traditional Embedded System Development Approach

 The hardware software partitioning is done at an early stage


 Engineers from the software group take care of the software architecture development
and implementation, and engineers from the hardware group are responsible for building
the hardware required for the product
 There is less interaction between the two teams and the development happens either
serially or in parallel and once the hardware and software are ready, the integration is
performed

Fundamental issues in H/w S/w Co-design


 Model Selection
 A Model captures and describes the system characteristics
 A model is a formal system consisting of objects and composition rules
 It is hard to make a decision on which model should be followed in a particular
system design.
 Most often designers switch between a variety of models from the requirements
specification to the implementation aspect of the system design
 The objectives vary with each phase

 Architecture Selection
 A model only captures the system characteristics and does not provide information on
‘how the system can be manufactured?’
 The architecture specifies how a system is going to implement in terms of the number
and types of different components and the interconnection among them
 Controller architecture, Datapath Architecture, Complex Instruction Set Computing
(CISC), Reduced Instruction Set Computing (RISC), Very long Instruction Word

31
Computing (VLIW), Single Instruction Multiple Data (SIMD), Multiple Instruction
Multiple Data (MIMD) etc are the commonly used architectures in system design

 Language Selection
 A programming Language captures a ‘Computational Model’ and maps it into
architecture
 A model can be captured using multiple programming languages like C, C++, C#, Java
etc for software implementations and languages like VHDL, System C, Verilog etc for
hardware implementations
 Certain languages are good in capturing certain computational model. For example, C++
is a good candidate for capturing an object oriented model.
 The only pre-requisite in selecting a programming language for capturing a model is that
the language should capture the model easily
 Partitioning of System Requirements into H/w and S/w
 Implementation aspect of a System level Requirement
 It may be possible to implement the system requirements in either hardware or software
(firmware)
 Various hardware software trade-offs like performance, re-usability, effort etc are used for
making a decision on the hardware-software partitioning

Computational Models in Embedded Design


 Data Flow Graph/Diagram (DFG) Model

 Translates the data processing requirements into a data flow graph


 A data driven model in which the program execution is determined by data.
 Emphasizes on the data and operations on the data which transforms the input data to
output data.
 A visual model in which the operation on the data (process) is represented using a
block (circle) and data flow is represented using arrows. An inward arrow to the
process (circle) represents input data and an outward arrow from the process (circle)
represents output data in DFG notation
 Best suited for modeling Embedded systems which are computational intensive (like
DSP applications)
 E.g. Model the requirement x = a + b; and y = x - c;

32
Data path: The data flow path from input to output

A DFG model is said to be acyclic DFG (ADFG) if it doesn’t contain multiple values for the
input variable and multiple output values for a given set of input(s). Feedback inputs (Output is
feed back to Input), events etc are examples for non-acyclic inputs. A DFG model translates the
program as a single sequential process execution.

 Control Data Flow Graph/Diagram (CDFG) Model

 Translates the data processing requirements into a data flow graph


 Model applications involving conditional program execution
 Contains both data operations and control operations
 Uses Data Flow Graph (DFG) as element and conditional (constructs) as decision
makers.
 CDFG contains both data flow nodes and decision nodes, whereas DFG contains only
data flow nodes
 A visual model in which the operation on the data (process) is represented using a block
(circle) and data flow is represented using arrows. An inward arrow to the process (circle)
represents input data and an outward arrow from the process (circle) represents output
data in DFG notation.
 The control node is represented by a ‘Diamond’ block which is the decision making
element in a normal flow chart based design
 Translates the requirement, which is modeled to a concurrent process model
 The decision on which process is to be executed is determined by the control node
 Capturing of image and storing it in the format selected (bmp, jpg, tiff, etc.) in a digital
camera is a typical example of an application that can be modeled with CDFG
E.g. Model the requirement If flag = 1, x = a + b; else y = a-b;

33
 State Machine Model

 Based on ‘States’ and ‘State Transition’


 Describes the system behavior with ‘States’, ‘Events’, ‘Actions’ and ‘Transitions’
 State is a representation of a current situation.
 An event is an input to the state. The event acts as stimuli for state transition.
 Transition is the movement from one state to another.
 Action is an activity to be performed by the state machine.
 A Finite State Machine (FSM) Model is one in which the number of states are finite. In
other words the system is described using a finite number of possible states
 Most of the time State Machine model translates the requirements into sequence driven
program
 The Hierarchical/Concurrent Finite State Machine Model (HCFSM) is an extension of
the FSM for supporting concurrency and hierarchy
 HCFSM extends the conventional state diagrams by the AND, OR decomposition of
States together with inter level transitions and a broadcast mechanism for communicating
between concurrent processes
 HCFSM uses statecharts for capturing the states, transitions, events and actions. The
Harel Statechart, UML State diagram etc are examples for popular statecharts used for
the HCFSM modeling of embedded systems
 E.g. Automatic ‘Seat Belt Warning’ in an automotive
 Requirement:
 When the vehicle ignition is turned on and the seat belt is not fastened within 10 seconds
of ignition ON, the system generates an alarm signal for 5 seconds.
 The Alarm is turned off when the alarm time (5 seconds) expires or if the
driver/passenger fastens the belt or if the ignition switch is turned off, whichever happens
first.

34
 Sequential Program Model

 The functions or processing requirements are executed in sequence


 The program instructions are iterated and executed conditionally and the data gets
transformed through a series of operations
 FSMs are good choice for sequential Program modeling.
 Flow Charts is another important tool used for modeling sequential program
 The FSM approach represents the states, events, transitions and actions, whereas the
Flow Chart models the execution flow
 E.g. Automatic ‘Seat Belt Warning’ in an automotive
 Requirement:
 When the vehicle ignition is turned on and the seat belt is not fastened within 10 seconds
of ignition ON, the system generates an alarm signal for 5 seconds.
Ignition ON?
 The Alarm is turned off when the alarm time (5 seconds) expires or if the
driver/passenger fastens the belt or if the ignition switch is turned off, whichever happens
first. Seat Belt ON?

Set Timer for 5 Seconds


Start Alarm

Ignition ON

NO
Ignition Key ON
YES
NO Seat Belt ON?
Wait for 10 Seconds

Timer Expired? YES

35

Stop Alarm

End
E.g. Automatic ‘Seat Belt Warning’ in an automotive

When the vehicle ignition is turned on and the seat belt is not fastened within 10 seconds of
ignition ON, the system generates an alarm signal for 5 seconds. The Alarm is turned off when
the alarm time (5 seconds) expires or if the driver/passenger fastens the belt or if the ignition
switch is turned off, whichever happens first.

#define ON 1

#define OFF 0
#define YES 1
#define NO 0
void seat_belt_warn()
{
wait_10sec();
if (check_ignition_key()==ON)
{
if (check_seat_belt()==OFF)
{
set_timer(5);
start_alarm();
while ((check_seat_belt()==OFF )&&(check_ignition_key()==OFF )&& (timer_expire()==NO));
stop_alarm();
}
}
36
}
 Concurrent/Communicating Process Model
 Models concurrently executing tasks/processes. The program instructions are iterated and
executed conditionally and the data gets transformed through a series of operations
 Certain processing requirements are easier to model in concurrent processing model than
the conventional sequential execution.
 Sequential execution leads to a single sequential execution of task and thereby leads to
poor processor utilization, when the task involves I/O waiting, sleeping for specified
duration etc.
 If the task is split into multiple subtasks, it is possible to tackle the CPU usage effectively,
when the subtask under execution goes to a wait or sleep mode, by switching the task
execution.
 Concurrent processing model requires additional overheads in task scheduling, task
synchronization and communication

E.g. Automatic ‘Seat Belt Warning’ in an automotive

Create and initialize events


wait_timer_expire, ignition_on, ignition_off,
seat_belt_on, seat_belt_off,
alarm_timer_start, alarm_timer_expire
Create task Wait Timer
Alarm Timer Task
Create task Ignition Key Status Monitor
Create task Seat Belt Status Monitor
Wait for the Event alarm_start;
Create task Alarm Control
Sleep(5s);

 The processing requirements are split in to multiple tasks //Signal alarm_timer_expire


 Tasks are executed concurrently Set Event alarm_timer_expire;
 ‘Events’ are used for synchronizing the execution of tasks

Ignition Seat belt Status


Monitor Task
while(1) {
if (Seat Belt ON)
Wait TimerTask { Alarm Control Task
Sleep(10s); Set Event seat_belt_on;
Wait for the signaling of
//Signal wait_timer_expire Reset Event seat_belt_off;
wait_timer_expire
}
else
{ 37
Set Event seat_belt_off;
Reset Event seat_belt_on;
}
Set Event wait_timer_expire; if (ignition_on && seat_belt_off)
{ Start Alarm();
Set Event alarm_start;
Wait for the signaling of
Ignition Key Status MonitorTask alarm_timer_expire or
while(1) { ignition_off or seat_belt_on;
if (Ignition key ON) Stop Alarm();
}
{
Set Event ignition_on;
Reset Event ignition_off;
}
else
{
Set Event ignition_off;
Reset Event ignition_on;
}
}

Introduction to Unified Modeling Language (UML)


38
Unified Modeling Language (UML) is a visual modeling language for Object Oriented Design
(OOD). UML helps in all phases of system design through a set of unique diagrams for
requirements capturing, designing and deployment.

UML Building Blocks

 Things
 An abstraction of the UML Model
 Relationships
 An entity which express the type of relationship between UML elements
(objects, classes etc)
 Diagrams
 UML Diagrams give a pictorial representation of the static aspects,
behavioral aspects and organization and management of different modules
(classes, packages etc) of the system

 Things

 Structural things: Represents mostly the static parts of a UML model. They are
also known as ‘classifiers’. Class, interface, use case, use case realization
(collaboration), active class, component and node are the structural things in
UML.
 Behavioral things: Represents mostly the dynamic parts of a UML model.
Interaction, state machine and activity are the behavioral things in UML.
 Grouping things: Are the organizational parts of a UML model. Package and sub-
system are the grouping things in UML.
 Annotational things: Are the explanatory parts of a UML model. Note is the
Annotational thing in UML.

Thing Element Description Representation


Structural Class A template describing a set of objects
which share the same attributes,
relationships, operations and
semantics. It can be considered as a
blueprint of object.

39
Active Class Class presenting a thread of control in
the system. It can initiate control
activity. Active class is represented in
the same way as that of a class but
with thick border lines.
Interface A collection of externally visible
operations which specify a service of
a class. It is represented as a circle
attached to the class
Use case Defines a set of sequence of actions. It
is normally represented with an ellipse
indicating the name.
Collaboration Interaction diagram specifying the
(Use case collaboration of different use cases. It
Realization) is normally represented with a dotted
ellipse indicating the name.
Component Physical packaging of classes and
interfaces.
Node A computational resource existing at
run time. Represented using a cube
with name.

Thing Element Description Representation


Behavioral Interaction Behavior comprising a set of objects Name
exchanging messages to accomplish a
specific purpose. Represented by arrow with
name of operation
State Machine Behavior specifying the sequence of states in
response to events, through which an object
traverses during its lifetime.

Grouping Package Organizes elements into packages. It is only


a conceptual thing. Represented as a tabbed
folder with name.

40
Annotational Note Explanatory element in UML models.
Contains formal informal explanatory text.
May also contain embedded image.

Relationships in UML

Expresses the types of relationship between UML objects (objects, classes etc)

The Seat Belt Warning System – UML modeling


41
UML diagrams

UML diagrams give pictorial representation of static aspects, behavioral aspects and
organization and management of different modules(into classes, packages) of the systems

Static Diagrams: Diagram representing the static (structural) aspects of the system. Class
Diagram, Object Diagram, Component Diagram, Package Diagram, Composite Structure
Diagram and Deployment Diagram falls under this category

Diagram Description

Object Diagram Gives a pictorial representation of a set of objects and their relationships. It
represents the structural organization between objects.

42
Class Diagram Gives a pictorial representation of the different classes in a UML model,
their interfaces, the collaborations, interactions and relationship between
the classes etc. It captures the static design of the system.

Component Diagram It is a pictorial representation of the implementation view of a system. It


comprises of components (Physical packaging of classes and interfaces),
relationships and associations among the components.

Package Diagram It is a representation of the organization of packages and their elements.


Package diagrams are mostly used for organizing use case diagrams and
class diagrams.

Deployment Diagram It is a pictorial representation of the configuration of run time processing


nodes and the components associated with them.

Behavioral Diagram

It represents the dynamic(behavioral) aspects of the system.Use case


diagram,sequence diagram,state diagram,communication diagram,activity diagram,timing
diagram and interaction diagram are diagrams in UML

Use case diagram for seat belt warning system

43
Sequence diagram for seat belt warning system

Hardware Software Trade-offs


 Certain system level processing requirements may be possible to develop in either
hardware or software
 The decision on which one to opt is based on the trade-offs and actual system
requirement
 Processing speed, performance, memory requirements, effort, re-usability etc. are
examples for some of the hardware software trade-offs in the partitioning of a system
requirement

44
Embedded Systems – Application & Domain Specific
Washing Machine – Application Specific Embedded System
 Extensively used in Home Automation for washing and drying clothes
 Contains User Interface units (I/O) like Keypads, Display unit, LEDs for accepting
user inputs and providing visual indications
 Contains sensors like, water level sensor, temperature sensor etc.
 Contains actuators like spin and agitation control motor units
 Contains an integrates embedded controller for controlling the washing operations
 Sensors, actuators and I/O devices are interfaced to the I/O subsystem of the
embedded control unit
 Specifically designed for serving the application ‘Wash & Rinse’ of clothes and
cannot be used for any other applications

Figure 4.2: Components of Washing Machine

Automotive – Domain Specific Example of Embedded Systems

 Generally built around Digital Signal Processors, Application Specific Instruction Set
Processors (like Atmel Automotive AVR) and General purpose
processors/Controllers, System on Chips, Programmable Logic Devices or
Application Specific Integrated/Standard Products (ASIC/ASSP) or a combination of
these.
 Automotive Embedded Control units are generally known as Electronic Control
Units (ECUs)
 The presence of ECUs vary from simple mirror control units to complex Airbag
45
deployment and Antilock braking Systems (ABS)
 The number of embedded controllers in an ordinary vehicle varies from 20 to 40
whereas a luxury vehicle may contain 70-100 embedded control units.
 The first embedded system used in automotive application was the microprocessor
based fuel injection system introduced by Volkswagen 1600 in 1968

Module 3
46
Design and Development of Embedded Product –Firmware Design and Development –
Design Approaches, Firmware Development Languages.

47

You might also like