Nothing Special   »   [go: up one dir, main page]

Unit 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

K S R INSTITUTE FOR ENGINEERING AND TECHNOLOGY

An Autonomous Institution
(Approved by AICTE, New Delhi, Affiliated to Anna University & Accredited by NAAC (A+))
K.S.R. Kalvi Nagar, Tiruchengode – 637 215,
Namakkal District, Tamil Nadu

DEPARTMENT OF BIOMEDICAL ENGINEERING

STUDY MATERIAL

BM3551 EMBEDDED SYSTEMS AND IoMT

REGULATION–2021

For III-year VSemester B.E–BME Students


BM3551 EMBEDDED SYSTEMS AND IoMT LTPC 3 003

COURSE OBJECTIVES:

The objective of this course is to enable the student to


• Acquire knowledge and understand fundamental embedded systems design paradigms,
architectures, possibilities, and challenges, both with respect to software and hardware.
• Understand the hardware architecture and features of embedded microcontrollers and peripherals.
• Understand programming aspects of embedded system design.
• Understand IoT architecture and Build simple IoT Systems using embedded target boards.
• Understand IoMT infrastructure for healthcare applications.

UNIT I INTRODUCTION TO EMBEDDED SYSTEM DESIGN 9


Introduction to embedded processors- Application Areas- Categories of embedded processors-
Challenges in Embedded System Design, Design Process- Requirements- Specifications
Hardware architecture- Software architecture-Introduction to Harvard & Von Neuman architectures-CISC
& RISC Architectures. CPU Bus- Bus Protocols- Bus Organisation, Memory Devices, andtheir
Characteristics- RAM, EEPROM-Flash Memory- DRAM. BIOS, POST, Device Drivers

UNIT II PERIPHERAL INTERFACING 9


I/O Devices-Timers and Counters- Watchdog Timers, Interrupt Controllers- A/D and D/A,
Interfacing- Memory interfacing with a case study- I/O Device Interfacing with case Study-
Programmed IO-Memory Mapped IO, Interfacing Protocols-SPI, I 2C, USB, CAN,
Ethernet/WiFi,Bluetooth

UNIT III EMBEDDED SYSTEM SOFTWARE DESIGN 9


Application Software, System Software, Design techniques – State diagrams, sequence
diagrams,flowcharts, etc., Model-based system engineering (MBSE), Use of High-Level Languages-
embedded C / C++ Programming, Integrated Development Environment tools- Editor- Compiler-Linker-
Automatic Code Generators- Debugger- Board Support Library- Chip Support Library,Analysis and
Optimization-Execution Time- Energy & Power.

UNIT IV DESIGN AND DEVELOPMENT OF IOT 9


Definition and characteristics of IoT, Technical Building blocks of IoT, Communication
Technologies, Physical design of IoT - system building blocks - sensors and sensor Node and
interfacing using any Embedded target boards (Raspberry Pi / Intel Galileo/ARM Cortex/
Arduino),Benefits and impact of IoMT. Cybersecurity – vulnerability, penetration & encryption
technologies

UNIT V INTERNET OF MEDICAL THINGS 9


Case studies – Novel Symmetrical Uncertainty Measure (NSUM) Technique for Diabetes
Patients,Healthcare Monitoring system through Cyber-physical system, An loT Model for Neuro
sensors,AdaBoost with feature selection using loT for somatic mutations evaluation in Cancer, A
FuzzyBased expert System to diagnose Alzheimer’s Disease, Secured architecture for loT enabled
Personalized Healthcare Systems, Healthcare Application Development in Mobile and Cloud
Environments.

TOTAL: 45 PERIODS
COURSE OUTCOME:

At the end of this course, the student should be able to

CO1: Explain fundamental embedded systems design paradigms, architectures, possibilities, and
challenges, both with respect to software and hardware.
CO2: Describe the hardware architecture and features of embedded microcontrollers and
peripherals.
CO3: Explain software design tools and embedded system design programming phases.
CO4: Describe IoT Architectures and Build simple IoT Systems using embedded target boards.
CO5: Exhibit understanding of IoMT infrastructure for healthcare applications.

TEXT BOOKS

1. Embedded Systems – A Contemporary Design Tool, James K Peckol, , John Weily, 2008,
ISBN: 0- 444-51616-6.
2. David Hanes, Gonzalo Salgueiro, Patrick Grossetete, Rob Barton and Jerome Henry, “loT
Fundamentals: Networking Technologies, Protocols and Use Cases for lnternet of Things,
Cisco Press, 2017.
3. Venkata Krishna, Sasikumar Gurumoorthy, Mohammad S. Obaidat, “lnternet of Things and
Personalized Healthcare Systems”, Springer Briefs in Applied Sciences, and Technology,
Forensic and Medical Bioinformatics, 2019.

REFERENCE BOOKS

1. Introduction to Embedded Systems, Shibu K V, Tata McGraw Hill Education Private


Limited, 2009, ISBN: 10: 0070678790 3.
2. Embedded Software Primer, David E.Simon, ,Addison Wesley, ISBN-13: 978-0201615692
3. The Intel Microprocessors, Architecture, Programming and Interfacing” Barry B.Brey, 6th
Edition, Pearson Education.
4. Arshdeep Bahga, Vijay Madisetti, “lnternet of Things – A hands-on approach”, Universities
Press, 2015
5. Olivier Hersent, David Boswarthick, Omar Elloumi , “The Internet of Things – Key
applications and Protocols”, Wiley, 2012.
6. Jan Holler, Vlasios Tsiatsis, Catherine Mulligan, Stamatis, Karnouskos, Stefan Avesand.
David Boyle, “From Machine-to-Machine to the Internet of Things – Introduction to a NewAge
of Intelligence”, Elsevier, 2014.
7. Dieter Uckelmann, Mark Harrison, Michahelles, Florian (Eds), “Architecting the Internet of
Things”, Springer, 2011.
8. Michael Margolis, Arduino Cookbook, “Recipes to Begin, Expand, and Enhance Your
Projects”, OReilly Media, 2nd Edition.
UNIT I

