MODULE 1

What is Embedded System?

An Electronic/Electro mechanical system which is designed to perform a specific function and is a combination of both hardware and firmware (Software)

E.g. Electronic Toys, Mobile Handsets, Washing Machines, Air Conditioners, Automotive Control Units, Set Top Box, DVD Player etc…

Embedded Systems are

 Unique in character and behavior

 With specialized hardware and software

Embedded Systems Vs General Computing Systems

General Purpose Computing System

Embedded System

A system which is a combination of generic hardware and General-Purpose Operating System for executing a variety of applications

A system which is a combination of special purpose hardware and embedded OS for executing a specific set of applications

Contain        a        General-Purpose        Operating

System (GPOS)

May or may not contain an operating system

for functioning

Applications are alterable (programmable) by user (It is possible for the end user to re install the Operating System, and add or remove user applications)

The firmware of the embedded system is pre- programmed and it is non-alterable by end- user

Performance is the key deciding factor on the selection of the system. Always “Faster is Better‟

Application specific requirements (like performance, power requirements, memory usage etc) are the key deciding factors

Less/not at all tailored towards reduced operating power requirements, options for different levels of power management.

Highly tailored to take advantage of the power saving modes supported by hardware and Operating System

Response requirements are not time critical

For certain category of embedded systems like mission critical systems, the response time requirement is highly critical

Need not be deterministic in execution behavior

Execution behavior is deterministic for certain type of embedded systems like “Hard Real Time‟ systems

History of Embedded Systems

 Command module (CM)

 Lunar Excursion module (LEM)

Classification of Embedded Systems

  1. Embedded Systems - Classification based on Generation

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

Second Generation: Embedded Systems built around 16-bit microprocessors and 8 or 16-bit microcontrollers, following the first-generation embedded systems. Example are, SCADA, Data Acquisition Systems etc.

Third        Generation:        Embedded        Systems        built        around        high        performance        16/32-bit Microprocessors/controllers, Application Specific Instruction set processors like Digital Signal Processors (DSPs), and Application Specific Integrated Circuits (ASICs). The instruction set is complex and powerful. Example are, Robotics, industrial process control, networking etc. Fourth Generation: Embedded Systems built around System on Chips (SoC’s), Re- configurable processors and multicore processors. It brings high performance, tight integration

and miniaturization into the embedded device market. Example are, Smart phone devices, MIDs etc.

  1. Embedded Systems - Classification based on Complexity & Performance

Small Scale: The embedded systems built around low performance and low cost 8- or 16-bit microprocessors/ microcontrollers. It is suitable for simple applications and where performance is not time critical. It may or may not contain OS.

Medium Scale: Embedded Systems built around medium performance, low cost 16- or 32-bit microprocessors / microcontrollers or DSPs. These are slightly complex in hardware and firmware. It may contain GPOS/RTOS.

Large Scale/Complex: Embedded Systems built around high performance 32- or 64-bit RISC processors/controllers, RSoC or multi-core processors and PLD. It requires complex hardware and software. These systems may contain multiple processors/controllers and co- units/hardware accelerators for offloading the processing requirements from the main processor. It contains RTOS for scheduling, prioritization and management.

  1. Embedded Systems - Classification Based on deterministic behavior

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

Soft Real time Systems: Missing a deadline may not be critical and can be tolerated to a certain degree

Hard Real time systems: Missing a program/task execution time deadline can have catastrophic consequences (financial, human loss of life, etc.)

  1. Embedded Systems - Classification Based on Triggering

These are classified into two types

Event Triggered: Activities within the system (e.g., task run-times) are dynamic and depend upon occurrence of different events.

Time triggered: Activities within the system follow a statically computed schedule (i.e., they are allocated time slots during which they can take place) and thus by nature are predictable

Major Application Areas of Embedded Systems

Purpose of Embedded Systems

