Sie sind auf Seite 1von 75

EMBEDDED SYSTEMS

10EE665

EMBEDDED SYSTEMS
:

10EE665

IA Marks

25

No. of Lecture Hrs./


Week

04

Exam
Hours

03

Total No. of Lecture


Hrs.

52

Exam
Marks

: 100

PART -A
UNIT - 1 & 2

TS
.IN

Subject Code

CONCEPT OF EMBEDDED SYSTEM DESIGN: Components, classification, skills required.


Micro controller cores: Architecture of 6808 and 6811.Embedded Memories ROM

EN

Embedded

variants, RAM. Applications of embedded system: Examples of Embedded systems SOC for cell

UNIT - 3

10 Hours

TU
D

less bar code scanner.

TECHNOLOGICAL ASPECTS OF EMBEDDED SYSTEM: Interfacing between analog and


digital blocks, Signal conditioning, digital signal processing, DAC & ADC interfacing, Sample

TS

& hold, multiplexer interface Internal ADC interfacing (excluding 6805 & 6812), Data
Acquisitio n System and Signal conditioning using DSP.

10 Hours

CI

UNIT - 4
DESIGN

TRADE OFFS

DUE TO

PROCESS

INCOMPATIBILITY, THERMAL

CONSIDERATIONS: Issues in embedded system design. Design challenge, design technology,


trade offs. Thermal considerations.

CITSTUDENTS.IN

6Hours

Page 1

EMBEDDED SYSTEMS

10EE665

PART -B
UNIT -5 & 6
Software aspects of Embedded Systems, real time programming Languages, operating systems.
Programming concepts and embedded programming in C.Round Robin, Round Robin with
function

queue-scheduling

architecture,

architecture. Introduction to RTOS.

Real

time

OS

architecture,

selecting

TS
.IN

interrupts,

12 Hours

UNIT -7 & 8

Subsystem interfacing with external systems user interfacing, Serial I/O devices, Parallel port

EN

interfaces: Input switches, Key boards and Memory interfacing.

TEXT BOOKS:
1.

Embedded

TU
D

Case study: Embedded velocity PID controller, PI controller with a PWM actuator. 14Hours

Microcomputer

systems:

Real

time

interfacing-Valvano,

J.W,

Cengage

TS

Learning,2nd Edition 5th Indian reprint,2009

CI

2. The Art of Designing Embedded systems-Ganssle, Jack, Newness

CITSTUDENTS.IN

Page 2

EMBEDDED SYSTEMS

10EE665

Table of contents
Unit

Title

UNIT - 1 & 2

Page no

CONCEPT OF EMBEDDED SYSTEM


DESIGN: Components, classification, skills

required. Embedded Micro controller cores:

Memories ROM variants,

TS
.IN

Architecture of 6808 and 6811.Embedded

RAM. Applications of embedded system

Examples of Embedded systems SOC for cell


less bar code scanner.

TECHNOLOGICAL ASPECTS OF EMBEDDED


SYSTEM:

EN

UNIT - 3

22

Interfacing between analog and digital blocks,

TU
D

Signal conditioning, digital signal processing,

DAC & ADC interfacing, Sample & hold,

multip lexer interface Internal


ADC interfacing (excluding 6805 & 6812),

TS

Data Acquisition System and Signal


conditioning using DSP.

UNIT - 4

DESIGN TRADE OFFS DUE TO PROCESS

CI

INCOMPATIBILITY, THERMAL

37

CONSIDERATIONS:
Issues in embedded system design.
Design challenge, design technology, trade
offs. Thermal considerations

UNIT -5 & 6

Software aspects of Embedded Systems,


Real time programming Languages, operating

CITSTUDENTS.IN

51
Page 3

EMBEDDED SYSTEMS

10EE665

systems.
Programming concepts and embedded
programming in C.
Round Robin, Round Robin with interrupts,
function queue-scheduling architecture,
Real time OS architecture, selecting

TS
.IN

architecture. Introduction to RTOS.


Subsystem interfacing with external systems
UNIT -7 & 8

user interfacing,

70

Serial I/O devices, Parallel port interfaces:

Input switches, Key boards and Memory

EN

interfacing.

Case study: Embedded velocity PID


controller,

CI

TS

TU
D

PI controller with a PWM actuator

CITSTUDENTS.IN

Page 4

EMBEDDED SYSTEMS

10EE665

UNIT - 1 & 2
CONCEPT OF EMBEDDED SYSTEM DESIGN: Components, classification, skills required.
Embedded Micro controller cores: Architecture of 6808 and 6811.Embedded Memories ROM
variants, RAM. Applications of embedded system: Examples of Embedded systems SOC for cell
less bar code scanner.

An embedded system has three main components:


Hardware, Software and real time operating system
i) Hardware
Power Supply
Memory
Timers

TU
D

Serial communication ports

EN

Processor

TS
.IN

Components of an Embedded System

Output/Output circuits

System applicatio n specific circuits

ii) Software: The application software is required to perform the series of tasks.

TS

An embedded system has software designed to keep in view of three constraints:


Availability of System Memory
Availability of processor speed

CI

The need to limit power dissipation when running the system continuously in
cycles of wait for events, run , stop and wake up.

iii) Real Time Operating System: (RTOS) It supervises the application software
and provides a mechanism to let the processor run a process as per scheduling and
do the switching from one process (task) to another process.

CITSTUDENTS.IN

Page 5

EMBEDDED SYSTEMS

10EE665

Classification
We can classify embedded systems into three types as follows :

1. Small Scale Embedded Systems : These systems are designed with a single 8- or 16-bit
microcontroller; they have little hardware and software complexities and involve board -level
design. They may even be battery operated. When developing embedded software for these, an
editor, assembler and cross assembler, specific to the microcontroller or processor used, are the

TS
.IN

main programming tools. Usually, C is used for developing these systems. C program
compilation is done into the assembly, and executable codes are then appropriately located in the
system memory. The software has to fit within the memory available and keep in view the need
to limit power dissipation when system is running continuously.

2. Medium Scale Embedded Systems : These systems are usually designed with a single or few

EN

16- or 32-bit microcontrollers or DSPs or Reduced Instruction Set Computers (RISCs). These
have both hardware and software complexities. For complex software design, there are the
following programming tools: RTOS, Source code engineering tool, Simulator, Debugger and

TU
D

Integrated Development Environment (IDE). Software tools also provide the solutions to the
hardware complexities. An assembler is of little use as a programming tool. These systems may
also employ the readily available ASSPs and IPs (explained later) for the various functionsfor
example, for the bus interfacing, encrypting, deciphering, discrete cosine transformation and

TS