INTRODUCTION TO EMBEDDED SYSTEM DESIGN

1. Introduction to embedded processors

Embeddedsystem

An embedded system is one kind of a computer system mainly designed toperformseveral tasks
like to access, process, store and also control the data in various electronics- basedsystems.
Embedded systems are a combination of hardware and software where software isusually known
as firmware that is embedded into the hardware. One of its most importantcharacteristics of
these systems is, it gives the o/p within the time limits. Embedded systemssupporttomake the
workmore perfectandconvenient.So,we frequently use embeddedsystems in simple and complex
devices too. The applications of embedded systems mainlyinvolve in our real lifefor several
devices likemicrowave,calculators,TV remote control,homesecurityand neighborhood
trafficcontrol systems

Fig:BlockDiagramofEmbeddedsystem
The embedded system basics are the combination of embedded system hardware and
embeddedsystemsoftware.
An embedded processor is a microprocessor specifically designed to be integrated into a larger
system for performing dedicated tasks. Unlike general-purpose processors (such as those found
in personal computers), embedded processors are optimized for efficiency, real-time
performance, and low power consumption. They are the heart of numerous devices and systems
that we encounter in our daily lives, from smartphones and smart appliances to automotive
systems and industrial machines.

Key aspects to understand about embedded processors:

1. Purpose and Application: Embedded processors are designed for a specific function or set
of functions. They are found in a wide range of applications, including consumer
electronics (like washing machines, digital cameras), industrial automation (robotics,
manufacturing equipment), automotive systems (engine control, infotainment), medical
devices (implantable devices, diagnostic equipment), and more.
2. Real-time Constraints: Many embedded systems require real-time processing, meaning
they must respond to inputs and produce outputs within strict timing constraints. For
instance, an anti-lock braking system in a car must respond instantly to prevent skidding.
3. Low Power Consumption: Embedded systems often have limited power resources, so
energy efficiency is a crucial consideration. Processors used in such systems are designed
to perform tasks using minimal power, which is vital for extending the device's battery
life.
4. Integration: Embedded processors are typically integrated into a larger system on a chip
(SoC). An SoC incorporates not only the processor core but also memory, peripheral
interfaces, and sometimes specialized hardware accelerators, all on a single chip.
5. Variety of Architectures: Embedded processors come in various architectures, including
ARM, x86, MIPS, PowerPC, and more. The choice of architecture depends on factors
such as performance requirements, power constraints, and the ecosystem surrounding the
processor.
6. Customization: In some cases, designers create custom processors tailored to specific
tasks. These processors might have features and instructions optimized for a particular
application, allowing for better performance and efficiency.
7. Development Tools: Software development for embedded processors involves tools and
environments designed to work within the constraints of the target hardware. This might
include specialized compilers, debugging tools, and integrated development
environments (IDEs).
8. RTOS and Firmware: Embedded systems often run on Real-Time Operating Systems
(RTOS) or specialized firmware. RTOS manages tasks with different priorities and
timing requirements, ensuring that critical tasks are executed on time.
9. Security Considerations: As more embedded systems connect to the internet, security
becomes a crucial concern. Designing processors with hardware security features helps
protect against unauthorized access, data breaches, and other cyber threats.
10. Updates and Maintenance: Some embedded systems can receive software updates, while
others might remain unchanged throughout their lifetimes due to hardware constraints.
This affects how security vulnerabilities and software bugs are addressed.

2.Application Areas

Embedded processors are widely used in various application areas due to their compact size, low
power consumption, and ability to perform specific tasks efficiently. Some common application
areas for embedded processors include:

1. Consumer Electronics: Embedded processors are used in numerous consumer electronic


devices such as smartphones, tablets, smart TVs, digital cameras, gaming consoles, and
wearable devices. These processors enable the functionality and performance of these
devices, handling tasks like data processing, multimedia playback, and user interface
interactions.
2. Automotive Systems: Embedded processors are essential components in modern vehicles,
powering various systems such as engine control units (ECUs), infotainment systems,
advanced driver-assistance systems (ADAS), telematics, and in-car networking. They
enable functionalities like engine control, navigation, entertainment, communication, and
safety features.
3. Industrial Automation: Embedded processors play a vital role in industrial automation
and control systems. They are used in programmable logic controllers (PLCs), distributed
control systems (DCS), robotics, and monitoring systems. These processors provide real-
time control and data processing capabilities, facilitating efficient and precise control of
industrial processes.
4. Internet of Things (IoT): Embedded processors form the backbone of IoT devices by
enabling connectivity, data processing, and control. They are used in smart home devices,
environmental monitoring systems, wearable health trackers, industrial sensors, and other
IoT applications. These processors enable data collection, communication, and analysis
for IoT devices.
5. Medical Devices: Embedded processors are found in a wide range of medical devices,
including patient monitoring systems, imaging equipment, diagnostic devices, infusion
pumps, and implantable devices. These processors provide real-time processing, control,
and communication capabilities, contributing to accurate diagnostics, treatment, and
patient care.
6. Aerospace and Defense: Embedded processors are extensively used in aerospace and
defense applications, such as avionics systems, military equipment, radar systems,
unmanned aerial vehicles (UAVs), and satellite communication systems. They provide
high-performance computing, data processing, and control for critical operations.
7. Home Automation: Embedded processors are used in home automation systems to
control and manage various devices such as smart thermostats, lighting systems, security
systems, and appliances. They enable connectivity, data processing, and automation,
allowing users to remotely monitor and control their homes.
8. Communication Systems: Embedded processors are utilized in communication
infrastructure equipment, including routers, switches, modems, and base stations. These
processors handle data routing, network management, signal processing, and protocol
handling, ensuring smooth and reliable communication.