Each Embedded Systems is designed to serve the purpose of any one or a combination of the following tasks.

  1. Data Collection/Storage/Representation

        Performs acquisition of data from the external world.

        The collected data can be either analog or digital

        Data collection is usually done for storage, analysis, manipulation and transmission

 The collected data may be stored directly in the system or may be transmitted to some other systems or it may be processed by the system or it may be deleted instantly after giving a meaningful representation

  1. Data Communication

 Embedded Data communication systems are deployed in applications ranging from complex satellite communication systems to simple home networking systems

 Embedded Data communication systems are dedicated for data communication

 The data communication can happen through a wired interface (like Ethernet, RS- 232C/USB/IEEE1394 etc) or wireless interface (like Wi-Fi, GSM,/GPRS, Bluetooth, ZigBee etc)

 Network hubs, Routers, switches, Modems etc are typical examples for dedicated data transmission embedded systems

  1. Data (Signal) Processing

 Embedded systems with Signal processing functionalities are employed in applications demanding signal processing like Speech coding, synthesis, audio video codec, transmission applications etc

 Computational intensive systems

 Employs Digital Signal Processors (DSPs)

  1. Monitoring

 Embedded systems coming under this category are specifically designed for monitoring purpose

 They are used for determining the state of some variables using input sensors

 They cannot impose control over variables.

 Electro Cardiogram (ECG) machine for monitoring the heart beat of a patient is a typical example for this

 The sensors used in ECG are the different Electrodes connected to the patient’s body

 Measuring instruments like Digital CRO, Digital Multi meter, Logic Analyzer etc used in Control & Instrumentation applications are also examples of embedded systems for monitoring purpose

  1. Control

 Embedded systems with control functionalities are used for imposing control over some variables according to the changes in input variables

 Embedded system with control functionality contains both sensors and actuators

 Sensors are connected to the input port for capturing the changes in environmental variable or measuring variable

 The actuators connected to the output port are controlled according to the changes in input variable to put an impact on the controlling variable to bring the controlled variable to the specified range

 Air conditioner for controlling room temperature is a typical example for embedded system with Control functionality

 Air conditioner contains a room temperature sensing element (sensor) which may be a thermistor and a handheld unit for setting up (feeding) the desired temperature

 The air compressor unit acts as the actuator. The compressor is controlled according to the current room temperature and the desired temperature set by the end user.

  1. Application Specific User Interface

 Embedded systems which are designed for a specific application

 Contains Application Specific User interface (rather than general standard UI) like key board, Display units etc

 Aimed at a specific target group of users

 Mobile handsets, Control units in industrial applications etc are examples

The Core of the Embedded Systems

The core of the embedded system falls into any one of the following categories.

 Microprocessors

 Microcontrollers

 Digital Signal Processors

General Purpose and Domain Specific Processor

Microprocessor

Intel – Intel 4004 – November 1971(4-bit) Intel – Intel 4040.

Intel – Intel 8008 – April 1972.

Intel – Intel 8080 – April 1974(8-bit). Motorola – Motorola 6800.

Intel – Intel 8085 – 1976. Zilog - Z80 – July 1976

Microcontroller:

Microprocessor Vs Microcontroller

Microprocessor

Microcontroller

A silicon chip representing a Central Processing Unit (CPU), which is capable of performing arithmetic as well as logical operations according to a pre-defined set of Instructions

A microcontroller is a highly integrated chip that contains a CPU, scratch pad RAM, Special and General-purpose Register Arrays, On Chip ROM/FLASH memory for

program storage, Timer and Interrupt control units and dedicated I/O ports

It is a dependent unit. It requires the combination of other chips like Timers,

Program and data memory chips, Interrupt controllers etc. for functioning

It is a self-contained unit and it doesn’t require external Interrupt Controller, Timer, UART etc. for its functioning

Most of the time general purpose in design and

operation

Mostly        application        oriented        or        domain specific

Doesn’t contains a built in I/O port. The I/O Port functionality needs to be implemented with the help of external Programmable Peripheral Interface Chips like 8255

Most of the processors contain multiple built-in I/O ports which can be operated as a single 8 or 16- or 32-bit Port or as individual port pins

Targeted        for        high        end        market        where performance is important

Targeted        for        embedded        market        where

performance is not so critical (At present this demarcation is invalid)

Limited power saving options compared to

microcontrollers

Includes lot of power saving features

General Purpose Processor (GPP) Vs Application Specific Instruction Set Processor (ASIP)