inverse transformation, TCP/IP protocol stacking and network connecting functions. [ASSPs and
IPs may also have to be appropriately configured by the system software before being integrated
into the system-bus.

CI

3. Sophisticated Embedded Systems : Sophisticated embedded systems have enormous


hardware and

software complexities and may need scalable processors or configurable

processors and programmable logic arrays. They are used for cutting edge applications that need
hardware and software co-design and integration in the final system; however, they are

constrained by the processing speeds available in their hardware units. Certain software
functions such as encryption and deciphering algorithms, discrete cosine transformation and
inverse transformation algorithms, TCP/IP protocol stacking and network driver functions are
implemented in the hardware to obtain additional speeds by saving time. Some of the functions
CITSTUDENTS.IN

Page 6

EMBEDDED SYSTEMS

10EE665

of the hardware resources in the system are also implemented by the software. Development
tools for these systems may not be readily available at a reasonable cost or may not be available
at all. In some cases, a compiler or retargetable compiler might have to be developed for these.

Skills Required
An embedded system designer has to develop a product using the available tools within the given

TS
.IN

specifications, cost and time frame.

1. Skills for Small Scale Embedded System Designer: Author Tim Wilmshurst in the book
referred above (see page 4), has said that the following skills are needed in the individual or team
Full understanding of microcontrollers with a basic

that is developing a small-scale system:


knowledge

of computer

architecture,

digital electronic design,

software engineering,

data

EN

communication, control engineering, motors and actuators, sensors and measurements, analog
electronic design and IC design and manufacture. Specific skills will be needed in specific
situations. For example, control engineering knowledge will be needed for design of control

TU
D

systems and analog electronic design knowledge will be needed when designing the system
interfaces. Basic aspects of the following topics will be described in this book to prepare the
designer who already has a good knowledge of the microprocessor or microcontroller to be used.
Computer architecture and organization.

TS

Memories.

Memory allocation.

Interfacing the memories.

CI

Burning (a term used for porting) the executable machine codes in PROM or ROM.
Use of decoders and demultiplexers.

Direct memory accesses.


Ports.
Device drivers in assembly.
Simple and sophisticated buses.
Timers.

Interrupt servicing mechanism.


CITSTUDENTS.IN

Page 7

EMBEDDED SYSTEMS

10EE665

C programming elements.
Memory optimization.
Selection of hardware and microcontroller.
Use of ICE (In-Circuit Emulators), cross-assemblers and testing equipment.
Debugging the software and hardware bugs by using test vectors.

TS
.IN

A designer interested in small-scale embedded systems may not need at all concepts of interrupt
latencies and deadlines and their handling, the RTOS programming tools.

2. Skills for Me dium Scale Embe dde d Sys te m De s igne r: C programming and RTOS programming
and program modeling skills are a must to design a medium-scale embedded system. Knowledge of the

EN

following becomes critical.

Tasks and their scheduling by RTOS.

Cooperative and preemptive scheduling.

TU
D

Inter processor communication functions.

Use of shared data, and programming the critical sections and re -entrant functions.
Use of semaphores, mailboxes, queues, sockets and pipes.
Handling of interrupt-latencies and meeting task deadlines.

TS

Use of various RTOS functions.

Use of physical and virtual device drivers.

A designer must have access to an RTOS programming tool with Application Programming Interfaces

CI

(APIs) for the specific microcontroller to be used. Solutions to various functions like memory allocation,
timers, device drivers and interrupt handing mechanism are readily available as the APIs of the RTOS.
The designer needs to know only the hardware organization and use of these APIs. The microcontroller
or processor then represents a small system element for the designer and a little knowledge may suffice.

3. Skills for Sophis ticate d Embe dde d Sys te m De s igne r: A team is needed to co-design and solve the
high level complexities of the hardware and software design. An embedded system hardware engineer
should have full skills in hardware units and basic knowledge of C, RTOS and other programming tools.

CITSTUDENTS.IN

Page 8

EMBEDDED SYSTEMS

10EE665

Software engineer should have basic knowledge in hardware and a thorough knowledge of C, RTOS
and other programming tools. A final optimum design solution is then obtained by system integration.

Micro controlle r core s : Archite cture of 6808 and 6811


Archite cture of 6808

TS
.IN

The 6808 is an advanced 8-bit MCU IP Core with highly sophisticated, on chip peripheral capabilities.
6808 soft core is binary-compatible with the industry standard 68HC08 8-bit microcontroller and can
achieve a performance 45-100 million instructions per second. There are two configurations of DF6808:
Harvard where data and program buses are separated and von Neumann with common program and data
bus DF6808 has FAST architecture that is 3.2 times faster compared to original implementation. Core in
standard configuration has integrated on chip major peripheral function. The 6808 Microcontroller Core

CI

TS

TU
D

Serial Peripheral Interface SPI.

EN

contains full-duplex UART (Asynchronous serial communications interface (SCI), and Synchronous

CITSTUDENTS.IN

Page 9

EMBEDDED SYSTEMS

10EE665

The main 16-bit, free-running timer system has implemented two input capture lines and two output-

compare lines.

Self-monitoring circuitry is included on-chip to protect against system errors. A

computer operating properly (COP) watchdog system protects against software failures. An
illegal opcode detection circuit provides a nonmaskable interrupt if illegal opcode is detected.
Two software-controlled power-saving modes, WAIT and STOP, are available to conserve
additional power. These modes make the DF6808 IP Core especially attractive for automotive
and battery-driven applications.

TS
.IN

DF6808 is fully customizable, which means it is delivered in the exact configuration to meet
users requirements. There is no need to pay extra for not used features and wasted silicon. It
includes fully automated test bench with complete set of tests allowing easy package validation
at each stage of SoC design flow.

Features

EN

FAST architecture, 3.2 times faster than the original implementatio n


Software compatible with industry standard 68HC08

Configurable Harvard or Von Neumann architectures

TU
D

64 bytes of System Function Registers space (SFRs)


Up to 64k bytes of Program Memory
Up to 64k bytes of Data Memory

De-multiplexed Address/Data Bus to allow easy connection to memory

TS

Two power saving modes: STOP, WAI

Ready pin allows Core to operate with slow program and data memories
Fully synthesizable, static synchronous design with no internal tri-states

CI

No internal reset generator or gated clock


Scan test ready
Technology independent HDL source code
Core can be fully customized
800 MHz virtual clock frequency compared to original implementation

CITSTUDENTS.IN

Page 10

EMBEDDED SYSTEMS

10EE665

6811: 8-bit FAST Microcontrollers Family


Document contains brief description of 6811 core functionality. The 6811 is a advanced 8 -bit
MCU IP Core with highly sophisticated, on chip peripheral capabilities. 6811 soft core is
binary-compatible with the industry standard 68HC11 8-bit microcontroller and can achieve a
performance 45-100 million instructions per second. DF6811 has FAST architecture that is 3.8
times faster compared to original implementation. Core in standard configuration has integrated
on chip major peripheral function.

CI

TS

TU
D

EN

separate synchronous serial peripheral interface (SPI).

TS
.IN

There are two serial interfaces: an asynchronous serial communications interface (SCI) and a

The main 16-bit, free-running timer system has implemented three input capture lines, five
output-compare lines, and a real-time interrupt function.

An 8-bit pulse accumulator subsystem

can count external events or measure external periods.

Self-monitoring circuitry is included on-

chip to protect against system errors. A computer operating properly (COP) watchdog system
protects against software failures. An illegal opcode detection circuit provides a non-maskable
CITSTUDENTS.IN

Page 11

EMBEDDED SYSTEMS

interrupt if illegal opcode is detected.

10EE665

Two software-controlled power-saving modes, WAIT and

STOP, are available to conserve additional power. These modes make the DF6811 IP Core
especially attractive for automotive and battery-driven applications.

The DF6811 have built in

the development support features designed into DF6811. The LIR signal is intended as a
debugging aid. This signal is driven to active low for the first bus cycle of each new instruction,
making it easy to reverse assemble (disassemble) instructions from the display of a logic
analyzer.

DF6811 is fully customizable, which means it is delivered in the exact configuration to

TS
.IN

meet users requirements. There is no need to pay extra for not used features and wasted silicon.
It includes fully automated testbench with complete set of tests allowing easy package validation
at each stage of SoC design flow.

EN

Features

FAST architecture, 3,8 times faster than the original implementatio n


Software compatible with industry standard 68HC11
10 times faster multiplication

TU
D

16 times faster division

64 bytes of remapped System Function Registers space (SFRs)


Up to 16M bytes of Data Memory

De-multiplexed Address/Data Bus to allow easy connection to memory

TS

Two power saving modes: STOP, WAI

CI

Embedded Memories

In a system, there are various types of memories. Figure below shows a chart for the various

forms of memories that are present in systems.

These are as follows:


Internal RAM of 256 or 512 bytes in a microcontroller for registers, temporary data and
stack

CITSTUDENTS.IN

Page 12

EMBEDDED SYSTEMS

10EE665

Internal ROM/PROM/EPROM for about 4 kB to 16 kB of program (in the case of


microcontrollers). (iii) External RAM for the temporary data and stack (in most
systems).
Internal caches (in the case of certain microprocessors).
EEPROM or flash (in many systems saving the results of processing in nonvolatile
memory: for example, system status periodically and digital-camera images, songs, or

TS
.IN

speeches after a suitable format compression).


External ROM or PROM for embedding software (in almost all no microcontroller-based
systems). (vii) RAM Memory buffers at the ports.

TU
D

EN

(viii) Caches (in superscalar microprocessors).

Table gives the functions assigned in the embedded systems to the memories. ROM or PROM or

CI

TS

EPROM embeds the embedded software specific to the system

Random-access memory (RAM) is a form of computer data storage. A random-access device


allows stored data to be accessed in very nearly the same amount of time for any storage
CITSTUDENTS.IN

Page 13

EMBEDDED SYSTEMS

10EE665

location, so data can be accessed quickly in any random order. In contrast, other data storage
media such as hard disks, CDs, DVDs and magnetic tape, as well as early primary memory types
such as drum memory, read and write data only in a predetermined order, consecutively, because
of mechanical design limitations. Therefore the time to access a given data location varies
significantly depending on its physical location

TS
.IN

Applications of embedded system

Embedded Systems has witnessed tremendous growth in the last one decade. Almost all the fast
developing sectors like automobile, aeronautics, space, rail, mobile communications, and
electronic payment solutions have witnessed increased use of Embedded technologies. Greater
value to mobility is one of the prominent reasons for the rise and development of Embedded
technologies.

that included

TU
D

Rocket & satellite control

EN

Initially, Embedded Systems were used for large, safety-critical and business-critical applications

Energy production control


Telephone switches

TS

Air Traffic Control

Embedded Systems research and development is now concerned with a very large proportion of
the advanced products designed in the world. In one way, embedded technologies run global

CI

transport industry that includes avionics, space, automotive, and trains. But, it is the electrical
and electronic appliances like cameras, toys, televisions, home appliances, audio systems, and
cellular phones that really are the visual interface of Embedded Systems for the common
consumer.

Advanced Embedded Technologies are deployed in developing


Process Controls

(energy

production

and

distribution,

factory

automation

and

optimization) Telecommunica tions (satellites, mobile phones and telecom networks),


CITSTUDENTS.IN

Page 14

EMBEDDED SYSTEMS

10EE665

Energy management (production, distribution, and optimized use)


Security (e-commerce, smart cards)
Health (hospital equipment, and mobile monitoring)
In the last few years the emphasis of embedded technologies was on achieving feasibility, but
now the trend is towards achieving optimality. Optimality or optimal design of embedded
systems means

TS
.IN

Targeting a given market segment at the lowest cost and delivery time possible
Seamless integration with the physical and electronic environment

Understanding the real-world constraints such as hard deadlines, reliability, availability,


robustness, power consumption, and cost

EN

Automobile sector

Automobile sector has been in the forefront of acquiring and utilizing Embedded technology to
produce highly efficient electric motors. These electric motors include brushless DC motors,

TU
D

induction motors and DC motors, that use electric/electronic motor controllers.


European automotive industry enjoys a prominent place in utilizing Embedded technology to
achieve better engine control. They have been utilizing the recent Embedded innovations such as
brake-by-wire and drive-by-wire.

Embedded technology finds immediate importance in electric vehicles, and hybrid vehicles. Here

TS

Embedded applications bring about greater efficiency and ensure reduced pollution. Embedded
technology has also helped in developing automotive safety systems such as the
Anti-lock braking system (ABS)

CI

Electronic Stability Control (ESC/ESP)

Traction control (TCS)


Automatic four-wheel drive

Aerospace & Avionics


Aerospace and Avionics demand a complex mixture of hardware, electronics, and embedded
software. For efficient working, hardware, electronics and embedded software must interact with
many other entities and systems. Embedded engineers confront major challenges,
CITSTUDENTS.IN

Page 15

EMBEDDED SYSTEMS

10EE665

Creating Embedded systems on time


Taking the budgetary constraints into consideration
Ensuring that the complex software and hardware interactions are right
Assembling components that meet specifications and perform effectively together
Understanding the larger context of the embedded software

TS
.IN

Adopting the latest in Embedded technology like the fly-by-wire

Telecommunications

If ever there is an industry that has reaped the benefits to Embedded Technology, for sure, it is
only Telecommunications.

The Telecom industry utilizes numerous embedded systems from

telephone switches for the network to mobile phones at the end-user. The Telecom computer

EN

network also uses dedicated routers and network bridges to route data. Embedded engineers help
in ensuring high-speed networking. This is the most critical part of embedded applications. The
Ethernet switches and network interfaces are designed to provide the necessary bandwidth.

applications.

TU
D

These will allow in rapidly incorporating Ethernet connections into advanced embedded

Consumer Electronics

benefited a lot from embedded technologies. Consumer

TS

Consumer electronics has also


electronics includes

Personal Digital Assistants (PDAs)

CI

MP3 players

Mobile phones

Videogame consoles
Digital cameras
DVD players

GPS receivers
Printers

CITSTUDENTS.IN

Page 16

EMBEDDED SYSTEMS

Even the

household

10EE665

appliances,

that include

microwave ovens, washing machines and

dishwashers, are including embedded systems to provide flexibility, efficiency and features. The
latest in embedded applications are seen as advanced HVAC systems that uses networked
thermostats to more accurately and efficiently control temperature.
In the present times, home automation solutions are being increasingly built on embedded
technologies. Home automation includes wired and wireless-networking to control lights,
climate, security, audio/visual, surveillance, etc., all of which use embedded devices for sensing

TS
.IN

and controlling.

Railroad

Railroad signaling in Europe relies heavily on embedded systems that allows for faster, safer and
heavier traffic. Embedded technology has brought a sea of change in the way Railroad Signals

EN

are managed and Rail traffic in large volumes is streamlined.

The Embedded technology enabled Railroad Safety Equipment is increasingly being adopted by
Railway networks across the globe, with an assurance of far lesser Rail disasters to report.

industry.

TU
D

VECTOR Institute prepares embedded students for the challenges associated with Railroad

TS

Electronic payment solutions sector

In the present times there is stiff competition amongst embedded solutions providers to deliver
innovative, and high-performance electronic payment solutions that are easy to use and highly

CI

secure. Embedded engineers knowledgeable in trusted proprietary technology develop the


secure, encrypted transactions between payment systems and major financial institutions.
The market for mobile payments systems is growing rapidly. It is driven by retailers, restaurants,
and other businesses that want to service customers anywhere, anytime. With the use of mobile
devices, mostly mobile phones becoming very popular, embedded technologies compatible with
mobile are being developed to promote payment systems.

CITSTUDENTS.IN

Page 17

EMBEDDED SYSTEMS

10EE665

Smart cards industry

Smart cards, though began prominently as either a debit or a credit card, are now being
introduced

in personal identification and entitlement schemes at regional,

national, and

international levels. Smart cards are appearing now as Citizen Cards, drivers licenses, and
patient cards.
We also come across contactless smart cards that are part of ICAO biometric passports aim to

TS
.IN

enhance security for international travel. Europe enjoys precedence in the use of Smart cards. All
the E-services (e-banking, e-health, e-training) are based on the leading edge in smart-card
related technologies.

System on chip (SoC)

EN

Example of Embedded systems SOC for cell less bar code scanner.

Lately, embedded systems are being designed on a single silicon chip, called System on chip
(SoC). SoC is a new design innovation for embedded systems. An embedded processor is a part

TU
D

of the SoC VLSI circuit. A SoC may be embedded with the following components: multiple
processors, memories, multiple standard source solutions, called IP (Intellectual Property) cores
and other logic and analog units. A SoC may also have a network protocol embedded into it. It
may also embed an encryption function unit. It can embed discrete cosine transforms for signal
For a

TS

processing applications. It may embed FPGA (Field Programmable Gate Array) cores.

number of applications, the GPP (microcontrollers, microprocessors or DSPs) cores may not
suffice. For security applications, killer applications, smart card, video game, palm top computer,

CI

cell phone, mobile-Internet, hand-held embedded systems, Gbps transceivers, Gigabits per
second LAN systems and satellite or missile systems, we need special processing units in a VLSI
designed circuit to function as a processor. These special units are called Application Specific
Instruction Processors (ASIP). For an application, both the configurable processors (called
FPGA cum ASIP processors) and non-configurable processors (DSP or Microprocessor or
Microcontrollers) might be needed on a chip.

CITSTUDENTS.IN

Page 18

EMBEDDED SYSTEMS

10EE665

Block Diagram

A barcode reader (or barcode scanner) is an electronic device for reading printed barcodes. Like
a flatbed scanner, it consists of a light source, a lens and a light sensor translating optical
impulses into electrical ones. Additionally, nearly all barcode readers contain decoder circuitry
analyzing the barcode's image data provided by the sensor and sending the barcode's content to

CI

TS

TU
D

EN

TS
.IN

the scanner's output port.

Design Considerations
Features
TMS320C54x DSPs

CITSTUDENTS.IN

Page 19

EMBEDDED SYSTEMS

10EE665

100% code-compatible with C5000 devices


16-bit, fixed-point DSPs with power dissipation as low as 40 mW
Single and multi-core products delivering 300-532 MIPS
Three power-down modes
Integrated RAM and ROM configurations
Ultra-thin packaging Audio Power Amplifier

TS
.IN

Efficient Class-D operation


Only three external components (TPA2005D1)

Internal gain (TPA3007D1: 12, 18, 23.6, 36dB) Independent gain control ('2005D1)
THD+N = 0.2% at 1kHz; PSRR = -73 dB ('3007D1) & -75dB ('2005D1) Touch Screen
Controller
Integrated 4-wire touch screen controller

Direct battery measurement

EN

Highly programmable

Stereo audio DAC with 48ksps sampling rate

TU
D

SPI interface Audio DAC

Accepts 16- to 24-bit data; Left, Right I2S Format; wide sampling frequency - 5kHz to
200kHz

Hardware controlled

TS

Benefits

Audio Power Amplifier

CI

Eliminates need for heat sink


Reduces board space
Minimizes noise
Excellent audio fidelity

Touch Screen Controller


Fully automated modes of operation
Controls resolution, speed, timing & averaging
Monitors battery voltage
CITSTUDENTS.IN

Page 20

EMBEDDED SYSTEMS

10EE665

High-quality audio playback


Direct serial bus connection to controller

Audio DAC
Flexible interface to processor
Simplifies system design

CI

TS

TU
D

EN

TS
.IN

Minimizes noise

CITSTUDENTS.IN

Page 21

EMBEDDED SYSTEMS

10EE665

UNIT - 3
TECHNOLOGICAL ASPECTS OF EMBEDDED SYSTEM : Interfacing between analog and
digital blocks, Signal conditioning, digital signal processing, DAC & ADC interfacing, Sample
& hold, multiplexer interface Internal ADC interfacing (excluding 6805 & 6812), Data
Acquisitio n System and Signal conditioning using DSP.

TS
.IN

Analog-to-digital and digital-to-analog I/O concepts

Analog refers to physical quantities that vary continuously instead of discretely. Physical
phenomena typically involve analog signals. Examples include temperature, speed, position,
pressure, voltage, altitude, etc. Microprocessors work with digital quantities (values taken from
the discrete domain). For a digital system to interact with analog systems, conversion between

EN

analog and digital values is needed. Building blocks to perform the conversions are: (1) Digital
to analog converters (DACs), (2) Analog to digital converters (ADCs). A digital to analog
converter has a digital input that specifies an output whose value changes in steps. These step
changes are in volts or amperes. The analog to digital converter has an input that can vary from a

CI

TS

the input value.

TU
D

minimum to a maximum value of volts or amperes. The output is a digital number that represents

Transducers

A device that converts a process variable (ex. Car speed) into an electrical signal or vice versa.
Sensors (Input transducers): Potentiometer (position); strain gauge, piezoelectric device
(force); thermistor, thermocouple (temperature); photoconductive cell, phototransistor (light);
current transformer, SENSEFET (current); microphone (sound), etc.
CITSTUDENTS.IN

Page 22

EMBEDDED SYSTEMS

10EE665

Actuators (Output transducers): solenoids, relays, speakers; darlington transistors, triacs, etc.

TS

TU
D

EN

TS
.IN

Some common sensors

Signal Conditioning

CI

Signal conditioning is sometimes necessary because raw sensor outputs are not always suitable
for analog-to-digital conversion.
Amplification: Op amps are preferred because of their performance characteristics
Open Loop gain: several hundred thousand, input current ~0, output
impedance ~0.
Filtering: LPF

CITSTUDENTS.IN

Page 23

EMBEDDED SYSTEMS

10EE665

Concepts and terminology

De finitions
Offset: minimum value
Span: maximum value minimum value of Some common spans:
range of 0 V to 5 V: span = 5 V

range of 12 V to 12 V: span = 24 V

range of 4 mA to 20 mA: span = 16 mA

TS
.IN

Weight: The analog change corresponding to a change in a bit in the digital number.

Step size: span / 2n (Typically, the digital representation is an unsigned n- bit integer) (n is
the number of bits in the corresponding digital code. e.g. n=0 for a 1-bit number)
Resolution: Same as step size. Weight of the LSB.

EN

Example: Analog signal in range +5 to -5 volts, 8- bit ADC:


Offset = 5 V

TU
D

Span = 10 V
Step size = 10 / 256 = 39.1 mV

Notice that the MSB has a weight of 5 V (= span/ 2), and the LSB has a weight of .0391 V

Equations

TS

Analog number = (bn-1 21 + b0 2-n) x step size + offset


= (digital number x step size) + offset

CI

Digital number = (analog number offset) / (step size)

These equations hold true as long as the numbers are within the range. If the input of an A/D is
below the minimum or above the maximum of the range, the corresponding digital value will be
minimum or maximum, respectively. In practice, extreme input swing beyond the specified
range may damage the device.

Example:

CITSTUDENTS.IN

Page 24

EMBEDDED SYSTEMS

10EE665

6-bit D/A converter, analog output range:-2.5 to 5 volts. Calculate the analog output when the
input is %010101 (decimal 21)

Offset: -2.5 V
Span: 7.5 V

Analog number = 21 x 0.1171 2.5 = -0.039 V

TS
.IN

Step size: 0.1172 V

Example: As an example the following table lists some values for -5 V to +5 V analog ranges to
8-bit digital conversion:

-5
-3.75
-2.5

TU
D

-1.25

Digital (hex)

EN

Analog (V)

00
20
40
60
80

1.25

A0

2.5

C0

3.75

E0

TS

5-0.0391=4.961

FF

CI

Digital-to-Analog Converters

A DAC takes an n- bit digital input and output a corresponding analog voltage. DAC systems
normally consist of three components: (a) A reference voltage, (b) The DAC itself, (c) An op
amp for output buffering.

CITSTUDENTS.IN

Page 25

10EE665

TS

TU
D

EN

TS
.IN

EMBEDDED SYSTEMS

Many digital-to-analog converters use R-2R ladder network. Inverted ladder type of network is

CI

shown in the figure below. The switches are analog switches controlled by digital signals. The

output voltage (V) is proportional to the binary input. Each branch of the ladder network
contributes current whose value is proportional to the bit weight of that branch. The amplifier
circuit sums the current components to produce a voltage proportional to the binary input.

CITSTUDENTS.IN

Page 26

10EE665

Interfacing DAC to microprocessor system

TS
.IN

EMBEDDED SYSTEMS

EN

DAC integrated circuits are available with different bit resolutions. In principle, any DAC can be
interfaced to any microprocessor system. In practice, some combinations of DACs and
microprocessors are easier than others and require much simpler hardware and software in the

TU
D

interface. Here, interfacing a 12-bit DAC to an 8-bit microprocessor will be considered. This will
serve to show how to mate different bit resolutions with different size data buses. Also, the

CI

TS

importance of double buffering will be illustrated.

CITSTUDENTS.IN

Page 27

EMBEDDED SYSTEMS

10EE665

The figure given above shows an interface for a microprocessor operating in expanded
multiplexed mode. The latches are used to convert a sequence of 2 bytes into one 12 -bit word.
To output a 12-bit word, the microprocessor writes the data in two steps. First, it puts the upper 4
bits on the lower nibble of the data bus. Then it selects the latch address. The address decoder
decodes the address and drives the latch chip select input low. Also, the microprocessor d rives
the address line A0 low so that only the 4-bit latch accepts data from the data bus. Then the
microprocessor repeats the sequence for the lower 8 bits except that it drives A0 high. The other

TS
.IN

purpose of the latches is to provide the double buffering. The updated latch data is not
transferred to the DAC until the microprocessor drives the control line to latch in data to the
buffer in the DAC. DAC does not change its output until is driven low. Note that this is
important when there is a change in the upper nibble.

EN

Analog-to-Digital Converters

The function of ADCs is to quantize the analog voltage and then output the corresponding digital
code value. As with the DAC conversion, a full- scale analog voltage will be divided into 2

the conversion.

TU
D

quantization levels or steps for an n- bit digital coding scheme. Several techniques are used to do
Among them successive approximation which has a medium conversion speed

(nominally 20 ms) is common in computer systems.

TS

The ADC has a built in DAC. A sample and hold circuit stores an analog input. The ADC logic
steps through a sequence of trial-and-error guessing to find the digital equivalent of the input. It
begins the sequence by sending a digital signal that is at midrange to the DAC. The analog

CI

output Vout from the DAC is compared to the analog input Vin from the sample-and-hold circuit.
Thus, the ADC determines whether the analog input is above, at or below half scale. It continues
determining to which half of the next range selection the analog input belongs.

CITSTUDENTS.IN

Page 28

EMBEDDED SYSTEMS

10"EE665

DIGITAL
OUTPUT

+- ---,
VIN from on onolog sample end hold circuit

DONE
CONVfRSION _

COt.lP.ARATOR
DAC

LOGIC

1----'-- o

Block Diagram of Successive-Approximation


System

TS

TU
D

(a)

EN

TS
.IN

OUT analog

Cout high if VIN > VOUT


Cout low if V1N S VOUT

CI

(b) Operation of Comparator

CITSTUDENTS.IN

Page 29

EMBEDDED SYSTEMS

10"EE665

Successive Approximation example

STEP 1

Start with
05 = 1

Keep 05 = 1

STEP 2

Start with
04 = 1

TS
.IN

Guess
Low

EN

Guess
Low

Keep 04

Start with
03 = 1

TU
D

STEP 3

Guess
High

CI

TS

Reset 03 = 0

CITSTUDENTS.IN

Page 30

10EE665

TU
D

68HC11 A/D Converter

EN

TS
.IN

EMBEDDED SYSTEMS

The 68HC11 has a built-in A/D subsystem, but it does not have a D/A, although it can easily be
interfaced to one. External D/A converter such as DAC0808 ( 8-bit D/A) can be used. 68HC11
uses an A/D which in turn uses a D/A to generate internal signals as part of the process to

TS

convert analog to digital. This is common to many types of A/Ds.

68HC11 supports 8 input ADC channels

Channels are located on port E (Channel 0 on PE0, Channel 1 on PE1, etc.)

In performing A/D conversions, 4 conversions are performed as a "block," each taking 32

CI

cycles -- 128 cycles total

Control registers:
o

OPTION ($ 1039): ADPU and CSEL bits

ADCTL ($ 1030): Control and status information

CITSTUDENTS.IN

Page 31

EMBEDDED SYSTEMS

ADR1 - ADR4 ($ 1031 - $1034): Result registers

TU
D

EN

TS
.IN

10EE665

CI

TS

More detailed description for conversion

CITSTUDENTS.IN

Page 32

EMBEDDED SYSTEMS

10EE665

DAC is replaced by a series of capacitors that are charged to the voltages that correspond
to the weights of each bit

During the sample mode, the capacitors are charged. This total charge is proportional to
the input analog signal. For the duration of the conversion process, this total charge
remains conserved. The A/D switches to the hold mode and then to the approximation
mode. The approximation mode is a sequence of successive approximation steps that

TS
.IN

switches different capacitors to modify the input voltage to the comparator. The result of
each step sets or resets a corresponding bit in a successive approximation register (SAR).

VRH is normally set to the signal maximum (analog value for digital data $FF) and VRL is
set to minimum (analog value of $00). However, VRH should not be higher than 6 V and
VRL should not be lower than ground, and VRH - VRL should be greater than 2.5 V.

8-bit outputs from four successive conversions are placed into analog data registers

68HC11 A/D related Registers

EN

ADR1-ADR4.

TU
D

The MCU on the EVB has an 8-bit register at location $1030 that is the A/Ds control and status
register (ADCTL). Bits 0-5 are the control bits and may be read from or written to. Bit 6 is not
used and is always read as logic 0. Bit 7 is a status bit and can only be read. Data written to this

TS

bit is ignored.

Data Acquisition Systems (DAS)

CI

Data acquisition systems (DAS) interface between the real world of physical parameters, which
are analog, and the articial world of digital computation and control. With current emphasis on

digital systems, the interfacing function has become an important one; digital systems are used
widely because complex circuits are low cost, accurate, and relatively simple to implement. In
addition, there is rapid growth in the use of microcomputers to perform difficult digital control
and measurement functions. Computerized feedback control systems are used in many different
industries today in order to achieve greater productivity in our modern industrial societies.
Industries that presently employ such automatic systems include steel making, food processing,

CITSTUDENTS.IN

Page 33

EMBEDDED SYSTEMS

paper

production,

10EE665

oil

manufacturing, and others.

rening,

chemical

manufacturing,

textile

production,

cement

The devices that perform the interfacing function between analog

and digital worlds are analog-to-digital (A/D) and digital-to-analog (D/A) converters, which
together are known as data converters. Some of the specic applications in which data converters
are used include data telemetry systems, pulse code modulated communications, automatic test
systems, computer display systems, video signal processing systems, data logging systems, and

meter contains an A/D converter.

BASIC DATA ACQUISITION SYSTEM

TS
.IN

sampled data control systems. In addition, every laboratory digital multimeter or digital panel

Besides A/D and D/A converters, data acquisition and distribution systems may employ one or
more of the following circuit functions:
transducers,

ampliers,

lters,

nonlinear analog functions,

analog multiplexers,

sample-holds.

TU
D

EN

The interconnection of these components is shown in the diagram of the data acquisition portion
The input to the system is a physical

TS

of a computerized feedback control system in Figure 1.

parameter such as temperature, pressure, ow, acceleration, and position, which are analog
quantities. The parameter is rst converted into an electrical signal by means of a transducer;

CI

once in electrical form, all further processing is done by electronic circuits.

Next, an amplier boosts the amplitude of the transducer output signal to a useful level for

further processing .

Transducer outputs may be microvolt or millivolt level signals, which are then amplied to 1 to
10 V levels. Furthermore, the transducer output may be a highimpedance signal, a differential

CITSTUDENTS.IN

Page 34

EMBEDDED SYSTEMS

10EE665

signal with common-mode noise, a current output, a signal superimposed on a high voltage, or a

TS
.IN

combination

specialized types.

EN

The amplier, in order to convert such signals into a high-level voltage, may be one of several
The amplier is frequently followed by a low-pass active lter that reduces

high-frequency signal components, unwanted electrical interference noise, or electronic noise

TU
D

from the signal. The amplier is sometimes also followed by a special nonlinear analog function
circuit that performs a nonlinear operation on the high-level signal. Such operations include
squaring,

multiplication,

division,

rms

conversion,

log

conversion,

or

linearization.

The

processed analog signal next goes to an analog multiplexer, which switches sequentially between
a number of different analog input channels each input is in turn connected to the output of the

TS

multiplexer for a specied period of time by the multiplexer switch. During this connection time,
a sample-hold circuit acquires the signal voltage and then holds its value while an A/D converter
converts the value into digital form. The resultant digital word goes to a computer data bus or to

CI

the input of a digital circuit.

Thus the analog multiplexer, together with the sample hold, time shares the A/D converter with a
number of analog input channels.

The timing and control of the complete DAS is done by a

digital circuit called a programmer sequencer, which in turn is under the control of the computer.

In some cases, the computer itself may control the entire DAS. While this is perhaps the most
commonly used DAS conguration, there are alternative ones. Instead of multiplexing high-level
CITSTUDENTS.IN

Page 35

EMBEDDED SYSTEMS

10EE665

signals, low-level multiplexing is sometimes used with the amplier following the multiplexer.
In such cases, just one amplier is required, but its gain may have to be changed from one
channel to the next during multiplexing. Another method is to amplify and convert the signal into
digital form at the transducer location and send the digital information in serial form to the
computer. Here, the digital data must be converted to parallel form and then multiplexed onto the

TS
.IN

computer data bus.

Signal conditioning using DSP

The use of a digital signal processor offers the designer the ability to compensate for, or to
completely avoid, the limitations outlined in the last section. The effects of residual null signal
and transducer non-linearity can be compensated by digital error correction, while the use of

EN

digital demodulation techniques make the system insensitive to spurious phase shifts up to 90
degrees. A software correction algorithm is easily able to compensate for static errors in the
output measurement by means of a software correction map. The software determines a

TU
D

correction offset y interpolation between the nearest points in the map and applies it to the
measurement a simple process taking only a few CPU cycles. The correction map is stored in
internal non-volatile memory, and can be programmed during routine calibration of the

CI

TS

transducer.

CITSTUDENTS.IN

Page 36

EMBEDDED SYSTEMS

10EE665

UNIT 4
DESIGN TRADE OFFS
CONSIDERATIONS:
Issues in embedded
considerations.

DUE

system design.

TO

PROCESS

Design

challenge,

INCOMPATIB ILITY,

THERMAL

design technology, tradeoffs.

Thermal

Issues in embedded system design

TS
.IN

Embedded computers typically have tight constraints on both functionality and implementation.
In particular, they must guarantee real time operation reactive to external events, conform to size
and weight limits, budget power and cooling consumption, satisfy safety and reliability
requirements, and meet tight cost targets.

EN

Real time/reactive operation

Real time system operation means that the correctness of a computation depends, in part, on the
time at which it is delivered. In many cases the system design must take into account worst case

TU
D

performance. Predicting the worst case may be difficult on complicated architectures, leading to
overly pessimistic estimates erring on the side of caution. The Signal Processing and Mission
Critical example systems have a significant requirement for real time operation in order to meet

TS

external I/O and control stability requirements.

Reactive computation means that the software executes in response to external events. These
events may be periodic, in which case scheduling of events to guarantee performance may be

CI

possible. On the other hand, many events may be aperiodic, in which case the maximum event
arrival rate must be estimated in order to accommodate worst case situations. Most embedded
systems have a significant reactive component.

Design challenge:

Worst case design analyses without undue pessimism in the face of hardware with
statistical performance characteristics e.g., cache memory.
CITSTUDENTS.IN

Page 37

EMBEDDED SYSTEMS

10EE665

Small size, low weight

Many embedded computers are physically located within some larger artifact. Therefore, their
form factor may be dictated by aesthetics, form factors existing in pre-electronic versions, or
having to fit into interstices among mechanical components. In transportation and portable
systems, weight may be critical for fuel economy or human endurance. Among the examples, the

TS
.IN

Mission Critical system has much more stringent size and weight requirements than the others
because of its use in a flight vehicle, although all examples have restrictions of this type.

Design challenges:

EN

Non-rectangular, non-planar geometries.

Packaging and integration of digital, analog, and power circuits to reduce size.

TU
D

Safe and reliable

Some systems have obvious risks associated with failure. In mission-critical applications such as
aircraft flight control, severe personal injury or equipment damage could result from a failure of
the

embedded

computer.

Traditionally,

such systems

have

employed

multiply-redundant

TS

computers or distributed consensus protocols in order to ensure continued operation after an


equipment failure.

CI

However, many embedded systems that could cause personal or property damage cannot tolerate
the added cost of redundancy in hardware or processing capacity needed for traditional fault
tolerance techniques. This vulnerability is often resolved at the system level as discussed later.

Design challenge:

Low-cost reliability with minimal redundancy.

CITSTUDENTS.IN

Page 38

EMBEDDED SYSTEMS

10EE665

Harsh environment
Many embedded systems do not operate in a controlled environment. Excessive heat is often a
problem,

especially

in

applications

involving

combustion

(e.g., many

transportation

applications). Additional problems can be caused for embedded computing by a need for
protection from vibration, shock, lightning, power supply fluctuations, water, corrosion, fire, and
general physical abuse. For example, in the Mission Critical example application the computer
must function for a guaranteed, but brief, period of time even under non-survivable fire

TS
.IN

conditions.

Design challenges:

Accurate thermal modeling.

EN

De-rating components differently for each design, depending on operating environment.

Cost sensitivity

TU
D

Even though embedded computers have stringent requirements, cost is almost always an issue
(even increasingly for military systems). Although designers of systems large and small may talk
about the importance of cost with equal urgency, their sensitivity to cost changes can vary
dramatically. A reason for this may be that the effect of computer costs on profitability is more a

TS

function of the proportion of cost changes compared to the total system cost, rather than
compared to the digital electronics cost alone. For example, in the Signal Processing system cost
sensitivity can be estimated at approximately $1000 (i.e., a designer can make decisions at the

CI

$1000 level without undue management scrutiny). However, with in the Small system decisions
increasing costs by even a few cents attract management attention due to the huge multiplier of
production quantity combined with the higher percentage of total system cost it represents.

Design challenge:

Variable "design margin" to permit tradeoff between product robustness and aggressive
cost optimization.
CITSTUDENTS.IN

Page 39

EMBEDDED SYSTEMS

10EE665

Design challenge
Design matrics:
A Design metric is a measure of implementations features such as cost, size, performance and
power. Embedded system

must cost less

must perform in real time (response time

TS
.IN

must be sized to fit on a single chip.

The embedded system designer must be designed to meet the desired functionality. Apart
meeting the functionality, should also consider optimizing numerous design metrics.

EN

Common design metrics that a design engineer should consider:

NRE( non recurring engineering Cost) : The one time monetary cost of designing the

TU
D

system.

Unit cost: Monetary cost of manufacturing each copy of the system, excluding NRE cost.
Size: physical space required by the system. Often measured in terms of bytes in case of
software, and no. of gates in terms of hardware.

TS

Performance: execution/response time of the system.


Power: The amount of power consumed by the system, which may define lifetime of the
battery and cooling requirement of IC. More power means more heat.

CI

Flexibility: ability to change the functionality of the system.


Time to prototype: time needed to build a working system w/o incurring heavy NRE.
Time to market: time required to develop & released to the market.

Maintainability: ability to modify the system after its release to the market.
Correctness: our confidence that we have implemented systems functionality correctly.
Safety: probability that the system does not cause any harm.

Metrics typically compete with one another: improving one often leads to worsening of
CITSTUDENTS.IN

Page 40

EMBEDDED SYSTEMS

10EE665

CI

TS

TU
D

EN

TS
.IN

another

CITSTUDENTS.IN

Page 41

EMBEDDED SYSTEMS

10EE665

TS
.IN

De s ign me tric compe tition

Time to Market Design Metric:

Introducing an embedded system early to the market can make big

EN

The time to market:

difference in terms of systems profitability

Market windows generally will be very narrow, often in the order of few months.

CI

TS

TU
D

Missing this window can mean significant loss in sales.

Time to Market

(A) Market window and simplified revenue model for computing revenue loss

CITSTUDENTS.IN

Page 42

EMBEDDED SYSTEMS

10EE665

Lets investigate the loss of revenue that can occur due to delayed entry of a product in the
market. We can use a simple triangle model y axis is the market rise, x axis to represent the point
of entry to the market. The revenue for an on time market entry is the area of the triangle labeled
on time and the revenue for a delayed entry product is the area of the triangle labeled
Delayed. The revenue loss for a delayed entry is the difference of these triangles areas.

TS
.IN

% revenue loss = ((on time Delayed)/on time)*100 %


The area of on time triangle = * base * height
W -- height the market raise

D -- Delayed entry (in terms of weeks or months)

EN

2W products life time

Area of on time triangle = *2W*W

Area of delayed triangle=1/2*(W-D+W)*(W-D)

TU
D

%age revenue loss = (D (3W- D)/2W*W) * 100 %


Ex: products life time is 52 weeks

Delay of entry to the market is 4 weeks


Percentage revenue loss = 22%

converting behaviour on general-purpose processors to assembly code, and by converting

TS

By

behaviour on single purpose processors to a connection of register-transfer components and state


machines. The designer then refines the RT level specification into a logic specification. The

CI

NRE and Unit cost Design metrics:

Unlike other design metric the best technology choice will depend on the no of units.

Tech: A

would result in

NRE cost $2000

unit cost $100

$30000

$30

100000

$2

CITSTUDENTS.IN

Page 43

EMBEDDED SYSTEMS

10EE665

Total cost= NRE cost + unit cost* no of units


Per product cost = total cost/no of units
= NRE cost/no of units + unit cost

The performance Design metric:

Performance of a system is a measure of how long the system takes to execute our desired tasks.

TS
.IN

There are several measures of performance. The two main measures are:

Latency or response time

Throughput : no of tasks that are processed in unit

EN

speed up is a method of comparing performance of two systems

TU
D

Speed up of A over B = performance of A/performance of B.

DESIGN TECHNOLOGY:

Design technology involves the manner in which we convert our concept of desired system
functionality into an implementation. We must not only design the implementation to optimise

TS

design metrics, but we must do so quickly.

Variations of a top-down design process have become popular in the past decade, an ideal form

CI

of which is illustrated in the figure. The designer refines the system through several abstraction
levels. At the system level the designer describes the desired functionality in an executable

language like C. This is called system specification.

The designer refines this specification by distributing portions of it among several general and/or
single purpose processors, yielding behavioural specifications for each processor.

The designer refines these specifications into register-transfer (RT) specifications


CITSTUDENTS.IN

Page 44

EMBEDDED SYSTEMS

10EE665

Finally, the designer refines the remaining specifications into an implementation consisting of
machine code for general purpose processors and a design gate level net list for single purpose
processors.

TU
D

EN

TS
.IN

Deal top-down design process, and productivity improvers .

There are three main approaches to improving the design process for increased productivity,
label as

compilation/synthesis,

libraries/IP, and test/verification. Several other

TS

which we

approaches also exist.

CI

Compilation/Synthesis

Compilation/Synthesis lets a designer specify desired functionality in an abstract manner, and


automatically generates

lower-level implementation details.

Describing a

system at high

abstraction levels can improve productivity by reducing the amount of details, often by an order
of magnitude, that a design must specify.

CITSTUDENTS.IN

Page 45

EMBEDDED SYSTEMS

10EE665

A logic synthesis tool converts Boolean expressions into a connection of logic gates (called a net
list). A register-transfer (RT) synthesis tool converts finite-state machines and register-transfers
into a data path of RT components and a controller of Boolean equations. A behavioral synthesis
tool converts a sequential program into finite-state machines and register transfers. Likewise, a
software compiler converts a sequential program to assembly code, which is essentially registertransfer code. Finally, a system synthesis tool converts an abstract system specification into a set
of sequential programs

TS
.IN

on general and single-purpose processors.

The relatively recent maturation of RT and behavioral synthesis tools has enabled a unified view
of the design process for single-purpose and general-purpose processors. Design for the former is
commonly known as hardware design, and design for the latter as software design. In the
past, the design processes were radically different software designers wrote sequential

EN

programs, while hardware designers connected components.

The co-design ladder: Recent maturation of synthesis enables a unified view of hardware

CI

TS

TU
D

and software.

CITSTUDENTS.IN

Page 46

EMBEDDED SYSTEMS

10EE665

Libraries/IP

Libraries

involve

re-use

of

pre-existing

implementations.

Using

libraries

of

existing

implementations can improve productivity if the time it takes to find, acquire, integrate and test a
library item is less than that of designing the item oneself. A logic-level library may consist of
layouts for gates and cells. An RT-level library may consist of layouts for RT components, like

commonly used

components,

such as

TS
.IN

registers, multiplexors, decoders, and functional units. A behavioral-level library may consist of
compression components, bus interfaces, display

controllers, and even general purpose processors. The advent of system-level integration has
caused a great change in this level of library.

EN

Test/Verification

Test/Verification involves ensuring that functionality is correct. Such assurance can prevent
time-consuming debugging at low abstraction levels and iterating back to high abstraction levels.

TU
D

Simulation is the most common method of testing for correct functionality, although more formal
verification techniques are growing in popularity. At the logic level, gate level simulators

CI

TS

provide output signal timing waveforms given input signal waveforms.

CITSTUDENTS.IN

Page 47

EMBEDDED SYSTEMS

10EE665

Likewise, general-purpose processor simulators execute machine code. At the RT-level, hardware
description language (HDL) simulators execute RT-level descriptions and provide output waveforms
given input waveforms. At the behavioral level, HDL simulators simulate sequential programs, and cosimulators connect HDL and general purpose processor simulators to enable hardware/software coverification. At the system level, a model simulator simulates the initial system specification using an
abstract computation model, independent of any processor technology, to verify correctness and

TS
.IN

completeness of the specification.

More productivity improve rs

There are numerous additional approaches to improving designer productivity. Standards focus on
developing well-defined methods for specification, synthesis and libraries. Such standards can reduce the
problems that arise when a designer uses multiple tools, or retrieves or provides design information from
or to other designers. Common standards include language standards, synthesis standards and library

EN

standards.

Languages focus on capturing desired functionality with minimum designer effort. For example, the

TU
D

sequential programming language of C is giving way to the object oriented language of C++, which in
turn has given some ground to Java. As another example, state -machine languages permit direct capture
of functionality as a set of states and transitions, which can then be translated to other languages like C.

Frameworks provide a software environment for the application of numerous tools throughout the design

TS

process and management of versions of implementations. For example, a framework might generate the
UNIX directories needed for various simulators and synthesis tools, supporting application of those tools

CI

through menu selections in a single graphical user interface.

Thermal considerations

Embedded Applications differ from the typical desktop, server and mobile markets. Some of the different
requirements for embedded applications include higher ambient temperatures, need for higher max
component temperature spec, low platform power, long life support, small form factors, and extended
usage conditions (24 x 7 x 365 operation). Due to these differences there are special considerations for

CITSTUDENTS.IN

Page 48

EMBEDDED SYSTEMS

10EE665

component and system level thermal solution design. Thermal solution design requires an engineer to
fully understand the system and various form factor boundary conditions and component level attributes.
This document will define thermal cooling schemes: passive, active and fan less thermal solutions and
their difference via the three modes of heat transfer (conduction, convection, and radiation). The thermal
performance metrology will be explained, using a thermal resistance calculation and how to apply to Intel
components. The methodology will highlight typical Intel component specifications such as TJ -MAX,
TCASE-MAX, TAMBIENT and Thermal Design Power (TDP). In addition some thermal features such

TS
.IN

as the Digital Thermal Sensor (DTS) and Thermal Monitor will be explained.

Computing platform component power has decreased as a result of silicon technology improvement.
However, it is still critical to cool the components to adequately ensure a products long-life reliability. In
embedded applications, there are challenges which are more demanding than the general computing
systems such as desktops, notebooks, and workstations/servers. The major differences are the target usage
model and operating environment. Typically, embedded applications are in harsh environments, such as

EN

outdoors, factory assembly lines, and telecomm base stations. Conversely, the usual desktop, mobile, and
workstation/ server are typically deployed in homes, offices, and data centers where there are controlled
environmental conditions.

TU
D

Intel provides a wide variety of embedded processors and chipsets that have features and specifications
that are suited for embedded markets. These components typically have high maximum temperatures
limits, long life availability and features such as Digital Thermal Sensor and Enhanced Intel SpeedStep
Technology. All of these features will aid the embedded thermal engineer in designing robust thermal
solutions for Intel Architecture.

TS

Cooling Methods

CI

There are three basic types of thermal solutions for electronics cooling: passive thermal
solutions, active thermal solutions and fan less thermal solutions. The type of cooling solution
used in an embedded system will vary depending on the form factor, component specifications,

and boundary conditions. All thermal solutions rely on the three modes of heat transfer to

dissipate the heat from the component: conduction, convection and radiation.

CITSTUDENTS.IN

Page 49

EMBEDDED SYSTEMS

10EE665

Three Modes of Heat Transfer


Conduction
Thermal conduction is the process in which thermal energy transfers through matter, from a
region of higher temperature to lower temperature and acts to equalize the temperature
difference. It can also be described as the heat energy transferred from one material to another by
direct contact.

TS
.IN

Convection

Convection is the transfer of thermal energy between two surfaces as a consequence of a relative
velocity between them. The most practical application is where one surface is a solid and the
other is a fluid.

EN

Radiation

Radiation cooling is the transfer of heat by electromagnetic emission, primarily in the infrared

TU
D

wavelengths. While the transfer of energy by conduction and convection requires the presence of
a material medium, radiation does not. In fact, radiation transfer occurs most effectively in a
vacuum.

TS

Active Thermal Solutions

An active thermal solution is a heat sink that incorporates a fan attached directly to it. This is the

CI

most common type of thermal solution for desktop computers. In general embedded applications
do not use this type of thermal solution. These solutions usually require more height above the
motherboard than embedded form factors can provide.

Passive Thermal Solution

Passive thermal solutions are the most common type of thermal solution for embedded
applications. This type of thermal solution employs a solid metal heat sink attached to the heat
CITSTUDENTS.IN

Page 50

EMBEDDED SYSTEMS

10EE665

dissipating component and then with system airflow the heat is removed. Since the airflow is
provided by system fan(s), the velocity tends to be much lower than that of an active heat sink,
resulting in a lower convection heat transfer coefficient. There could be obstacles, like
motherboard components, that are placed between the system fan and the passive heat sink,
which creates a resistance to the forced air flow from system fan. In turn, this usually requires a
larger heat sink to achieve the same performance, since the thermal solution must rely on more
conductive heat transfer. The advantage of passive thermal solutions is that they can be used in

TS
.IN

form factors where the z-height above the motherboard is limited. In some usage models, the
fans are grouped into an easily removable tray fastened to the system chassis air inlet, which
allows for swapping of defective fan(s) from the system chassis.

Fan less Thermal Solution

EN

A fan less thermal solution refers to a solution that does not use a fan (system or component
level) to provide airflow. The only airflow is induced by the buoyancy effect where hot air
moves opposite the direction of gravity and cool air moves towards the direction of gravity. This

CI

TS

TU
D

air movement is created by the difference in air density and the resulting velocity is very low.

CITSTUDENTS.IN

Page 51

EMBEDDED SYSTEMS

10EE665

PART B
UNIT - 5 & 6

Software aspects of Embedded Systems :

Real time programming Languages, operating

systems, Programming concepts and embedded programming in C, Round Robin, Round Robin
with interrupts, function queue-scheduling architecture, Real time OS architecture, selecting

Real time programming Languages

TS
.IN

architecture. Introduction to RTOS.

Real-time programming has always been one of the most challenging programming disciplines.
Real-time

programming

requires

comprehensive

command

of

sequential

programming,

EN

concurrency, and, of course, time. Real-time programming has many application domains. In this
chapter, however, we structure our discussion around digital control systems for the following
two reasons. Firstly, digital control systems represent a large portion of real-time software in a

TU
D

diverse set of industries. Examples include automotive power train control systems, aircraft ight
control systems, electrical drive systems in paper mills, or process control systems in power
plants and reneries.

Real-time programs must guarantee response within strict time constraints.

Often real-

TS

time response times are understood to be in the order of milliseconds and sometimes
microseconds. In contrast, a non-real-time system is one that cannot guarantee a response time in
any situation, even if a fast response is the usual result.

The use of this word should not be

CI

confused with the two other legitimate uses of 'real-time'. In the domain of simulations, the term
means that the simulation's clock runs as fast as a real clock would; and in the domain of data

transfer, media processing and enterprise systems, the term is used to mean 'without perceivable

delay'.

Real-time software may use one or more of the following: synchronous programming

languages, real-time operating systems, and real-time networks, each of which provide essential
frameworks on which to build a real-time software application. A real-time system may be one
where its application can be considered (within context) to be mission critical. The anti-lock
brakes on a car are a simple example of a real-time computing system the real-time constraint
CITSTUDENTS.IN

Page 52

EMBEDDED SYSTEMS

10EE665

in this system is the time in which the brakes must be released to prevent the wheel from locking.
Real-time computations can be said to have failed if they are not completed before their deadline,
where their deadline is relative to an event. A real-time deadline must be met, regardless
of system load.

Most embedded systems have to function under certain real-time constraints.

Developing applications for such systems requires programming languages and abstractions
which are substantially different from those used for developing desktop applications. The aim of
this module is to introduce different real-time programming models and programming languages

TS
.IN

corresponding to each of these models.

Operating Systems

Operating system consists of a set of programs (software) that manages the hardware and
provides an environment to run multiple application programs. The OS shares the hardware

TU
D

Components of an Operating System

EN

(CPU, Memory, I/O controllers and I/O devices) among multiple application programs.

Operating system (OS) is not a single program; it is a set of programs. However the real core of
an operating system is called Kernel. The second important program of an OS is User Interface
(UI) program. Old operating systems used to have only Command Line user Interface (CLI)

TS

program called Shell. But all modern operating systems are coming with Graphical User
Interfaces (GUI) called Windows. All the other programs that come with the OS are utility

CI

application programs.

CITSTUDENTS.IN

Page 53

10EE665

TS
.IN

EMBEDDED SYSTEMS

EN

The set of programs that comes with OS, and which we call OS is shown inside the dashed lines.
The most important part of the OS is the Kernel. But just kernel alone is not enough. So OS
comes with two types of user interface programs. One is graphics based and other is command

TU
D

(or text) based. Besides these user interface programs, OS also includes many utility programs,
to create and list file, directories.

Following are the typical services provided by the Kernel to the system applications:

TS

File Services
I/O Services

CI

Multi-processing services
Multi-threading services
Memory allocation and mapping services
Signal/Event services
Inter Process Communication and Synchronization services
Time services
Network communication services

CITSTUDENTS.IN

Page 54

EMBEDDED SYSTEMS

10EE665

Kernel has got the following main responsibilities for the programs:

Loading a program into memory by allocating required memory


Providing a CPU time slice (i.e scheduling) for the above program to run
Providing the services (system calls) so that the program can use these services
Once the program is finished, unloading the application from memory and freeing the

CI

TS

TU
D

EN

TS
.IN

memory

CITSTUDENTS.IN

Page 55

EMBEDDED SYSTEMS

10EE665

Kernel performs the scheduling during the following events:

During timer interrupt from a timer device


During system call

TS
.IN

File Services

Using the file services one can write a program to do the following things:

Opening an existing file


Creating new a file

Writing data to a file sequentially or to selected areas of file

EN

Reading data from a file sequentially or from selected areas of a file

Reading the attributes (details such size, owner, permissions etc..) of a file

TU
D

Deleting a file
Changing the attributes of file

Opening an existing directory


Creating a new directory

Read the contents of a directory

TS

Closing the file or directory

CI

I/O Services

Using the file services one can write a program to do the following things:

Opening an I/O device


Reading from I/O device
Writing to I/O device
Reading the settings of an I/O device
Modifying the settings of an I/O device
CITSTUDENTS.IN

Page 56

EMBEDDED SYSTEMS

10EE665

Closing the I/O device

Programming concepts and embedded programming in C

Assembly language coding of an application has the following advantages:

TS
.IN

It gives a precise control of the processor internal devices and full use of processor
specific features in its instruction set and its addressing modes.

The machine codes are compact. This is because the codes for declaring the conditions,
rules, and data type do not exist. The system thus needs a smaller memory. Excess
memory needed does not depend on the programmer data type selection and ruledeclarations. It is also not the compiler specific and library functions specific.

EN

Device driver codes may need only a few assembly instructions. For example, consider a
small embedded system, a timer device in a microwave oven or an automatic washing
machine or an automatic chocolate vending machine. Assembly codes for these can be

CI

TS

TU
D

compact and precise, and are conveniently written.

CITSTUDENTS.IN

Page 57

EMBEDDED SYSTEMS

10EE665

It becomes convenient to develop the source files in C or C++ or Java for complex systems
because of the following advantages of high-level languages for such systems.

The development cycle is short for complex systems due to the use of functions
(procedures), standard library functions, modular programming approach and top down

TS
.IN

design. Application programs are structured to ensure that the software is based on sound
software engineering principles.

o Modular programming approach is an approach in which the building blocks are


reusable software components. Consider an analogy to an IC (Integrated Circuit).
Just as an IC has several circuits integrated into one, similarly a building block
may call several functions and library functions. A module should however, be

EN

well tested. It must have a well-defined goal and the well-defined data inputs and
outputs. It should have only one calling procedure. There should be one return
point from it. It should not affect any data other than that which is targeted. [Data
Encapsulation] It must return (report) error conditions encountered during its

TU
D

execution.

o Bottom up design is a design approach in which programming is first done for the
sub modules of the specific and distinct sets of actions. An example of the
modules for specific sets of actions is a program for a software timer, RTCSWT::

TS

run. Programs for delay, counting, finding time intervals and many applications
can be written. Then the final program is designed. The approach to this way of

designing a program is to first code the basic functional modules and then use

CI

these to build a bigger module.

o Top-Down design is another programming approach in which the main program


is first designed, then its modules, sub-modules, and finally, the functions.

Data type declarations provide programming ease. For example, there are four types of
integers, int, unsigned int, short and long. When dealing with positive only values, we
declare a variable as unsigned int. For example, numTicks (Number of Ticks of a clock
before the timeout) has to be unsigned. We need a signed integer, int (32 bit) in
CITSTUDENTS.IN

Page 58

EMBEDDED SYSTEMS

10EE665

arithmetical calculations. An integer can also be declared as data type, short (16 bit) or
long (64 bit). To manipulate the text and strings for a character, another data type is char.
Each data type is an abstraction for the methods to use, to manipulate, to represent, and
for a set of permissible operations.

Type checking makes the program less prone to error. For example, type checking does

TS
.IN

not permit subtraction, multiplication and division on the char data types. Further, it lets
+ be used for concatenation. [For example, micro + controller concatenates into
microcontroller, where micro is an array of char values and controller is another array of
char values.]

Control Structures (for examples, while, do - while, break and for) and Conditional
path design tasks simple.

EN

Statements (for examples, if, if- else, else - if and switch - case) make the program-flow

TU
D

Portability of non-processor specific codes exists. Therefore, when the hardware changes,
only the modules for the device drivers and device management, initialization and locator

CI

TS

modules and initial boot up record data need modifications.

CITSTUDENTS.IN

Page 59

EMBEDDED SYSTEMS

10EE665

Additional advantages of C as a high level languages are as follows:

1. It is a language between low (assembly) and high level language. Inserting the assembly
language codes in between is called in-line assembly. A direct hardware control is thus also
feasible by in-line assembly, and the complex part of the program can be in high-level language.

TS
.IN

The C program elements, header and source files and preprocessor directives are as follows:

Any C program first includes the header and source files that are readily available.
# include vxWorks.h /* Include VxWorks functions*/

# include semLib.h /* Include Semaphore functions Library */

EN

# include taskLib.h /* Include multitasking functions Library */

# include msgQLib.h /* Include Message Queue functions Library */


# include fioLib.h /* Include File-Device Input-Output functions Library */

TU
D

# include sysLib.c /* Include system library for system functions */


# include netDrvConfig.txt /* Include a text file that provides the Network Driver
Configuration. It provides the frame format protocol (SLIP or PPP or Ethernet) description, card
description/make, address at the system, IP address (s) of the node (s) that drive the card for

TS

transmitting or receiving from the network. */

# include prctlHandlers.c /* Include file for the codes for handling and actions as per the

CI

protocols used for driving streams to the network. */

Include is a preprocessor directive to include the contents (codes or data) of a file. The files that

can be included are given below. Inclusion of all files and specific header files has to be as per

requirements.

Including Codes Files: These are the files for the codes already available. For example, #
include prctlHandlers.c.

CITSTUDENTS.IN

Page 60

EMBEDDED SYSTEMS

10EE665

Including Constant data Files: These are the files for the codes and may have the
extension.const.
Including Stings data Files: These are the files for the strings and may have the extension
.strings or .str. or .txt. For example, # include netDrvConfig.txt
Including initial data Files:

There are files for the initial or default data for the shadow

ROM of the embedded system. The boot-up program is copied later into the RAM and

TS
.IN

may have the extension .init. On the other hand, RAM data files have the extension,
.data.

Including basic variables Files: These are the files for the local or global static variables
that are stored in the RAM because they do not posses the initial (default) values. The
static means that there is a common not more than one instance of that variable address
and it has a static memory allocation. There is only one real time clock, and therefore
with the extension .bss.

EN

only one instance of that variable address. These basic variables are stored in the files

Including Header Files: It is a preprocessor directive, which includes the contents (codes

TU
D

or data) of a set of source files. These are the files of a specific module. A header file has
the extension .h. Examples are as follows. The string manipulation functions are needed
in a program using strings. These become available once a header file called string.h is
included. The mathematical functions, square root, sin, cos, tan, atan and so on are
needed in programs using mathematical expressions. These become available by

TS

including a header file, called math.h. The pre-processor directives will be # include

CI

<string.h> and # include <math.h>.

Also included are the header files for the codes in assembly, and for the I/O operations (conio.h),

for the OS functions and RTOS functions. # include vxWorks.h is directive to compiler, which
includes VxWorks RTOS functions.

Note: Certain compilers provide for conio.h in place of stdio.h. This is because embedded
systems usually do not need the file functions for opening, closing, read and write. So when
including stdio.h, it makes the code too big.
CITSTUDENTS.IN

Page 61

EMBEDDED SYSTEMS

10EE665

What is the difference between inclusion of a header file, and a text file or data file or constants
file?

Consider the inclusion of netDrvConfig.txt.txt and math.h.

TS
.IN

The header files are well tested and debugged modules.


The header files provide access to standard libraries.

The header file can include several text file or C files.

A text file is description of the texts that contain specific information.

EN

Source files

Source files are program files for the functions of application software. The source files need to
be compiled. A source file will also possess the preprocessor directives of the application and

TU
D

have the first function from where the processing will start. This function is called main function.
Its codes start with void main ( ). The main calls other functions. A source file holds the codes as
like the ones given earlier.

TS

Configuration files

Configuration files are the files for the configuration of the system. Recall codes in Lines.
Device configuration codes can be put in a file of basic variables and included when needed. If

CI

these codes are in the file serialLine_cfg.h then # include serialLine_cfg.h will be
preprocessor directive. Consider another example. I# include os_cfg.h. It will include os_cfg
header file.

Preprocessor Directive

A preprocessor directive starts with a sharp (hash) sign. These commands are for the following
directives to the compiler for processing.
CITSTUDENTS.IN

Page 62

EMBEDDED SYSTEMS

10EE665

Preprocessor Global Variables: # define volatile boolean IntrEnable is a preprocessor


directive.

It means it is a directive before processing to consider IntrEnable a global

variable of boolean data type and is volatile. [Volatile is a directive to the compiler not to
take this variable into account while compacting and optimising the codes.] IntrDisable,
IntrPortAEnable, IntrPortADisable, STAF and STAI are the other global variables.

TS
.IN

Preprocessor Constants: # define false 0 is a preprocessor directive. It means it is a


directive before processing to assume false as 0. The directive define is for allocating
pointer value(s) in the program. Consider # define portA (volatile unsigned char *)
0x1000 and # define PIOC (volatile unsigned char *) 0x1001. 0x1000 and 0x1000 are
for the fixed addresses of portA and PIOC. These are the constants defined here for these
68HC11 registers.

Strings can also be defined. Strings are the constants, for example,

EN

those used for an initial display on the screen in a mobile system.

Preprocessor Macros: A macro is a collection of codes that is defined in a program by a name. It


differs from a function in the sense that once a macro is defined by a name, the compiler puts the

Use of data types

TU
D

corresponding codes for it at every place where that macro name appears.

Whenever a data is named, it will have the address(es) allocated at the memory. The number of

TS

addresses allocated depends upon the data type. C allows the following primitive data types.
The char (8 bit) for characters, byte (8 bit), unsigned short (16 bit), short (16 bit), unsigned int
(32 bit), int (32 bit), long double (64 bit), float (32 bit) and double (64 bit). [Certain compilers do

CI

not take the byte as a data type definition. The char is then used instead of byte. Most C

compilers do not take a Boolean variable as data type. As in second line of typedef is used to
create a Boolean type variable in the C program.] A data type appropriate for the hardware is
used. For example, a 16-bit timer can have only the unsigned short data type, and its range can
be from 0 to 65535 only. The typedef is also used. It is made clear by the following example. A
compiler version may not process the declaration as an unsigned byte. The unsigned character
can then be used as a data type. It can then be declared as follows:

CITSTUDENTS.IN

Page 63

EMBEDDED SYSTEMS

10EE665

typedef unsigned character portAdata


#define Pbyte portAdata Pbyte = 0xF1

Round-Robin

Round-robin (RR) is one of the simplest scheduling algorithms for processes in an operating

TS
.IN

system. As the term is generally used, time slices are assigned to each process in equal portions
and in circular order, handling all processes without priority (also known as cyclic executive).
Round-robin

scheduling

is

simple,

easy

to

implement,

and starvation-free.

Round-robin

scheduling can also be applied to other scheduling problems, such as data packet scheduling in
computer networks.

EN

In order to schedule processes fairly, a round-robin scheduler generally employs time-sharing,


giving each job a time slot or quantum[1] (its allowance of CPU time), and interrupting the job if
it is not completed by then. The job is resumed next time a time slot is assigned to that process.

TU
D

In the absence of time-sharing, or if the quanta were large relative to the sizes of the jobs, a
process that produced large jobs would be favoured over other processes.

Example: If the time slot is 100 milliseconds, and job1 takes a total time of 250 ms to complete,

TS

the round-robin scheduler will suspend the job after 100 ms and give other jobs their time on the
CPU. Once the other jobs have had their equal share (100 ms each), job1 will get another
allocation of CPU time and the cycle will repeat. This process continues until the job finishes

CI

and needs no more time on the CPU.

Job1 = Total time to complete 250 ms (quantum 100 ms).


First allocation = 100 ms.
Second allocation = 100 ms.
Third allocation = 100 ms but job1 self-terminates after 50 ms.
Total CPU time of job1 = 250 mS

CITSTUDENTS.IN

Page 64

EMBEDDED SYSTEMS

10EE665

Another approach is to divide all processes into an equal number of timing quanta such that the
quantum size is proportional to the size of the process. Hence, all processes end at the same time.
Round-Robin with Interrupts

Interrupt routines deal with the very urgent needs of devices Interrupt routines set flags to
indicate the interrupt happened main while loop polls the status of the interrupt flags and does

RR with Interrupts Advantages

More control over priorities.

EN

device routines can be serviced in any order

TS
.IN

any follow-up processing required by a set flag.

processor interrupt priority settings can be used

Interrupt routines get good response (low latency)

TU
D

Main loop can be suspended

Interrupt routines are (must/should be) short.


Interrupt code inherently has a higher priority than task code

TS

RR with Interrupts disadvantages

More complicated than Round-Robin

CI

Context problems can occur saving and restoring context inside interrupts routines
becomes necessary when number of registers/resources is small.

Shared data problems


Debugging becomes more complicated.

Same latency/priority issues still exist.

Function queue -scheduling architecture


In this architecture, the interrupt routines add function pointers to a queue of function pointers
for the main function to call.
CITSTUDENTS.IN

What makes this architecture worthwhile is that no rule says the

Page 65

EMBEDDED SYSTEMS

10EE665

main task code has to call the functions in the order that the interrupt occurred. It can call them
based on any priority scheme of your choosing.

Any task code functions that need quicker

response can be executed earlier. All you need is some coding in the routines that queue up the
function pointers.

TS
.IN

Function Queue Schedule

Every time there is an interrupt quickly collect all appropriate data.

And state that the appropriate data-handling function needs to be executed soon.

EN

This is done put putting a function pointer into a queue.

TU
D

RTOS Architecture

The architecture of an RTOS is dependent on the complexity of its deployment. Good RTOSs are
scalable to meet different sets of requirements for different applications. For simple applications,
an RTOS usually comprises only a kernel. For more complex embedded systems, an RTOS can
be a combination of various modules, including the kernel, networking protocol stacks, and other

TS

components as illustrated in Figure

CI

General Architecture of RTOS

CITSTUDENTS.IN

Page 66

EMBEDDED SYSTEMS

10EE665

Ke rne l

An operating system generally consists of two parts: kernel space (kernel mode) and user space
(user mode). Kernel is the smallest and central component of an operating system. Its services
include managing memory and devices and also to provide an interface for software applications
to use the resources. Additional services such as managing protection of programs and

broad categories of kernel models available, namely:

Monolithic kernel

TS
.IN

multitasking may be included depending on architecture of operating system. There are three

It runs all basic system services (i.e. process and memory management, interrupt handling and
I/O communication, file system, etc) in kernel space. As such, monolithic kernels provide rich

EN

and powerful abstractions of the underlying hardware. Amount of context switches and
messaging involved are greatly reduced which makes it run faster than microkernel. Examples

TU
D

are Linux and Windows.

CI

TS

Monolithic Kernel Based Operating System`

Microkernel

It runs only basic process communication (messaging) and I/O control. The other system services
(file system, networking, etc) reside in user space in the form of daemons/servers. Thus, micro
CITSTUDENTS.IN

Page 67

EMBEDDED SYSTEMS

10EE665

kernels provide a smaller set of simple hardware abstractions. It is more stable than monolithic as
the kernel is unaffected even if the servers failed (i.e.File System). Examples are AmigaOS and
QNX.

TU
D

EN

TS
.IN

Microke rne l B as e d Ope rating Sys te m

Introduction to RTOS

TS

RTOS stands for Real time operating systems as the name suggests, there is a deadline associated
with tasks and an RTOS adheres to this deadline as missing a deadline can cause affects ranging
from undesired to catastrophic As discussed above that the embedded systems are becoming

CI

more and more complex today and with each passing generation their intrusion in our daily lives
will become deeper. This means they will bear more and more responsibilities on their shoulders
to solve real time problems to make our life easier. But, this requires more and more complex
real time applications that RTOS will have to manage effectively.

Some of the most widely used RTOS are:

LynxOS

OSE

CITSTUDENTS.IN

Page 68

EMBEDDED SYSTEMS

QNX

RTLinux

VxWorks

Windows CE

10EE665

RTOS can be classified into three types :

TS
.IN

Classification of RTOS

Hard RTOS: These type of RTOS strictly adhere to the deadline associated with the
tasks. Missing on a deadline can have catastrophic affects. The air-bag example we
deadline there could cause a life.

EN

discussed in the beginning of this article is example of a hard RTOS as missing a

Firm RTOS: These type of RTOS are also required to adhere to the deadlines because

TU
D

missing a deadline may not cause a catastrophic affect but could cause undesired affects,
like a huge reduction in quality of a product which is highly undesired.
Soft RTOS: In these type of RTOS, missing a deadline is acceptable. For example Online Databases.

TS

Features of RTOS

An RTOS must be designed in a way that it should strike a balance between supporting a rich

CI

feature set for development and deployment of real time applications and not compromising on

the deadlines and predictability.

The following points describe the features of an RTOS:

Context switching latency should be short. This means that the time taken while saving
the context of current task and then switching over to another task should be short.

CITSTUDENTS.IN

Page 69

EMBEDDED SYSTEMS

10EE665

The time taken between executing the last instruction of an interrupted task and executing
the first instruction of interrupt handler should be predictable and short. This is also
known as interrupt latency.
Similarly the time taken between executing the last instruction of the interrupt handler
and executing the next task should also be short and predictable. This is also known as
interrupting dispatch latency.

TS
.IN

Reliable and time bound inter process mechanisms should be in place for processes to
communicate with each other in a timely manner.

An RTOS should have support for multitasking and task preemption. Preemption means
to switch from a currently executing task to a high priority task ready and waiting to be
executed.

Real time Operating systems but support kernel preemption where-in a process in kernel

CI

TS

TU
D

EN

can be preempted by some other process.

CITSTUDENTS.IN

Page 70

EMBEDDED SYSTEMS

10EE665

UNIT - 7 & 8
Subsystem interfacing with external systems user interfacing, Serial I/O devices, Parallel port
interfaces:Input switches, Key boards and Memory interfacing.
Case study: Embedded velocity PID controller, PI controller with a PWM actuator.

TS
.IN

Serial I/O

Any input or output that comprises a byte, word, or longer stream that's shifted into or out of the
system a single bit at a time. Serial I/O is used mostly for data communications. It's cheaper to
run a few wires between remote devices than a parallel bus, especially since noise considerations
usually mandate level shifters on each line. But even within a computer, some serial I/O is not
unusual: the I2C bus often connects several processors on a single PCB, and serial EEPROMs

EN

are widely used to store MAC addresses and other nonvolatile data

TU
D

RS-232C

An EIA standard that defines a commonly used serial communications scheme. RS -232C is
widely used to transfer data between computers or other devices using an asynchronous serial
link at speeds ranging from 110 to 115,200 baud. The standard defines connectors, signals, signal
levels, and typical handshake.

TS

A 'space' (logic 0) ranges from +3 to +25 V; 'marks' (1s) are -3 to -25 V. Unfortunately, the
standard permits a wide range of connections and handshaking. As a result, the two RS -232C

CI

devices you're trying to connect might may not plug and play

RS-422

An EIA standard that defines a serial communications scheme designed for sending data over
long distances

in noisy environments.

RS-422 defines a serial, asynchronous, four-wire

communications link using differential signals. Two wires each are used for transmission and
reception. Polarity of the signal defines 1s and 0s: a voltage of +200 mV to +6 V is 1 ('mark'); -

CITSTUDENTS.IN

Page 71

EMBEDDED SYSTEMS

10EE665

200 mV to -6 V is a 0 ('space'). RS-422 supports data rates to 10 Mbps over cables up to 1200
meters long

Parallel port interfaces


An I/O channel that moves more than 1 bit at a time in or out of a computer. Usually
implemented (for outputs) as a latch connected to the data bus, enabled by a strobe decoded from
the address and control buses. Input parallel ports are made from a tristate buffer connected in a

TS
.IN

similar manner.

Example: A bank of LEDs connected to a computer generally interface on one or more parallel
ports.

EN

Input switches

An input device that can take any one of two or more values. Most switches are binary: either

TU
D

open or closed.

Example Dip Switch

TS

A group of switches, usually SPST, in a dual inline package. DIP switches, available in throughhole and SMT configurations, offer lots of switches in a very small and very cheap package.
They're not meant for applications requiring lots of switching; most often, they are used to set up

CI

an instrument's operating parameters.

Key boards and Memory interfacing.

When you press a key on your computer, you are activating a switch. There are many different
ways of making these switches. An overview of the construction and operation of some of the
most common types.

CITSTUDENTS.IN

Page 72

EMBEDDED SYSTEMS

10EE665

1. Mechanical key switches:

In mechanical-switch keys, two pieces of metal are pushed together when you press the key. The
actual switch elements are often made of a phosphor-bronze alloy with gold platting on the
contact areas. The key switch usually contains a spring to return the key to the nonpressed
position and perhaps a small piece of foam to help damp out bouncing.

TS
.IN

Some mechanical key switches now consist of a molded silicon dome with a small piece of
conductive rubber foam short two trace on the printed-circuit board to produce the key pressed
signal.

Mechanical switches are relatively inexpensive but they have several disadvantages.
First, they suffer from contact bounce. A pressed key may make and break contact

EN

several times before it makes solid contact.

Second, the contacts may become oxidized or dirty with age so they no longer make a

TU
D

dependable connection.

Higher-quality mechanical switches typically have a rated life time of about 1 million
keystrokes. The silicone dome type typically last 25 million keystrokes.

TS

2. Membrane key switches:

These switches are really a special type of mechanical switches. They consist of a three-layer

CI

plastic or rubber sandwich.

The top layer has a conductive line of silver ink running under each key position. The
bottom layer has a conductive line of silver ink running under each column of keys.

When you press a key, you push the top ink line through the hole to contact the bottom
ink line. The advantages of membrane keyboards is that they can be made as very thin,
sealed units.

CITSTUDENTS.IN

Page 73

EMBEDDED SYSTEMS

10EE665

They are often used on cash registers in fast food restaurants. The lifetime of membrane
keyboards varies over a wide range.

Capacitive key switches:

A capacitive key switch has two small metal plates on the printed circuit board and another metal

TS
.IN

plate on the bottom of a piece of foam.

When you press the key, the movable plate is pushed closer to fixed plate. This changes the

capacitance between the fixed plates. Sense amplifier circuitry detects this change in capacitance
and produce a logic level signal that indicates a key has been pressed. The big advantages of a
capacitive switch is that it has no mechanical contacts to become oxidized or dirty. A small

disadvantage is the specified circuitry needed to detect the change in capacitance. Capacitive key

TU
D

Hall Effect key switches:

EN

switches typically have a rated lifetime of about 20 million keystrokes.

This is another type of switch which has no mechanical contact. It takes advantage of the
deflection of a moving charge by a magnetic field.

A reference current is passed through a semiconductor crystal between two opposing

TS

faces. When a key is pressed, the crystal is moved through a magnetic field which has its

CI

flux lines perpendicular to the direction of current flow in the crystal.

Moving the crystal through the magnetic field causes a small voltage to be developed
between two of the other opposing faces of the crystal.

This voltage is amplified and used to indicate that a key has been pressed. Hall effect sensors are
also used to detect motion in many electrically controlled machines.

CITSTUDENTS.IN

Page 74

EMBEDDED SYSTEMS

10EE665

Hall effect keyboards are more expensive because of the more complex switch
mechanism, but they are very dependable and have typically rated lifetime of 100 million
or more keystrokes.

The following flow chart for a procedure to detect, debounce and produce the hex code for a
pressed key.

An easy way to detect if any key in the matrix is pressed is to output 0s to all rows and

TS
.IN

then check the column to see if a pressed key has connected a low to a column.

In the algorithm we first output lows to all the rows and check the columns over and over
until the column are all high. This is done before the previous key has been released
before looking for the next one. In the standard keyboard terminology, this is called two-

CI

TS

TU
D

EN

key lockout.

CITSTUDENTS.IN

Page 75

Das könnte Ihnen auch gefallen