3. Categories of Embedded Processors

Embedded processors can be broadly categorized into the following types based on their
architecture and design:
1. Microcontrollers (MCUs): Microcontrollers are integrated circuits that combine a
microprocessor core with memory, peripherals, and input/output (I/O) interfaces on a
single chip. They are designed for embedded systems and typically have low power
consumption. MCUs are commonly used in applications that require real-time control,
such as industrial automation, consumer electronics, automotive systems, and home
appliances.
2. Digital Signal Processors (DSPs): DSPs are specialized processors designed to
efficiently handle digital signal processing tasks. They excel in applications that require
high-speed mathematical calculations, such as audio and video processing,
telecommunications, image recognition, and medical imaging. DSPs are optimized for
numeric computations and often incorporate features like multiply-accumulate (MAC)
units and parallel processing capabilities.
3. Field-Programmable Gate Arrays (FPGAs): FPGAs are programmable logic devices that
consist of an array of configurable logic blocks interconnected by programmable routing
channels. They can be reprogrammed or reconfigured to implement digital logic
functions and perform specific tasks. FPGAs are used in applications that require high-
speed parallel processing, such as image and video processing, networking,
cryptography, and prototyping of digital systems.
4. System-on-Chip (SoC): SoCs integrate multiple components, including one or more
processors (such as CPUs or DSPs), memory, I/O interfaces, peripherals, and often
specialized hardware accelerators, onto a single chip. SoCs provide a complete system
solution within a single package and are commonly used in complex applications such as
smartphones, tablets, automotive systems, and IoT devices.
5. Graphics Processing Units (GPUs): GPUs are specialized processors designed to handle
graphics rendering and parallel processing tasks. While primarily used for rendering
graphics in applications like gaming and computer graphics, GPUs have found
application in fields such as scientific computing, artificial intelligence, and machine
learning due to their parallel computing capabilities.
6. Application-Specific Integrated Circuits (ASICs): ASICs are custom-designed integrated
circuits tailored for specific applications. They are optimized for performance, power
efficiency, and often have specialized hardware blocks. ASICs are commonly used in
areas such as telecommunications, automotive electronics, aerospace, and high-
performance computing, where specific requirements demand highly optimized
solutions.

4. Challenges in embedded system design

1. Real-Time Constraints: Many embedded systems require real-time operation, where tasks
must be completed within specific timing constraints. Designing and implementing real-
time systems involve ensuring that tasks are scheduled and executed on time, managing
task priorities, and handling resource sharing and synchronization.
2. Limited Resources: Embedded systems often have limited resources in terms of
processing power, memory, storage, and energy. Designers need to optimize resource
usage, employ efficient algorithms and data structures, and carefully manage power
consumption to meet the system's requirements within the available constraints.
3. Heterogeneous Hardware and Software: Embedded systems often involve a combination
of hardware and software components from different vendors or with varying
architectures. Integrating and interfacing these components can be challenging, requiring
careful coordination and compatibility considerations.
4. Reliability and Fault Tolerance: Many embedded systems operate in critical
environments or perform safety-critical tasks. Ensuring system reliability and fault
tolerance is crucial. Designers must incorporate fault detection, error handling, and fault
recovery mechanisms to minimize the impact of failures and ensure system resilience.
5. Security Concerns: As embedded systems become more interconnected and part of larger
networks (e.g., IoT devices), they face increasing security risks. Designers need to
address security vulnerabilities, protect against unauthorized access, and ensure data
integrity and privacy within the system.
6. Software Complexity: Embedded systems are becoming more sophisticated, requiring
complex software development and integration. Managing the complexity of the
software, including handling interactions between different software modules, ensuring
code quality, and enabling efficient debugging and maintenance, poses significant
challenges.
7. Verification and Validation: Verifying and validating the correctness and performance of
embedded systems can be complex. Testing and debugging embedded software and
hardware components, performing system integration testing, and ensuring compliance
with the system requirements require careful planning and execution.
8. Time-to-Market Pressure: Embedded systems are often developed within tight schedules
to meet market demands. Balancing time-to-market pressures with the need for thorough
design, testing, and validation can be a significant challenge for embedded system
designers.

5.EMBEDDED SYSTEM DESIGN PROCESS

This section provides an overview of the embedded system design process aimed at two
objectives. First, it will give us an introduction to the various steps in embedded system design
before we delve into them in more detail. Second, it will allow us to consider the design
methodology itself. A design methodology is important for three reasons. First, it allows us to
keep a scorecard on a design to ensure that we have done everything we need to do, such as
optimizing performance or performing functional tests. Second, it allows us to develop
computer-aided design tools. Developing a single program that takes in a concept for an
embedded system and emits a completed design would be a daunting task, but by first breaking
the process into manageable steps, we can work on automating (or at least semi automating) the
steps one at a time. Third, a design methodology makes it much easier for members of a design
team to communicate.
The below Figure summarizes the major steps in the embedded system design process. In this
top–down view, we start with the system requirements.
Fig:Major levels of abstraction in the design process

Requirements

Clearly, before we design a system, we must know what we are designing. The initial stages of
the design process capture this information for use in creating the architecture and components.
We generally proceed in two phases: First, we gather an informal description from the customers
known as requirements, and we refine the requirements into a specification that contains enough
information to begin designing the system architecture.
Requirements may be functional or nonfunctional. We must of course capture the basic functions
of the embedded system, but functional description is often not sufficient. Typical nonfunctional
requirements include:

Performance: The speed of the system is often a major consideration both for the usability of the
system and for its ultimate cost. As we have noted, performance may be a combination of soft
performance metrics such as approximate time to perform a user-level function and hard
deadlines by which a particular operation must be completed.

Cost: The target cost or purchase price for the system is almost always a consideration. Cost
typically has two major components: manufacturing cost includes the cost of components and
assembly; nonrecurring engineering (NRE) costs include the personnel and other costs of
designing the system.