Digital Signal Processors (DSPs)

 Program Memory: It is a memory for storing the program required by DSP to process the data.

 Data Memory: It is a working memory for storing temporary variables and data/signal to be processed.

 Computational Engine: It performs the signal processing in accordance with the stored program memory computational engine incorporated many specialized arithmetic units and each of them operates simultaneously to increase the execution speed. It also includes multiple hardware shifters for shifting operands and saves execution time.

 I/O Unit: It acts as an interface between the outside world and DSP. It is responsible for capturing signals

RISC V/s CISC Processors/Controllers

RISC

CISC

Lesser no. of instructions

Greater no. of Instructions

Instruction        Pipelining        and        increased

execution speed

Generally, no instruction pipelining feature

Orthogonal Instruction Set (Allows each instruction to operate on any register and use any addressing mode)

Non-Orthogonal Instruction Set (All instructions are not allowed to operate on any register and use any addressing mode. It is

instruction specific)

Operations are performed on registers only; the only memory operations are load and

store

Operations are performed on registers or memory depending on the instruction

Large number of registers are available

Limited no. of general-purpose registers

Programmer needs to write more code to execute a task since the instructions are simpler ones

A programmer can achieve the desired functionality with a single instruction which in turn provides the effect of using more

simpler single instructions in RISC

Single, Fixed length Instructions

Variable length Instructions

Less Silicon usage and pin count

More silicon usage since more additional

decoder logic is required to implement the complex instruction decoding.

With Harvard Architecture

Can        be        Harvard        or        Von-Neumann

Architecture

Harvard V/s Von-Neumann Processor/Controller Architecture

Harvard Architecture

Von-Neumann Architecture

Separate buses for Instruction and Data

fetching

Single shared bus for Instruction and Data

fetching

Easier to Pipeline, so high performance can

be achieved

Low performance Compared to Harvard

Architecture

Comparatively high cost

Cheaper

No memory alignment problems

Allows self modifying codes

Since data memory and program memory are stored physically in different locations, no chances for accidental corruption of program

memory

Since data memory and program memory are stored physically in same chip, chances for accidental corruption of program

memory

Big-endian V/s Little-endian processors:

 Higher order of data byte at the higher memory and lower order of data byte at location just below the higher memory

 Lower order of data byte at the higher memory and higher order of data byte at location just below the higher memory

Load Store Operation & Instruction Pipelining

The RISC processor instruction set is orthogonal and it operates on registers. The memory access related operations are performed by the special instructions load and store. If the operand is specified as memory location, the content of it is loaded to a register using the load instruction. The instruction store stores data from a specified register to a specified memory location

Application Specific Integrated Circuit (ASIC)

Programmable Logic Devices (PLDs):

- once manufactured, they cannot be changed

Programmable Logic Devices (PLDs) – CPLDs and FPGA

Field Programmable Gate Arrays (FPGAs) and Complex Programmable Logic Devices (CPLDs) are the two major types of programmable logic devices

FPGA:

CPLD:

Advantages of PLDs:

Commercial off the Shelf Component (COTS)

Memory:

Memory – Program Storage Memory:

Masked ROM (MROM)

 Creation of an enhancement or depletion mode transistor through channel implant

 By creating the memory cell either using a standard transistor or a high threshold transistor.

 In the high threshold mode, the supply voltage required to turn ON the transistor is above the normal ROM IC operating voltage.

 This ensures that the transistor is always off and the memory cell stores always logic 0.

Programmable Read Only Memory (PROM) / (OTP)

Erasable Programmable Read Only Memory (EPROM):

Electrically Erasable Programmable Read Only Memory (EEPROM):

Program Storage Memory – FLASH

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

  1. Static RAM (SRAM):

  1. Dynamic RAM (DRAM)

  1. Non-Volatile RAM (NVRAM)

SRAM Cell

DRAM Cell

Made up of 6 CMOS transistors (MOSFET)

Made up of a MOSFET and a capacitor

Doesn’t Require refreshing

Requires refreshing

Low capacity (Less dense)

High Capacity (Highly dense)

More expensive

Less Expensive

Fast in operation. Typical access time is 10ns

Slow in operation due to refresh

requirements. Typical access time is 60ns. Write operation is faster than read operation.

Sensors & Actuators

Sensor

Actuator

The I/O Subsystem

I/O Devices - Light Emitting Diode (LED):


GND

I/O Devices – 7-Segment LED Display

I/O Devices – Stepper Motor:

 Unipolar

 Bipolar

The I/O Subsystem – I/O Devices – Push button switch:

4.13.        Keyboard

I/O Devices – Optocoupler

I/O Devices – Relay

Communication Interface

  1. Device/board level communication interface (Onboard Communication Interface)
  2. Product level communication interface (External Communication Interface)

  1. Device/board level communication interface (Onboard Communication Interface)

  1. Product level communication interface (External Communication Interface)

  1. Device/board level or on-board communication interfaces

 I2C (Inter Integrated Circuit) Bus

 SPI (Serial Peripheral Interface) Bus

 UART (Universal Asynchronous Receiver Transmitter)

 1-Wires Interface

 Parallel Interface

I2C (Inter Integrated Circuit) Bus

Inter Integrated Circuit Bus (I2C - Pronounced “I square C‟) is a synchronous bi-directional half duplex (one-directional communication at a given point of time) two wire serial interface bus. The concept of I2C bus was developed by “Philips Semiconductors‟ in the early 1980’s. The original intention of I2C was to provide an easy way of connection between a microprocessor/microcontroller system and the peripheral chips in Television sets.

The I2C bus is comprised of two bus lines, namely; Serial Clock – SCL and Serial Data – SDA.

I2C Bus

Figure: I2C Bus Interfacing

SCL line is responsible for generating synchronization clock pulses and SDA is responsible for transmitting the serial data across devices. I2C bus is a shared bus system to which many number of I2C devices can be connected. Devices connected to the I2C bus can act as either “Master‟ device or “Slave‟ device.

The “Master‟ device is responsible for controlling the communication by initiating/terminating data transfer, sending data and generating necessary synchronization clock pulses.

Slave devices wait for the commands from the master and respond upon receiving the commands. Master and “Slave‟ devices can act as either transmitter or receiver. Regardless whether a master is acting as transmitter or receiver, the synchronization clock signal is generated by the “Master‟ device only. I2C supports multi masters on the same bus.

The sequence of operation for communicating with an I2C slave device is

  1. Master device pulls the clock line (SCL) of the bus to “HIGH‟
  2. Master device pulls the data line (SDA) “LOW‟, when the SCL line is at logic “HIGH‟ (This is the “Start‟ condition for data transfer)
  3. Master sends the address (7 bit or 10 bit wide) of the “Slave‟ device to which it wants to communicate, over the SDA line.
  4. Clock pulses are generated at the SCL line for synchronizing the bit reception by the slave device.
  5. The MSB of the data is always transmitted first.
  6. The data in the bus is valid during the “HIGH‟ period of the clock signal
  7. In normal data transfer, the data line only changes state when the clock is low.
  8. Master waits for the acknowledgement bit from the slave device whose address is sent on the bus along with the Read/Write operation command.
  9. Slave devices connected to the bus compares the address received with the address assigned to them
  10. The Slave device with the address requested by the master device responds by sending an acknowledge bit (Bit value =1) over the SDA line
  11. Upon receiving the acknowledge bit, master sends the 8bit data to the slave device over SDA line, if the requested operation is “Write to device‟.
  12. If the requested operation is “Read from device‟, the slave device sends data to the master over the SDA line.
  13. Master waits for the acknowledgement bit from the device upon byte transfer complete for a write operation and sends an acknowledge bit to the slave device for a read operation
  14. Master terminates the transfer by pulling the SDA line “HIGH‟ when the clock line SCL is at logic “HIGH‟ (Indicating the “STOP‟ condition).

Serial Peripheral Interface (SPI) Bus

Figure: SPI bus Interfacing

SPI requires four signal lines for communication. They are:

Master Out Slave In (MOSI): Signal line carrying the data from master to slave device. It is also known as Slave Input/Slave Data In (SI/SDI)

Master In Slave Out (MISO): Signal line carrying the data from slave to master device. It is also known as Slave Output (SO/SDO)

Serial Clock (SCLK): Signal line carrying the clock signals

Slave Select (SS): Signal line for slave device select. It is an active low signal. The master device is responsible for generating the clock signal.

Master device selects the required slave device by asserting the corresponding slave devices slave select signal “LOW‟.

I2C V/S SPI:

Universal Asynchronous Receiver Transmitter (UART)