Physical size and weight: The physical aspects of the final system can vary greatly depending
upon the application. An industrial control system for an assembly line may be designed to fit
into a standard-size rack with no strict limitations on weight. A handheld device typically has
tight requirements on both size and weight that can ripple through the entire system design.

Power consumption: Power, of course, is important in battery-powered systems and is often


important in other applications as well. Power can be specified in the requirements stage in terms
of battery life—the customer is unlikely to be able to describe the allowable wattage.

A sample requirements form that can be filled out at the start of the project. We can use the form
as a checklist in considering the basic characteristics of the system. Let’s consider the entries in
the form:

Name: This is simple but helpful. Giving a name to the project not only simplifies talking about
it to other people but can also crystallize the purpose of the machine.

Purpose: This should be a brief one- or two-line description of what the system is supposed to
do. If you can’t describe the essence of your system in one or two lines, chances are that you
don’t understand it well enough.

Inputs and outputs: These two entries are more complex than they seem. The inputs and outputs
to the system encompass a wealth of detail:
Types of data: Analog electronic signals,Digital data, Mechanical inputs

Types of I/O devices: Buttons,Analog/digital converters,Video displays

Performance: Many embedded computing systems spend at least some time controlling physical
devices or processing data coming from the physical world. In most of these cases, the
computations must be performed within a certain time frame. It is essential that the performance
requirements be identified early

Manufacturing cost: This includes primarily the cost of the hardware components. Even if you
don’t know exactly how much you can afford to spend on system components, you should have
some idea of the eventual cost range. Cost has a substantial influence on architecture: A machine
that is meant to

Power: Similarly, you may have only a rough idea of how much power the system can consume,
but a little information can go a long way. Typically, the most important decision is

whetherthemachinewillbebatterypoweredorpluggedintothewall.Battery-
poweredmachinesmustbemuchmorecareful abouthow theyspendenergy.

Physicalsizeandweight:Youshouldgivesomeindicationofthephysicalsizeofthesystemto help guide


certain architectural decisions. A desktop machine has much more flexibility in
thecomponentsused than, for example, alapelmounted voicerecorder.

GPSMODULE:

REQUIREMENTSFORMOFGPSMOVINGMAPMODULE:
Name:GPSmovingmap
Purpose: Consumer-
grade moving map for
driving
useInputs:Powerbutton,t
wocontrolbuttons
Outputs: Back-litLCDdisplay 400_ 600
Functions : Uses 5-receiver GPS system; three
user-selectable resolutions;alwaysdisplays
currentlatitudeandlongitude
Performance: Updates screen within
0.25 seconds upon
movementManufacturingcost:$30
Power:100mW
Physicalsizeandweight:Nomorethan2” _ 6,” 12ounces

Specification

Thespecificationismoreprecise—itservesasthecontractbetweenthecustomerandthearchitects. As
such, the specification must be carefully written so that it accurately reflects
thecustomer’srequirementsand doessoin awaythat can
beclearlyfollowedduringdesign.Thespecificationshouldbeunderstandableenoughso
thatsomeonecanverifythatitmeetssystemrequirements andoverall expectationsof thecustomer.
AspecificationoftheGPSsystemwouldincludeseveralcomponents:
 Datareceived fromtheGPSsatelliteconstellation.
 Mapdata.
 Userinterface.
 Operationsthatmustbeperformedtosatisfycustomerrequests.
 Backgroundactionsrequiredtokeepthesystemrunning,s
uchasoperatingtheGPSreceiver.

Architecture Design and Components

The specification does not say how the system does things, only what the system does.
Describing how the system implements those functions is the purpose of the architecture. The
architecture is a plan for the overall structure of the system that will be used later to design the
components that make up the architecture. The creation of the architecture is the first phase of
what many designers think of as design.

This block diagram is still quite abstract—we have not yet specified which operations will be
performed by software running on a CPU, what will be done by special-purpose hardware, and
so on. The diagram does, however, go a long way toward describing how to implement the
functions described in the specification. We clearly see, for example, that we need to search the
topographic database and to render (i.e., draw) the results for the display. We have chosen to
separate those functions so that we can potentially do them in parallel—performing rendering
separately from searching the database may help us update the screen more fluidly.
Fig: Block Diagram forthe Moving Map

The hardware block diagram clearly shows that we have one central CPU surrounded by memory
and I/O devices. In particular, we have chosen to use two memories: a frame buffer for the pixels
to be displayed and a separate program/data memory for general use by the CPU. The software
block diagram fairly closely follows the system block diagram, but we have added a timer to
control when we read the buttons on the user interface and render data onto the screen. To have a
truly complete architectural description, we require more detail, such as where units in the
software block diagram will be executed in the hardware block diagram and when operations
will be performed in time.

Fig : Hardware and software architectures for the moving map.

The architectural description tells us what components we need. The component design effort
builds those components in conformance to the architecture and specification. The components
will in general include both hardware—FPGAs, boards, and so on—and software modules. Some
of the components will be ready-made. The CPU, for example, will be a standard component in
almost all cases, as will memory chips and many other components. In the moving map, the GPS
receiver is a good example of a specialized component that will nonetheless be a predesigned,
standard component. We can also make use of standard software modules.

System Integration

Only after the components are built do we have the satisfaction of putting them together and
seeing a working system. Of course, this phase usually consists of a lot more than just plugging
everything together and standing back. Bugs are typically found during system integration, and
good planning can help us find the bugs quickly. By building up the system in phases and
running properly chosen tests, we can often find bugs more easily. If we debug only a few
modules at a time, we are more likely to uncover the simple bugs and able to easily recognize
them. Only by fixing the simple bugs early will we be able to uncover the more complex or
obscure bugs that can be identified only by giving the system a hard workout

6.INTRODUCTION TO HARVARD & VON NEUMAN ARCHITECTURES