different semiconductor manufacturers. National Semiconductor’s 8250 UART chip is considered as the standard setting UART. It was used in the original IBM PC.

1-wire interface (protocol)

  1. The master device sends a ‘Reset’ pulse on the l-wire bus.
  2. The slave device(s) present on the bus respond with a ‘Presence’ pulse.
  3. The master device sends a ROM command (Net Address Command followed by the 64bit address of the device). This addresses the slave device(s) to which it wants to initiate a communication.
  4. The master device sends a read/write function command to read/write the internal memory or register of the slave device.
  5. The master initiates a Read data/Write data from the device or to the device

Parallel interface

  1. Product level communication interface (External Communication Interface)

The Product level communication interface (External Communication Interface) is responsible for data transfer between the embedded system and other devices or modules

It is classified into two types

 Wired communication interface

 Wireless communication interface:

  1. Wired communication interface

Wired communication interface is an interface used to transfer information over a wired network. It is classified into following types.

 RS-232C/RS-422/RS 485

 USB

RS-232C:

11.52Kbps and 19.2Kbps.

USB (UNIVERSAL SERIAL BUS):

IEEE 1394 (Fire wire):

(The Apple implementation is for battery operated devices and it can supply a voltage in the range 9 to 12V.)

Pin Name

Pin No:

(4        Pin

Connector)

Pin No:

(6        Pin

Connector)

Pin No:

(9        Pin

Connector)

Description

Power

1

8

Unregulated DC supply. 24 to 30V

Signal

Ground

2

6

Ground connection

TPB-

1

3

1

Differential Signal line for Signal Line B

TPB+

2

4

2

Differential Signal line for Signal Line B

TPA-

3

5

3

Differential Signal line for Signal Line A

TPA+

4

6

4

Differential Signal line for Signal Line A

TPA(S)

5

Shield for the differential signal line A. Normally

grounded

TPB(S)

9

Shield for the differential signal line B. Normally

grounded

NC

7

No connection

  1. Wireless communication interface

Wireless communication interface is an interface used to transmission of information over a distance without help of wires, cables or any other forms of electrical conductors.

They are basically classified into following types

  1. Infrared
  2. Bluetooth
  3. Wi-Fi
  4. Zigbee
  5. GPRS

INFRARED:

Most of the thermal radiation emitted by objects near room temperature is infrared. Infrared radiation is used in industrial, scientific, and medical applications. Night-vision devices using active near-infrared illumination allow people or animals to be observed without the observer being detected.

IR transmission:

The transmitter of an IR LED inside its circuit, which emits infrared light for every electric pulse given to it. This pulse is generated as a button on the remote is pressed, thus completing the circuit, providing bias to the LED.

The LED on being biased emits light of the wavelength of 940nm as a series of pulses, corresponding to the button pressed. However, since along with the IR LED many other sources of infrared light such as us human beings, light bulbs, sun, etc, the transmitted information can be interfered. A solution to this problem is by modulation. The transmitted signal is modulated using a carrier frequency of 38 KHz (or any other frequency between 36 to 46 KHz). The IR LED is made to oscillate at this frequency for the time duration of the pulse. The information or the light signals are pulse width modulated and are contained in the 38 KHz frequency.

IR supports data rates ranging from 9600bits/second to 16Mbps Serial infrared: 9600bps to 115.2 kbps

Medium infrared: 0.576Mbps to 1.152 Mbps Fast infrared: 4Mbps

Bluetooth:

Wi-Fi:

ZIGBEE:

General Packet Radio Service (GPRS)

Services offered:

Embedded Firmware

The control algorithm (Program instructions) and or the configuration settings that an embedded system developer dumps into the code (Program) memory of the embedded system The embedded firmware can be developed in various methods like

  1. Write the program in high level languages like Embedded C/C++ using an Integrated Development Environment (The IDE will contain an editor, compiler, linker, debugger, simulator ) etc. IDEs (Keil) are different for different family of processors/controllers.
  2. Write the program in Assembly Language using the Instructions Supported by your application’s target processor/controller

Other System Components –

  1. Reset Circuit

  1. Brown-out Protection Circuit

D

  1. Oscillator Unit

  1. Real Time Clock (RTC)

  1. Watch Dog Timer