Von Neumann Architecture


The Von Neumann architecture was first proposed by a computer scientist John von Neumann.
In this architecture, one data path or bus exists for both instruction and data. As a result, the CPU
does one operation at a time. It either fetches an instruction from memory, or performs read/write
operation on data. So an instruction fetch and a data operation cannot occur simultaneously,
sharing a common bus.

Von-Neumann architecture supports simple hardware. It allows the use of a single, sequential
memory. Today's processing speeds vastly outpace memory access times, and we employ a very
fast but small amount of memory (cache) local to the processor.
Harvard Architecture
The Harvard architecture offers separate storage and signal buses for instructions and data. This
architecture has data storage entirely contained within the CPU, and there is no access to the
instruction storage as data. Computers have separate memory areas for program instructions and
data using internal data buses, allowing simultaneous access to both instructions and data.
Programs needed to be loaded by an operator; the processor could not boot itself. In a Harvard
architecture, there is no need to make the two memories share properties.

Von-Neumann Architecture vs Harvard Architecture


The following points distinguish the Von Neumann Architecture from the Harvard Architecture.

Von-Neumann Architecture Harvard Architecture

Single memory to be shared by both code and data. Separate memories for code and data.

Processor needs to fetch code in a separate clock cycle Single clock cycle is sufficient, as
and data in another clock cycle. So it requires two separate buses are used to access code
clock cycles. and data.

Higher speed, thus less time consuming. Slower in speed, thus more time-
consuming.

Simple in design. Complex in design.

RISC Architectures
The term RISC stands for ‘’Reduced Instruction Set Computer’’. It is a CPU design plan based
on simple orders and acts fast.

This is a small or reduced set of instructions. Here, every instruction is expected to attain very
small jobs. In this machine, the instruction sets are modest and simple, which help in comprising
more complex commands. Each instruction is about a similar length; these are wound together to
get compound tasks done in a single operation. Most commands are completed in one machine
cycle. This pipelining is a crucial technique used to speed up RISC machines.

Reduced Instruction Set Computer is a microprocessor that is designed to carry out few
instructions at a similar time. Based on small commands, these chips need fewer transistors,
which makes the transistors inexpensive to design and produce. The features of RISC include the
following

 The demand for decoding is less


 Few data types in hardware
 General-purpose register Identical
 Uniform instruction set
 Simple addressing nodes

Also, while writing a program, RISC makes it easier by letting the computer programmer
eliminate needless codes and stops wasting cycles.

Characteristics
The characteristics of RISC architecture include the following.

 Simple Instructions are used in RISC architecture.


 RISC helps and supports few simple data types and synthesizes complex data types.
 RISC utilizes simple addressing modes and fixed-length instructions for pipelining.
 RISC permits any register to use in any context.
 One Cycle Execution Time
 The amount of work that a computer can perform is reduced by separating “LOAD” and
“STORE” instructions.
 RISC contains a Large Number of Registers to prevent various interactions with memory.
 In RISC, Pipelining is easy as the execution of all instructions will be done in a uniform
interval of time i.e. one click.
 In RISC, more RAM is required to store assembly-level instructions.
 Reduced instructions need a less number of transistors in RISC.
 RISC uses the Harvard memory model means it is Harvard Architecture.
 A compiler is used to perform the conversion operation means converting a high-level
language statement into the code of its form

CISC Architecture

The term CISC stands for ‘’Complex Instruction Set Computer’’. It is a CPU design plan based
on single commands, which are skilled in executing multi-step operations.

CISC computers have small programs. It has a huge number of compound instructions, which
take a long time to perform. Here, a single set of instructions is protected in several steps; each
instruction set has an additional than 300 separate instructions. Maximum instructions are
finished in two to ten machine cycles. In CISC, instruction pipelining is not easily implemented.

The CISC machines have good acts, based on the overview of program compilers; as the range
of innovative instructions are simply obtainable in one instruction set. They design compound
instructions in a single, simple set of instructions.

They achieve low-level processes, which makes it easier to have huge addressing nodes and
additional data types in the hardware of a machine. But, CISC is considered less efficient than
RISC, because of its incompetence to eliminate codes which leads to wasting of cycles. Also,
microprocessor chips are difficult to understand and program for, because of the complexity of
the hardware.

 Instruction Set Architecture is a medium to permit communication between the


programmer and the hardware. Data execution part, copying of data, deleting, or editing
is the user commands used in the microprocessor, and with this microprocessor, the
Instruction set architecture is operated.
 The main keywords used in the above Instruction Set Architecture are as below
Instruction Set: Group of instructions given to execute the program and they direct the
computer by manipulating the data. Instructions are in the form – Opcode (operational code) and
Operand. Where, the opcode is the instruction applied to load and store data, etc. The operand is
a memory register where instruction is applied.

Addressing Modes: Addressing modes are how the data is accessed. Depending upon the type
of instruction applied, addressing modes are of various types such as a direct mode where
straight data is accessed or indirect mode where the location of the data is accessed. Processors
having identical ISA may be very different in the organization. Processors with identical ISA and
nearly identical organization is still not nearly identical.

Characteristics

The characteristics of CISC architecture include the following.

 Instruction-decoding logic will be Complex.


 One instruction is required to support multiple addressing modes.
 Less chip space is enough for general purpose registers for the instructions that are
0operated directly on memory.
 Various CISC designs are set up with two special registers for the stack pointer, handling
interrupts, etc.
 MUL is referred to as a “complex instruction

Examples of CISC Processors

IBM 370/168 – It was introduced in the year 1970. CISC design is a 32-bit processor and four
64-bit floating point registers.

VAX 11/780 – CISC design is a 32-bit processor and it supports many numbers of addressing
modes and machine instructions which is from Digital Equipment Corporation.

Intel 80486 – It was launched in the year 1989 and it is a CISC processor, which has instructions
varying lengths from 1 to 11 and it will have 235 instructions.
CISC vs RISC
The following points differentiate a CISC from a RISC −

CISC RISC

Larger set of instructions. Easy to program Smaller set of Instructions. Difficult to


program.

Simpler design of compiler, considering larger Complex design of compiler.


set of instructions.

Many addressing modes causing complex Few addressing modes, fix instruction format.
instruction formats.

Instruction length is variable. Instruction length varies.

Higher clock cycles per second. Low clock cycle per second.

Emphasis is on hardware. Emphasis is on software.

Control unit implements large instruction set Each instruction is to be executed by hardware.
using micro-program unit.

Slower execution, as instructions are to be read Faster execution, as each instruction is to be


from memory and decoded by the decoder unit. executed by hardware.

Pipelining is not possible. Pipelining of instructions is possible,


considering single clock cycle.

7.CPU BUSES
A computer system encompasses much more than the CPU;it also includes memory and I/O
devices. The bus is the mechanism by which the CPU communicates with memory and devices.
A bus is, at a minimum, a collection of wires, but the bus also defines a protocol by which the
CPU, memory, and devices communicate. One of the major roles of the bus is to provide an
interface to memory. (Of course, I/O devices also connect to the bus.)
7.1. Bus Protocols:
The basic building block of most bus protocols is the four-cycle handshake, illustrated in
Figure 2.1. The handshake ensures that when two devices want to communicate, one is ready to
transmit and the other is ready to receive.
The handshake uses a pair of wires dedicated to the handshake: enq (meaning enquiry)
and ack (meaning acknowledge). Extra wires are used for the data transmitted during the
handshake. The four cycles are described below.
Device 1 raises its output to signal an enquiry, which tells device 2 that it should get ready to
listen for data.
When device 2 is ready to receive, it raises its output to signal an acknowledgment. At this
point, devices 1 and 2 can transmit or receive.
Once the data transfer is complete, device 2 lowers its output, signaling that it has received the
data.
After seeing that ack has been released, device 1 lowers its output.
At the end of the handshake, both handshaking signals are low, just as they were at the start of
the handshake. The system has thus returned to its original state in readiness for another
handshake-enabled data transfer.
Microprocessor buses build on the handshake for communication between the CPU and other
system components. The term bus is used in two ways.
The most basic use is as a set of related wires, such as address wires. However, the term may
also mean a protocol for communicating between components.
To avoid confusion, we will use the term bundle to refer to a set of related signals. The
fundamental bus operations are reading and writing. Figure 2.2 shows the structure of a typical
bus that supports reads and writes.
The major components follow:
Clock provides synchronization to the bus components,
R/W is true when the bus is reading and false when the bus is writing,
Address is an a-bit bundle of signals that transmits the address for an access,
Data is an n-bit bundle of signals that can carry data to or from the CPU, and
Data ready signals when the values on the data bundle are valid.
7.2.BusOrganisation

Direct memory access (DMA) is a bus operation that allows reads and writes not controlled
by the CPU. A DMA transfer is controlled by a DMA controller, which requests control of the
bus from the CPU.
After gaining control, the DMA controller performs read and write operations directly between
devices and memory. Figure 2.3 shows the configuration of a bus with a DMA controller. The
DMA requires the CPU to provide two additional bus signals:
The bus request is an input to the CPU through which DMA controllers ask for ownership
of the bus.
The bus grant signals that the bus has been granted to the DMA controller.
A device that can initiate its own bus transfer is known as a bus master. Devices that do not
have the capability to be bus masters do not need to connect to a bus request and bus grant.
The DMA controller uses these two signals to gain control of the bus using a classic four-cycle
handshake. The bus request is asserted by the DMA controller when it wants to control the bus,
and the bus grant is asserted by the CPU when the bus is ready.
The CPU will finish all pending bus transactions before granting control of the bus to the DMA
controller. When it does grant control, it stops driving the other bus signals: R/W, address, and so
on. Upon becoming bus master, the DMA controller has control of all bus signals (except, of
course, for bus request and bus grant).
8.MEMORY DEVICES AND THEIR CHARACTERISTICS
RAM, EEPROM-FLASH MEMORY- DRAM

Random Access Memory (RAM): RAM is a type of volatile memory that provides fast access
to data. It is used to store temporary data and program instructions that the processor needs to
access quickly. RAM loses its data when power is turned off, which means it is not suitable for
permanent data storage. There are two main types of RAM used in embedded systems:

a. Static RAM (SRAM): SRAM uses flip-flops to store each bit of data, which allows for faster
access times compared to other types of RAM. It is more expensive and requires more power
than DRAM but is often used in caches and critical areas that need fast access.

b. Dynamic RAM (DRAM): DRAM uses capacitors to store each bit of data and requires
periodic refreshing to maintain the data. It is cheaper and less power-hungry than SRAM but has
longer access times. DRAM is commonly used as the main system memory in embedded
systems.

Electrically Erasable Programmable Read-Only Memory (EEPROM): EEPROM is a non-


volatile memory, meaning it retains data even when the power is turned off. It allows for both
read and write operations, and individual bytes can be erased and reprogrammed. EEPROM is
useful for storing small amounts of critical data, such as calibration data or configuration settings
that need to survive power cycles.

Flash Memory: Flash memory is another type of non-volatile memory that can be electrically
erased and reprogrammed. It is widely used in embedded systems due to its fast access times,
low power consumption, and high data density. Flash memory is commonly used for storing
firmware, operating systems, and other non-volatile data in embedded systems.

There are different types of flash memory, including NAND flash and NOR flash, each with its
own characteristics and applications. NAND flash is commonly used for data storage, while
NOR flash is often used for boot code and firmware.

Embedded systems often use a combination of RAM, EEPROM, and flash memory to store and
manage data efficiently. RAM provides fast access for temporary data storage, EEPROM retains
critical data during power cycles, and flash memory serves as a non-volatile storage solution for
firmware and other essential programs.

Characteristics of the various memory devices

Volatil Erase Max Erase


Type Writeable Cost (per Byte) Speed
e Size Cycles
SRAM Yes Yes Byte Unlimited Expensive Fast
DRAM Yes Yes Byte Unlimited Moderate Moderate
Masked
No No n/a n/a Inexpensive Fast
ROM
Once, with a
PROM No device n/a n/a Moderate Fast
programmer
Yes, with a
Entire
EPROM No device Limited Moderate Fast
Chip
programmer
Fast to read,
EEPROM No Yes Byte Limited Expensive slow to
erase/write
Fast to read,
Flash No Yes Sector Limited Moderate slow to
erase/write
Expensive (SRAM
NVRAM No Yes Byte Unlimited Fast
+ battery)

9.BIOS
In an embedded system, the Basic Input/Output System (BIOS) plays a crucial role in initializing
and managing the hardware components during the boot-up process. BIOS are a firmware that
resides on a read-only memory (ROM) chip on the embedded system's motherboard. Its main
function is to perform the initial setup and configuration of the hardware components, load the
operating system into memory, and provide a basic set of low-level services for the operating
system to use.

BIOS in an embedded system:

1. Power-On Self Test (POST):


 When the embedded system is powered on or reset, the BIOS starts the Power-On Self
Test (POST). The POST checks the essential hardware components like CPU, RAM,
storage devices, and peripherals to ensure they are functional and properly connected. If
any hardware problem is detected, the BIOS typically displays an error message or beep
codes to indicate the issue.
2. Hardware Initialization:
 After the POST, the BIOS initializes the hardware devices one by one. It configures
various settings for each component, such as setting up the clock frequencies, enabling or
disabling certain features, and checking for compatibility issues.
3. Boot Device Selection:
 Once the hardware is initialized, the BIOS identifies the bootable devices connected to
the system, such as hard drives, solid-state drives, USB drives, and network boot devices.
It then determines the boot order based on the settings configured in the BIOS setup
utility (accessed by pressing a specific key during the boot process, usually Del or F2).
4. Boot Loader Execution:
 Once the boot device is selected, the BIOS loads the first sector of the boot device,
known as the Master Boot Record (MBR), into memory and transfers control to it. The
MBR contains the boot loader code, which is responsible for locating and loading the
operating system kernel into memory.
5. Option ROM Execution:
 The BIOS may also support Option ROMs, which are expansion card firmware. These
Option ROMs can be used by devices like network cards, graphics cards, and RAID
controllers to provide extended functionality during the boot process.
6. BIOS Services:
 After the boot process, the BIOS continues to provide essential services to the operating
system through a set of BIOS interrupt calls (also known as BIOS services). These
services allow the operating system to interact with the hardware at a low level, such as
reading from and writing to disk, accessing the keyboard, and managing system timers.
7. System Configuration:
 The BIOS stores system configuration data, such as date, time, and various hardware
settings, in a non-volatile memory (CMOS) chip. These settings can be accessed and
modified through the BIOS setup utility.
8. Legacy Support:
 In some cases, embedded systems may need to support older hardware and software that
rely on legacy BIOS interfaces. Therefore, the BIOS may include legacy support for
older protocols and hardware standards.
9. Security Features:
 Modern embedded system BIOS may also include security features like Secure Boot,
which ensures that only authenticated and signed bootloaders and operating systems are
allowed to run, protecting the system from malware and unauthorized software.
In an embedded system, the Power-On Self Test (POST) is a crucial part of the boot
process. It is a series of hardware tests and checks performed by the system firmware, typically
the BIOS or UEFI, when the system is powered on or reset. The primary purpose of the POST is
to verify the functionality of essential hardware components before loading the operating system.

10.POST

In an embedded system, the Power-On Self Test (POST) is a crucial part of the boot process. It
is a series of hardware tests and checks performed by the system firmware, typically the BIOS or
UEFI, when the system is powered on or reset. The primary purpose of the POST is to verify the
functionality of essential hardware components before loading the operating system.

POST in an embedded system:

1. Power-On or Reset Trigger

The POST process begins when the embedded system is powered on or when a hardware reset
signal is received. The system firmware (BIOS or UEFI) takes control of the boot process.

2. CPU Initialization

The first step in the POST is the initialization of the Central Processing Unit (CPU). The
firmware configures the CPU, sets up its registers, and prepares it for further operation.

3. Memory Detection and Initialization


After the CPU initialization, the firmware proceeds to detect and initialize the system memory
(RAM). It checks for memory modules, their capacity, and verifies if the memory is operational.

4. Cache Initialization

If the CPU has a cache, the firmware initializes it as well. The cache is a small but faster memory
located close to the CPU that stores frequently accessed data, improving overall system
performance.

5. Chipset and Hardware Detection

The POST continues by detecting and initializing the chipset and other hardware components on
the motherboard. This includes the southbridge, northbridge, system buses, and peripheral
controllers.

6. Graphics Initialization

If the embedded system has a discrete graphics card, the firmware initializes it and sets up the
basic display settings to enable video output.

7. Keyboard and Input Devices

The firmware checks the keyboard and other input devices to ensure they are functioning
correctly. It may display messages like "Press DEL to enter Setup" to allow users to access the
BIOS/UEFI setup utility.

8. Peripheral Detection

The POST scans for connected peripheral devices such as hard drives, solid-state drives, optical
drives, USB devices, network cards, and other expansion cards. It verifies if these devices are
present and operational.

9. Option ROM Execution

During the POST process, if any expansion cards have Option ROMs (firmware built into the
card), the firmware may execute them to provide additional features or configuration options.

10. Error Checking and Reporting

As the POST performs hardware tests, it checks for any errors or failures in the detected
hardware components. If an error is found, the firmware generates error codes or displays error
messages on the screen. It may also emit beep codes through the system speaker to indicate
specific hardware issues.

11. Boot Device Selection


Once the POST completes successfully and no critical hardware errors are found, the firmware
proceeds to select the boot device based on the configured boot order. The boot device contains
the boot loader, which is responsible for loading the operating system into memory.

12. Transfer Control to Boot Loader

After the boot device is selected, the firmware transfers control to the first sector of the boot
device, typically the Master Boot Record (MBR). The MBR contains the boot loader code,
which continues the boot process by loading the operating system kernel into memory.

The POST is a vital part of the embedded system boot process as it ensures that the
hardware components are functioning correctly before attempting to start the operating system. If
any critical hardware issues are detected during the POST, the firmware typically halts the boot
process, displays error messages or beep codes, and prompts the user to take appropriate actions,
such as fixing the hardware issue or entering the BIOS/UEFI setup utility to make necessary
adjustments.

10. DEVICE DRIVERS

Device drivers are a critical component of embedded systems, as they allow the operating system
or software to communicate and interact with hardware devices. Embedded systems are
specialized computer systems designed to perform specific functions or tasks and are often found
in various applications such as consumer electronics, automotive systems, medical devices,
industrial automation, and more.

Overview of device drivers in embedded systems:

1. Purpose of Device Drivers:

Device drivers act as intermediaries between the hardware components and the higher-level
software applications. They provide an abstraction layer that allows the operating system and
applications to interact with hardware devices without needing to understand the low-level
hardware details.

2. Functionality of Device Drivers:

Device drivers perform several essential functions:

Initialization: Device drivers initialize the hardware device and prepare it for operation. This
involves setting up registers, configuring communication protocols, and other necessary setup
procedures.

Data Transfer:Drivers facilitate the transfer of data between the hardware and software. This
includes reading data from sensors, writing data to actuators, and managing data buffers.
Error Handling: Device drivers manage error conditions that may arise during hardware
operation. They can detect and report errors, handle recovery mechanisms, and provide error
codes or messages to the software.

Interrupt Handling: Many embedded systems rely on interrupts to signal events from hardware
devices. Device drivers handle these interrupts, allowing the system to respond quickly to time-
sensitive events.

Power Management: Device drivers often play a role in managing power consumption by
controlling the device's power modes and determining when it should be turned on or off.

3. Types of Device Drivers:

Embedded systems use various types of device drivers based on the nature of the hardware and
the system architecture:

Character Drivers: These drivers handle character-oriented devices such as serial ports,
keyboards, and sensors that send or receive data character by character.

Block Drivers: Block drivers manage block-oriented devices like hard drives, flash memory, and
memory cards. They handle data in fixed-size blocks or sectors.

Network Drivers: Network drivers facilitate communication between the embedded system and
network interfaces, such as Ethernet or Wi-Fi adapters.

Graphics Drivers: In systems with displays, graphics drivers control the display hardware,
allowing the rendering of graphics and text.

USB Drivers: These drivers enable communication with USB devices, such as USB storage,
printers, and input devices.

I2C, SPI, UART Drivers: These drivers manage communication protocols commonly used for
inter-device communication, like I2C, SPI, and UART.

4. Writing Device Drivers:

Writing device drivers requires knowledge of both the hardware and the operating system or
software platform. Depending on the system, drivers can be written in languages like C or C++.
They must adhere to the conventions of the operating system's driver framework and follow
hardware-specific protocols.

Device drivers are integral to the operation of embedded systems, enabling them to interact with
hardware components efficiently and effectively. They bridge the gap between the hardware and
software layers, ensuring smooth communication and optimal utilization of resources.

Block diagram
• Device driver is a piece of software that acts as a bridge between the operating system and the
hardware
• The user applications talk to the OS kernel for all necessary information exchange including
communication with the hardware peripherals
• The architecture of the OS kernel will not allow direct device access from the user application
• All the device related access should flow through the OS kernel and the OS kernel routes it to
the concerned hardware peripheral
• OS Provides interfaces in the form of Application Programming Interfaces (APIs) for accessing
the hardware
• The device driver abstracts the hardware from user applications
• Device drivers are responsible for initiating and managing the communication with the hardware
peripherals
• Drivers which comes as part of the Operating system image is known asbuilt-in drivers’ or
‘onboard’ drivers. Eg. NAND FLASH driver
• Drivers which needs to be installed on the fly for communicating with add-on devices are known
as ‘Installable drivers’
• For installable drivers, the driver is loaded on a need basis when the device is present and it is
unloaded when the device is removed/detached
• The ‘Device Manager service of the OS kernel is responsible for loading and unloading the driver,
managing the driver etc.

• The underlying implementation of device driver is OS kernel dependent


• The driver communicates with the kernel is dependent on the OS structure and implementation.
• Device drivers can run on either user space or kernel space
• Device drivers which run in user space are known as user mode drivers and the drivers which
run in kernel space are known as kernel mode drivers
• User mode drivers are safer than kernel mode drivers
• If an error or exception occurs in a user mode driver, it won’t affect the services of the kernel
• If an exception occurs in the kernel mode driver, it may lead to the kernel crash
• The way how a device driver is written and how the interrupts are handled in it are Operating
system and target hardware specific.
• The device driver implements the following:
• Device (Hardware) Initialization and Interrupt configuration
• Interrupt handling and processing
• Client interfacing (Interfacing with user applications)
• The basic Interrupt configuration involves the following.
• Set the interrupt type (Edge Triggered (Rising/Falling) or Level Triggered (Low or
High)), enable the interrupts and set the interrupt priorities.
• The processor identifies an interrupt through IRQ.
• IRQs are generated by the Interrupt Controller.
• Register an Interrupt Service Routine (ISR) with an Interrupt Request (IRQ).
• When an interrupt occurs, depending on its priority, it is serviced and the corresponding
ISR is invoked
• The processing part of an interrupt is handled in an ISR

You might also like