Ee6602 Embedded Systems LT P C 3 0 0 3
Ee6602 Embedded Systems LT P C 3 0 0 3
Ee6602 Embedded Systems LT P C 3 0 0 3
Unit III
EMBEDDED FIRMWARE DEVELOPMENT ENVIRONMENT
Sl.No.Knowledge level Course Content CO State-
1. U Objectives of Embedded Product Development Life ment
2. U Cycle. phases of EDLC
Different
3. U/E Modeling of EDLC
4. U/An Issues in Hardware-software Co-design
C402.3
5. U/An Data Flow Graph
6. U State machine model
7. U Sequential Program Model
8. U Concurrent Model
9. U Object oriented Model
Unit IV
RTOS BASED EMBEDDED SYSTEM DESIGN
Sl.No.Knowledge level Course Content CO State-
St. Joseph’s College of Engineering 2
EE8691-Embedded Systems Department of EIE 2021-2022
1. U Introduction to basic concepts of RTOS
2. U Task, process & threads
3. U/R Interrupt routines in RTOS,
4. U Multiprocessing and Multitasking
5. U Preemptive and non-preemptive scheduling
6. U Task communication shared C402.4
7. U Message passing-, Inter process Communication
8. Synchronization between
U/An
processes-semaphores, Mailbox, pipes, priority inver-
9. sion.
Comparison of Real
U/An
time Operating systems: VxWorks, чC/OS-II, RT
Unit V
EMBEDDED SYSTEM APPLICATION DEVELOPMENT
Sl.No.Knowledge level Course Content CO State-
1. U/Ap Washing Machine Application ment
2. U/Ap Washing Machine hardware
3. U/Ap Washing Machine software
4. U/Ap Automotive Application
C402.5
5. U/Ap Automotive hardware software
6. U/Ap Automotive software
7. U/Ap Smart card System Application
8. U/Ap Smart card System-hardware
9. U/Ap Smart card System software
Ap – Appling; An – Analyzing; U – Understanding, E- Evaluating,C-Creating,R-
Remembering
UNIT – I
INTRODUCTION TO EMBEDDED SYSTEMS
Part – B (C402.1)
1. Explain the process of converting high level language application software in to a ROM
image for an embedded system.
To do all the coding in assembly language may be very time consuming in most cases.
Software istherefore developed in a high-level language, ‘C’ or ‘C++’ or ‘Java’. Most of
the times, ‘C’ is thepreferred language. For coding, there is little needto understand
assembly language instructions and the programmer does not have to know the
machinecode for any instruction at all. The programmer needs to understand only the
hardware organization.
It is evident, then, that coding for square-root will need many lines of code and can be
done only byan expert assembly language programmer. To write the program in a high
St. Joseph’s College of Engineering 3
EE8691-Embedded Systems Department of EIE 2021-2022
level language is very simplecompared to writing it in the assembly language. ‘C’
programs have a feature that adds the assemblyinstructions when using certain processor-
specific features and coding for the specific section, forexample, port device driver. the
different programming layers in a typical embedded‘C’ software. These layers are as
follows. (i)Processor Commands. (ii) Main Function. (iii) Interrupt Service Routine. (iv)
Multiple tasks, say, 1 toN. (v) Kernel and Scheduler. (vi) Standard library functions,
protocol functions and stack allocationfunctions.Figure 1.8 shows the process of
converting a C program into the ROM image file. A compilergenerates the object codes.
The compiler assembles the codes according to the processor instructionset and other
specifications.
The ‘C’ compiler for embedded systems must, as a final step of compilation,use a code-
optimizer. It optimizes the codes before linking. After compilation, the linker linksthe
object codes with other needed codes. For example, the linker includes the codes for the
functions,printfandsqrt codes. Codes for device management and driver (device control
codes) also link at thisstage: for example, printer device management and driver codes.
2. Explain in detail the design process involved in embedded system /Explain in detail
about the different embedded processors in a system.(DEC 2014) (MAY 2015).
PROCESSOR EMBEDDED INTO A SYSTEM
St. Joseph’s College of Engineering 4
EE8691-Embedded Systems Department of EIE 2021-2022
A processor is the heart of the embedded system. For an embedded system designer,
knowledge of microprocessors and microcontrollers is a prerequisite. In the following
explanations, too, it has been presumed that the reader has a thorough understanding of
microprocessors or microcontrollers. [The reader may refer to a standard text or the texts
listed in the ‘References’ at the end of this book for an in-depth understanding of
microprocessors, microprocessors and DSPs that are incorporated in embedded system
design.]
For a system designer, the following are important considerations when selecting a
processor:
1. Instruction set.
2. Maximum bits in an operand (8 or 16 or 32) in a single arithmetic or logical operation.
3. Clock frequency in MHz and processing speed in Million Instructions Per Second
(MIPS).
[Refer to Appendix B for an alternate metric Dhyrystonefor processing performance.]
4. Processor ability to solve the complex algorithms used in meeting the deadlines for
theirprocessing.
Microprocessor
The CPU is a unit that centrally fetches and processes a set of general-purpose
instructions. The CPU instruction set (Section 2.4) includes instructions for data transfer
operations, ALU operations, stack operations, input and output (I/O) operations and
program control, sequencing and supervising operations. The general purpose instruction
set (refer to Appendix A, Section A.1) is always specific to a specific CPU. Any CPU
must possess the following basic functional units.
1. A control unit to fetch and control the sequential processing of a given command or
instruction and for communicating with the rest of the system.
2. An ALU for the arithmetic and logical operations on the bytes or words. It may be
capable of processing 8, 16, 32 or 64 bit words at an instant.
A microprocessor is a single VLSI chip that has a CPU and may also have some other
units (for examples, caches, floating point processing arithmetic unit, pipelining and
super-scaling units) that are additionally present and that result in faster processing of
instructions. [Refer to Section 2.1.] The earlier generation microprocessor’s fetch-and-
execute cycle was guided by clock frequency of the order of ~1 MHz. Processors now
operate at clock frequency of 2 GHz. [Intel released a 2 GHz processor on August 25,
2001. This also marked the twentieth anniversary of the introduction of the IBM PC. Intel
released 3 GHz Pentium 4 on April 14, 2003.] Since early 2002, a few highly
sophisticated embedded systems (for examples, Gbps transceiver and encryption engine)
have incorporated the GHZ processor. [Gbps means Giga bit per second. Transceiver
means a transmitting cum receiving circuit with appropriate processing and controls, for
example, for bus-collisions.]
One example of an older generation microprocessor is Intel 8085. It is an 8-bit processor.
Another is Intel 8086 or 8088, which is a 16-bit processor. Intel 80x86 (also referred as
x86) processors are the 32-bit successors of 8086. [The x here means extended 8086 for
32 bits.] Examples of 32-bit processors in 80x86 series are Intel 80386 and 80486.
Mostly, the IBM PCs use 80x86 series of processors and the embedded systems
incorporated inside the PC for specific tasks (like graphic accelerator, disk controllers,
network interface card) use these microprocessors. An example of the new generation 32-
and 64-bit microprocessor is the classic Pentium series of processors from Intel. These
have superscalar architecture [Section 2.1]. They also possess powerful ALUs and
Floating Point Processing Units (FLPUs) [Table 2.1]. An example of the use of Pentium
III operating at 1 GHz clock frequency in an embedded system is the ‘Encryption
Engine’. This gives encrypted data at the rate of 0.464 Gbps.
The microprocessors from Streams 1 and 2 have Complicated Instruction Set Computer
(CISC)
architecture [Section A.1]. Microprocessors form Streams 3 and 4 have Reduced
St. Joseph’s College of Engineering 6
EE8691-Embedded Systems Department of EIE 2021-2022
Instruction SetComputer (RISC) architecture [Section A.1.4]. An RISC processor
provides speedy processing of the instructions, each in a single clock-cycle. Further,
besides the greatly enhanced capabilities mentioned above, there is great enhancement of
the speed by which an instruction from a set is processed. Thumb‚ Instruction set is a new
industry standard that also gives a reduced code density in a RISC processor. [The
concepts of architecture features of the processor in an embedded system, CISC and RISC
processors and processor instruction-set will be explained later in Appendices A and B.]
RISCs are used when the system needs to perform intensive computation, for example, in
a speech processing system.
How does a system designer select a microprocessor? This will be explained in Section
2.2.
MICROCONTROLLER
Just as a microprocessor is the most essential part of a computing system, a
microcontroller is the most essential component of a control or communication circuit. A
microcontroller is a single-chip VLSI unit (also called ‘microcomputer’) which, though
having limited computational capabilities, possesses enhanced input-output capabilities
and a number of on-chip functional units. [Refer to Section 1.3 for various functional
units.] Microcontrollers are particularly suited for use in embedded systems for real-time
control applications with on-chip program memory and devices. Figure 1.2 shows the
functional circuits present (in solid boundary boxes) in a microcontroller. It also shows
the application-specific units (in dashed boundary boxes) in a specific version of a given
microcontroller family. A few of the latest microcontrollers also have high computational
and superscalar processing capabilities. [For the meaning of superscalar architecture, refer
to Section 2.1.] Appendix C gives the comparative functionalities of select
microcontroller representatives from these families. Important microcontroller chips for
embedded systems are usually among the following five streams of families given in
Table 1.2.
Figure 1.3 shows commonly used microcontrollers in the small-, medium- and large-
scale embedded systems. In Section C.1 (refer to Tables C.1.1 to C.1.3 therein) those
features will be described that have to be considered by a system designer before
choosing a microcontroller as a processing unit.
2) Design Methodology
2) Design Methodology
An embedded system is a system that has three main components embedded into it
I. It embeds hardware similar to a computer. Figure 1.1 shows the units in the hardware or an em-
bedded system. As its software usually embeds in the ROM or flash memory, it usually do not
need a secondary hard disk and CD memory as in a computer
2. It embeds main application software. The application software may concurrently perform a
series of tasks or processes or threads
3, It embeds a real-time operating system (RTOS) that supervises the application software running
on hardware and organizes access to a resource according to the priorities of tasks in the system.
It provides a mechanism to let the processor run a process as scheduled and context-switch
between the various processes. (The concept of process. thread and task explained later in Sec-
tions 7.1 to 7.3.) It sets the rules during the execution of the application software. (A small-scale
embedded system may no embed the RTOS)
Built-in process:
Assembly language coding is extremely useful for configuring physical devices like ports. A line-
display interface, ADC and DAC and reading into or transmitting from a buffer. These codes are
also called low-level codes for the device driver functions
Lack of knowledge of writing device driver codes or codes that utilize the processor-specific fea-
tures- invoicing codes in an embedded system design team can cost a lot a vendor may charge for
the APIs and also charge intellectual property fees for each system shipped out of the company.
To make all the codes in assembly language may, however, be very time consuming. Full coding
assembly may be done only for a few simple, small-scale systems, such as toys, automatic chocol-
ate vending machines, robots or data acquisition systems.
1. An assembler translates the assembly software into the machine codes using a step called as-
sembling.
2. In the next step, called linking, a linker links these codes with the other codes required. Linking
is necessary because of the number of codes to be linked for the final binary file. For example,
there are the standard codes to program a delay task for which there is a reference in the assembly
language program. The codes for the delay must link with the assembled codes. The delay code is
sequential from a certain beginning address. The assembly software code is also sequential from a
certain beginning address. Both the codes have to be linked at the distinct addresses as well as at
the available addresses in the system, the linked file in binary for run on a computer is commonly
known as an executable file or simply an ‘.exe’ file. After linking, there has to be reallocation of
the sequences of placing the codes before actually placing the codes in memory.
3. In the next step, the louder program performs the task of reallocating the codes after finding the
physical memory addresses available at a given instant. The loader is a pail of the operating sys-
tem and places codes into the memory after reading the ‘exe’ rile. This step is necessary because
the available memory addresses may not start from Ox0000, and binary codes have to be loaded
at different addresses during the run. The loader finds the appropriate start address. In a computer,
St. Joseph’s College of Engineering 9
EE8691-Embedded Systems Department of EIE 2021-2022
after the loader loads into a section of RAM, the program is ready to run.
4. The final step of the system design process is locating these codes as a ROM image. The codes
are permanently placed at the addresses actually available in the ROM. In embedded systems,
there is no program to keep track of the available addresses at different times during the run, as in
a computer. In embedded systems, therefore, the next step instead of loader after linking is the use
of a locater, which locates the I0 tasks and hardware device driver codes at fixed addresses. P0(1
and device addresses are fixed for a given system as per the interfacing circuit between the system
buses and ports or devices. the locator program reallocates the linked file and creates a file for a
permanent location of the codes in a standard format. The file format may be in the Intel Hex file
format or Motorola s-record format .The designer has to define die available addresses to locate
and create files to permanently locate the codes.
5. Lastly, either (i) a laboratory system. called device programmer, takes as input the ROM image
file and finally burns the image into the PROM or flash or (ii) at foundry, a mask is created for
the ROM of the embedded system from the ROM image file. (The process of placing the codes in
PROM or flash is also called burning.]The mask created from the image gives the ROM in IC
chip form.
3. List the various hardware units that must in be present the Embedded system. (Dec
2017)
EMBEDDED SYSTEM
A computer is a system that has the following or more components.
1. A microprocessor
2. A large memory comprising the following two kinds:
(a) Primary memory (semiconductor memories - RAM, ROM and fast accessible caches)
(b) Secondary memory (magnetic memory located in hard disks, diskettes and cartridge tapes
and optical memory in CD-ROM)
3. Input units like keyboard, mouse, digitizer, scanner, etc.
4. Output units like video monitor, printer, etc.
5. Networking units like Ethernet card, front-end processor-based drivers, etc.
6. I/O units like a modem, fax cum modem, etc.
An embedded system is one that has computer-hardware with software embedded in it as one
of its most important component. It is a dedicated computer-based system for an
application(s) or product. It may be either an independent system or a part of a larger system.
As its software usually embeds in ROM (Read Only Memory) it does not need secondary
memories as in a computer.
1. It has hardware. Figure 1.1 shows the units in the hardware of an embedded system.
2. It has main application software. The application software may perform concurrently the
series of tasks or multiple tasks.
3. It has a real time operating system (RTOS) that supervises the application software and
provides a mechanism to let the processor run a process as per scheduling and do the context-
switch between the various processes (tasks). RTOS defines the way the system works. It
organizes access to a resource in sequence of the series of tasks of the system. It schedules
their working and execution by following a plan to control the latencies and to meet the
deadlines. [Latency refers to the waiting period between running the codes of a task and the
instance at which the need for the task arises.] It sets the rules during the execution of the
application software. A small-scale embedded system may not need an RTOS. An embedded
system has software designed to keep in view three constraints: (i) available systemmemory,
(ii) available processor speed and (iii) the need to limit power dissipation when running the
St. Joseph’s College of Engineering 10
EE8691-Embedded Systems Department of EIE 2021-2022
system continuously in cycles of wait for events, run, stop and wake-up. There are several
definitions of embedded systems given in books published recently. Given below is a series
of definitions from others in the field:
(1) “An embedded system is a system whose principal function is not computational, but
which is controlled by a computer embedded within it. The computer is likely to be a
microprocessor or microcontroller. The word embedded implies that it lies inside the overall
system, hidden from view, forming an integral part of greater whole”.
4. How the Real time systems differ from conventional system? (MAY 2015) (DEC2014
A Real-Time Operating System (RTOS) is a computing environment that reacts to input
within a specific time period. A real-time deadline can be so small that system reaction
appears instantaneous. The term real-time computing has also been used, however, to
describe "slow real-time" output that has a longer, but fixed, time limit.
Learning the difference between real-time and standard operating systems is as easy as
imagining yourself in a computer game. Each of the actions you take in the game is like a
program running in that environment. A game that has a real-time operating system for its
environment can feel like an extension of your body because you can count on a specific "lag
time:" the time between your request for action and the computer's noticeable execution of
your request. A standard operating system, however, may feel disjointed because the lag time
is unreliable. To achieve time reliability, real-time programs and their operating
system environment must prioritize deadline actualization before anything else. In the gaming
example, this might result in dropped frames or lower visual quality when reaction time and
visual effects conflict.
5.Explain the components of embedded system hardware and the functional circuits in
the core of microcontroller.
EMBEDDED SYSTEM
A computer is a system that has the following or more components.
1. A microprocessor
2. A large memory comprising the following two kinds:
(a) Primary memory (semiconductor memories - RAM, ROM and fast accessible caches)
(b) Secondary memory (magnetic memory located in hard disks, diskettes and cartridge tapes
and optical memory in CD-ROM)
3. Input units like keyboard, mouse, digitizer, scanner, etc.
4. Output units like video monitor, printer, etc.
St. Joseph’s College of Engineering 11
EE8691-Embedded Systems Department of EIE 2021-2022
5. Networking units like Ethernet card, front-end processor-based drivers, etc.
6. I/O units like a modem, fax cum modem, etc.
An embedded system is one that has computer-hardware with software embedded in it as one
of its most important component. It is a dedicated computer-based system for an
application(s) or product. It may be either an independent system or a part of a larger system.
As its software usually embeds in ROM (Read Only Memory) it does not need secondary
memories as in a computer.
1. It has hardware. Figure shows the units in the hardware of an embedded system.
2. It has main application software. The application software may perform concurrently the
series of tasks or multiple tasks.
3. It has a real time operating system (RTOS) that supervises the application software and
provides a mechanism to let the processor run a process as per scheduling and do the context-
switch between the various processes (tasks). RTOS defines the way the system works. It
organizes access to a resource in sequence of the series of tasks of the system. It schedules
their working and execution by following a plan to control the latencies and to meet the
deadlines. [Latency refers to the waiting period between running the codes of a task and the
instance at which the need for the task arises.] It sets the rules during the execution of the
application software. A small-scale embedded system may not need an RTOS. An embedded
system has software designed to keep in view three constraints: (i) available systemmemory,
(ii) available processor speed and (iii) the need to limit power dissipation when running the
system continuously in cycles of wait for events, run, stop and wake-up. There are several
definitions of embedded systems given in books published recently. Given below is a series
of definitions from others in the field:
(1) “An embedded system is a system whose principal function is not computational, but
which is controlled by a computer embedded within it. The computer is likely to be a
microprocessor or microcontroller. The word embedded implies that it lies inside the overall
system, hidden from view, forming an integral part of greater whole”.
MICROCONTROLLER
Just as a microprocessor is the most essential part of a computing system, a microcontroller is
the most essential component of a control or communication circuit. A microcontroller is a
St. Joseph’s College of Engineering 12
EE8691-Embedded Systems Department of EIE 2021-2022
single-chip VLSI unit (also called ‘microcomputer’) which, though having limited
computational capabilities, possesses enhanced input-output capabilities and a number of
on-chip functional units. [Refer to Section 1.3 for various functional units.] Microcontrollers
are particularly suited for use in embedded systems for real-time control applications with on-
chip program memory and devices. Figure 1.2 shows the functional circuits present (in solid
boundary boxes) in a microcontroller. It also shows the application-specific units (in dashed
boundary boxes) in a specific version of a given microcontroller family. A few of the latest
microcontrollers also have high computational and superscalar processing capabilities. [For
the meaning of superscalar architecture, refer to Section 2.1.] Appendix C gives the
comparative functionalities of select microcontroller representatives from these families.
Important microcontroller chips for embedded systems are usually among the following five
streams of families given in Table 1.2.
Figure 1.3 shows commonly used microcontrollers in the small-, medium- and large-scale
embedded systems. In Section C.1 (refer to Tables C.1.1 to C.1.3 therein) those features will
be described that have to be considered by a system designer before choosing a
microcontroller as a processing unit.
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 of the SoCVLSI 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 andanalog units. A SoC may also have anetwork protocol
embedded into it. It may also embed anencryption function unit. It can embed discrete cosine
transforms for signal processing applications. Itmay embed FPGA (Field Programmable Gate
Array) cores [Section 1.6.5].
For a number of applications, the GPP (microcontrollers, microprocessors or DSPs) cores
may notsuffice. For security applications, killer applications, smart card, video game, palm
top computer, cellphone,mobile-Internet, hand-held embedded systems, Gbps transceivers,
Gigabits per second LANsystems and satellite or missile systems, we need special processing
units in a VLSI designed circuit tofunction 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) andnon-configurable processors (DSP or
Microprocessor or Microcontrollers) might be needed on achip. One example of a killer
application using multiple ASIPs is high-definition television signalsprocessing. [High
definition means that the signals are processed for a noise-free, echo-canceledtransmission,
and for obtaining a flat high-resolution image (1920 x 1020 pixels) on the televisionscreen.]
A cell-phone is another killer application. [A killer application is one that is useful to millions
ofusers.]
Recently, embedded SoCs have been designed for functioning as DNA chips. Consider an
FPGAwith a large number of gate arrays. Now, using VLSI design techniques, we can
configure thesearrays to process the specific tasks on anSoC. This gives anSoC as a DNA
chip. Each set of arrayshas a specific and distinct DNA complex structure. These structures as
well as the processor embedson the DNA chip.
Microwave ovens
Digital cameras
Mp3 players
Video game consoles
Temperature measurement systems
Networked embedded system:
Networked embedded systems are those systems which are connected to the network to give
output to the attached resources. The devices in the networked embedded system are connec-
ted to the network with network interfaces. The network can be either a local area network
(LAN) or a wide area network (WAN). The connection in networked embedded systems can
be wireless or wired. This embedded system is fast and emerging its popularity over days.
The embedded web server is that which is connected to network devices and is controlled by
the web browser also. Example of this is the office security system. In office security system,
STRUCTURAL UNITS
Characteristics:
8.Compare the features of various types of memory (MAY 2015) (Dec 2017)
In a system, there are various types of memories. Figure 1.4 shows a chart for the various
forms ofmemories that are present in systems.
These are as follows:
(i) Internal RAM of 256 or 512 bytes in amicrocontroller for registers,temporary data and
stack.
(ii) Internal ROM/PROM/EPROM for about4 kB to 16 kB of program (in the case of
microcontrollers).
(iii) External RAM for the temporary dataand stack (in most systems).
(iv) Internal caches (in the case of certain microprocessors).
(v)EEPROM or flash (in many systems saving the results of processing in nonvolatile
memory: forexample, system status periodically and digital-camera images, songs, or
speeches after a suitableformat compression). (vi) External ROM or PROM for embedding
software (in almost all nonmicrocontroller-based systems).
(vii) RAM Memory buffers at the ports. (viii) Caches (in superscalar microprocessors).
Table 1.4 gives the functions assigned in the embedded systems to the memories. ROM or
PROM or EPROM embeds the embedded software specific to the system.
9.(i) Explain possible steps involved in build process of embedded control systems. (May
2017) (DEC 2016)
The assembler’s job is to translate symbolic assembly language statements into bit-level
representations of instructions known as object code. The assembler takes care of instruction
formats and does part of the job of translating labels into addresses. However, since the
program may be built from many files, the final steps in determining the addresses of
instructions and data are performed by the linker, which produces an executable binary file.
That file may not necessarily be located in the CPU’s memory, however, unless the linker
happens to create the executable directly in RAM. The program that brings the program into
memory for execution is called a loader.The simplest form of the assembler assumes that
the starting address of the assembly language program has been specified by the
programmer. The addresses in such a program are known as absolute addresses.
Assemblers
When translating assembly code into object code, the assembler must translate opcodes and
format the bits in each instruction, and translate labels into addresses. In this section, we
review the translation of assembly language into binary. Labels make the assembly process
more complex, but they are the most important abstraction provided by the assembler. Labels
let the programmer (a human programmer or a compiler generating assembly code) avoid
worrying about the locations of instructions and data. Label processing requires making
two passes through the assembly source code as follows:
1. The first pass scans the code to determine the address of each label.
2. The second pass assembles the instructions using the label values computed in the first
pass.
The name of each symbol and its address is stored in a symbol tablethat is built during the
first pass. The symbol table is built by scanning from the first instruction to thelast.
During scanning, the current location in memory is kept in a program location counter (PLC).
Despite the similarity in name to a program counter, the PLC is not used to execute the
program, only to assign memory locations to labels.
The simplest case is absolute addressing. In this case, one of the first statements in the
assembly language program is a pseudo-op that specifies the origin of the program, that is,
the location of the first address in the program. A common name for this pseudo-op (e.g., the
one used for the ARM) is the ORG statement.
ORG 2000
Which puts the start of the program at location 2000. This pseudo-op accomplishes this by
setting the PLC’s value to its argument’s value, 2000 in this case. Assemblers generally allow
a program to have many ORG statements in case instructions or data must be spread around
various spots in memory.
Linking
• Many assembly language programs are written as several smaller pieces rather than as a
single large file. Breaking a large program into smaller files helps delineate program
modularity. If the program uses library routines, those will already be preassembled, and
assembly language source code for the libraries may not be available for purchase.
9.(ii) Discuss about the structural units in embedded processor and how a processor is
selected for an embedded application. (MAY 2016) (DEC 2016)
Structural units in Embedded Processor:
Processors is an important unit of an Embedded System
Processors in an Embedded System:
Processors has two essential units:
1. Program Flow Control Unit (CU) – Fetch Unit for fetching instruction.
2. Execution unit (EU) – data transfer operation and data conversion.
EU includes the ALU and also the circuit that executes instruction for program
control task, halt, interrupt,jump instruction.
Performance considerations
The first and foremost consideration in selecting the processor is its performance. The per-
formance speed of a processor is dependent primarily on its architecture and its silicon
design. Evolution of fabrication techniques helped packing more transistors in same area
there by reducing the propagation delay. Also presence of cache reduces instruction/data
fetch timing. Pipelining and super-scalar architectures further improves the performance of
the processor. Branch prediction, speculative execution etc are some other techniques used
for improving the execution rate. Multi-cores are the new direction in improving the perform-
ance.
Rather than simply stating the clock frequency of the processor which has limited signific-
ance to its processing power, it makes more sense to describe the capability in a standard
notation. MIPS (Million Instructions Per Second) or MIPS/MHz was an earlier notation fol-
lowed by Dhrystones and latest EEMBC’s CoreMark. CoreMark is one of the best ways to
compare the performance of various processors.
Processor architectures with support for extra instruction can help improving performance for
specific applications. For example, SIMD (Single Instruction/Multiple Data) set and Jazelle –
Java acceleration can help in improving multimedia and JVM execution speeds.
So size of cache, processor architecture, instruction set etc has to be taken in to account when
comparing the performance.
Power Considerations
Increasing the logic density and clock speed has adverse impact on power requirement of the
processor. A higher clock implies faster charge and discharge cycles leading to more power
consumption. More logic leads to higher power density there by making the heat dissipation
difficult. Further with more emphasis on greener technologies and many systems becoming
battery operated, it is important the design is for optimal power usage.
Techniques like frequency scaling – reducing the clock frequency of the processor depending
on the load, voltage scaling – varying the voltage based on load can help in achieving lower
power usage. Further asymmetric multiprocessors, under near idle conditions, can effectively
power off the more powerful core and load the less powerful core for performing the tasks.
SoC comes with advanced power gating techniques that can shut down clocks and power to
unused modules.
Peripheral Set
Every system design needs, apart from the processor, many other peripherals for input and
output operations. Since in an embedded system, almost all the processors used are SoCs, it
is better if the necessary peripherals are available in the chip itself. This offers various bene-
fits compared to peripherals in external IC’s such as optimal power architecture, effective
data communication using DMA, lower BoM etc. So it is important to have peripheral set in
consideration when selecting the processor.
Operating Voltages
Each and every processor will have its own operating voltage condition. The operating
voltage maximum and minimum ratings will be provided in the respective data sheet or user
manual.
While higher end processors typically operate with 2 to 5 voltages including 1.8V for
Cores/Analogue domains, 3.3V for IO lines, needs specialized PMIC devices, it is a deciding
factor in low end micro-controllers based on the input voltage. For example it is cheaper to
work with a 5V micro-controller when the input supply is 5V and a 3.3 micro-controllers
when operated with Li-on batteries.
Specialized Processing
Apart from the core, presence of various co-processors and specialized processing units can
help achieving necessary processing performance. Co-processors execute the instructions
fetched by the primary processor thereby reducing the load on the primary. Some of the pop-
ular co-processors include
Floating Point Co-processor:
RISC cores supports primarily integer only instruction set. Hence presence of a FP co-pro-
cessor can be very helpful in application involving complex mathematical operations includ-
ing multimedia, imaging, codecs, signal processing etc.
Graphic Processing Unit:
GPU(Graphic Processing Unit) also called as Visual processing unit is responsible for draw-
ing images on the frame buffer memory to be displayed. Since human visual perception
needed at-least 16 Frames per second for a smooth viewing, drawing for HD displays in-
volves a lot of data bandwidth. Also with increasing graphic requirements such as textures,
lighting shaders etc, GPU’s have become a mandatory requirements for mobile phones, gam-
ing consoles etc.
Various GPU’s like ARM’s MALI, PowerVX, OpenGL etc are increasing available in higher
end processors. Choosing the right co-processor can enable smooth design of the embedded
application.
Price
Various considerations discussed above can be taken in to account when a processor is being
selected for an embedded design. It is better to have some extra buffer in processing capacit-
ies to enable enhancements in functionality without going for a major change in the design.
While engineers (especially software/firmware engineers) will want to have all the function-
alities, price will be the determining factor when designing the system and choosing the right
processor.
10. With a neat diagram, explain the working of Direct Access(DMA) and mention the
memory management methods.(MAY 2016) (MAY 2015) (DEC 2014) (DEC 2016)
A DMA controller is a device, usually peripheral to a CPU that is programmed to
perform a sequence of data transfers on behalf of the CPU. A DMA controller can directly
St. Joseph’s College of Engineering 22
EE8691-Embedded Systems Department of EIE 2021-2022
access memory and is used to transfer data from one memory location to another, or from an
I/O device to memory and vice versa. A DMA controller manages several DMA channels,
each of which can be programmed to perform a sequence of these DMA transfers. Devices,
usually I/O peripherals, that acquire data that must be read (or devices that must output data
and be written to) signal the DMA controller to perform a DMA transfer by asserting a
hardware DMA request (DRQ) signal. A DMA request signal for each channel is routed to
the DMA controller. This signal is monitored and responded to in much the same way that a
processor handles interrupts. When the DMA controller sees a DMA request, it responds by
performing one or many data transfers from that I/O device into system memory or vice
versa. Channels must be enabled by the processor for the DMA controller to respond to DMA
requests. The number of transfers performed, transfer modes used, and memory locations
accessed depends on how the DMA channel is programmed. A DMA controller typically
shares the system memory and I/O bus with the CPU and has both bus master and slave
capability. Fig.16.1 shows the DMA controller architecture and how the DMA controller
interacts with the CPU. In bus master mode, the DMA controller acquires the system bus
(address, data, and control lines) from the CPU to perform the DMA transfers. Because the
CPU releases the system bus for the duration of the transfer, the process is sometimes
referred to as cycle stealing.
In bus slave mode, the DMA controller is accessed by the CPU, which programs the
DMA controller's internal registers to set up DMA transfers. The internal registers consist of
source and destination address registers and transfer count registers for each DMA channel,
as well as control and status registers for initiating, monitoring, and sustaining the operation
of the DMA controller.
Memory allocation
When a process is created, the memory manager allocates the memory addresses
(blocks) to it by mapping the processaddress space.
Threads of a process share the memory space of the process
Memory Management after Initial Allocation
St. Joseph’s College of Engineering 23
EE8691-Embedded Systems Department of EIE 2021-2022
Memory manager of the OS─ secure, robust and well protected.
No memory leaks and stack overflows
Memory leaks means attempts to write in the memory block not allocated to a process
or data structure.
Stack overflow means that the stack exceeding the allocated memory block(s)
Memory Managing Strategy for a system
Fixed-blocks allocation
Dynamic -blocks Allocation
Dynamic Page-Allocation
Dynamic Data memory Allocation
Memory Managing Strategy for a system
Dynamic address-relocation
Multiprocessor Memory Allocation
Memory Protection to OS functions
Memory allocation in RTOSes
RTOS may disable the support to the dynamic block allocation, MMU support to dynamic
page allocation and dynamic binding as this increases the latency of servicing the tasks and
ISRs.
RTOS may not support to memory protection of the OS functions, as this increases the
latency of servicing the tasks and ISRs. User functions are then can run in kernel space and
run like kernel functions
RTOS may provide for disabling of the support to memory protection among the tasks as this
increases the memory requirement for each task
11.Discuss about
i) in-circuit emulator & Watch dog Timer (May 2017) (May 2018)
ii) Target Debugging.
IN CIRCUIT EMULATOR
Embedded systems tend to lack a display, keyboard, and mouse with which to manipulate the
microcontroller that you’re trying to program. So a host computer is used for this function,
and typically communicates over a serial cable or more recently, Wi-Fi.
Once you create, edit, and compile code for your embedded system on a host computer, you
will have executable (object) code that needs to be uploaded to the microcontroller in your
embedded system. There, you can see the code in action, test it, and debug the code by
making changes to the code on the host, recompiling, and running it again on the target
MCU. But what if you want to alter the contents of a register, memory, or the state of your
I/O to see what happens? An In-circuit emulator (ICE) is a debugging tool that allows you to
St. Joseph’s College of Engineering 24
EE8691-Embedded Systems Department of EIE 2021-2022
access a target MCU for in-depth debugging. A genuine ICE requires you to remove the
microcontroller and to insert the ICE in its place, most commonly using an adapter. In-circuit
emulation is rather rare in these days of high-performance, relatively low-cost processors
because ICE needs to be invisible to the system, which is difficult to do with extremely fast,
memory-intensive chips. Nevertheless, not every system requires a high-performance MCU,
and it’s still possible to use ICE. ICE is the best tool for finding difficult bugs and can
provide invaluable insight.
ICE consists of a hardware board with accompanying software for the host computer.
The ICE is physically connected between the host computer and the target MCU. The
debugger on the host establishes a connection to the MCU via the ICE. ICE allows a
developer to see data and signals that are internal to the MCU, and to step through the source
code (e.g., C/C++ on the host) or set breakpoints; the immediate ramifications of executed
software are observed during run time. Since the debugging is done via hardware, not
software, the MCU’s performance is left intact for the most part, and ICE does not
compromise MCU resources. This type of debugging is also referred to as source-level or
run-time debugging, except ICE is as close to the real scenario as possible, as it’s not a
simulation but a substitution of the target MCU with an emulation, or accurate mirror, of the
target MCU in the ICE itself. The behavior of the MCU will be more accurately reflected in
ICE, and in real-time.
The disadvantage of ICE debugging is that the ICE hardware must be physically connected to
the MCU. As chips get smaller, adapters can help in connecting tiny surface mounted chips to
the ICE. Another disadvantage is that ICE devices come with a learning curve, especially if
there will be complex debugging functions, for example, flagging when a register holds a
specific value after a conditional branch is taken, etc. And last, disadvantage is that as high-
performance chips have come down in price, the accessibility for debugging with ICE has
faded to the point where ICE hardware has become rare for anyone who is not still using an
8051-era MCU. In-circuit emulators require fast connectivity and loads of memory, so lower
level MCUs (8-, -16-bit and MHz, not GHz) are more likely to have an ICE option available.
Furthermore, highly integrated chips may create fewer bugs versus off-chip, board-mounted
EEPROMS and interfaces.
The watchdog timer has a number of applications. One application in a mobile phone is that
the display is turned off in case no GUI interaction takes place with specified time. The
interval is usually set at 15, 20 , 25 , or 30 s in a mobile phone. This saves power.
Another application in a mobile phone is that if a given menu is not selected by a click within
a pre-set time interval, another menu can be presented or a beep can be generated to invite
user’s attention.
An application in a temperature controller is that if a controller takes no action to switch off
the current within the pre-set time, the current is switched off and a warning signal raised,
indicating controller failure. Failure to switch off current may cause a boiler in which water is
heated to burst.
• Example: checking the stack depth, number of buffers allocated and the state of me-
chanical components in the system before resetting the watchdog timer.
• A flag should be set at various points in the code indicating the successful completion
of that block of code.
• Before the timer is reset, all flags are checked, if all the flags have been set, the timer
can be retriggered for another interval.
• If not, the failure mode is recorded and the timer is allowed to time out.
Part B (C402.2)
1. i)Explain the features of RS232C and RS485 and give some differences between
them. (MAY2018)
RS-232 SERIAL INTERFACE
RS232 was first introduced in 1962, This is the most common type of serial interface, it was
the standard communication before the PS2 and USB become popular in the computer
industry, you connect a mouse, modem, and printer to RS-232 serial interface. RS232 only
allows for one transmitter and one receiver on each line. RS232 also use a Full-Duplex
transmission method. RS232 can transmit up to 1Mbps with maximum distance up to 50 ft.
RS-422 SERIAL INTERFACE
St. Joseph’s College of Engineering 28
EE8691-Embedded Systems Department of EIE 2021-2022
RS422 is an improved version of RS232, it uses twisted pair cable to reduce the noise, and it
uses signaling balancing to transmit data, so what is signal balanced – It uses a voltage-
difference between the two lines as an indication of the signal value, with this method the
data is able to transmit for longer distance with faster data rates, with RS422 the data can
transmit up to 10 Mpbs at 50 feet or 100 Kbps at 4000 feet. RS422 is capable of multi-drop
capability, it limits up to 10 slaves in the data line.
RS-422
RS-232
RS-485
Max Distance 50 feet at 19.2 4000 feet at 100 kbps 4000 feet at
kbps 100 kbps
RS-422
RS-232
RS-485
Max Data Rate 1 mbps for 50 10 mbps for 50 feet 10 mbps for
feet 50 feet
2. Explain in detail the function of any one serial communication protocol using I 2C bus.
(Dec 2017) (DEC 2014)
2
The I C Bus:
2
• TheI Cbus[Phi92]isawell-knownbuscommonlyusedtolinkmicrocontrollersinto
systems. IthasevenbeenusedforthecommandinterfaceinanMPEG-2 videochip[van97];whilea
separatebuswasusedforhigh-speedvideo data,setupinformation wastransmittedtotheon-
St. Joseph’s College of Engineering 30
EE8691-Embedded Systems Department of EIE 2021-2022
2
chipcontrollerthroughanI Cbusinterface.
2
•I Cisdesignedtobelowcost,easytoimplement,andofmoderatespeed(upto100KB/sfor
thestandardbusandupto400KB/sfortheextendedbus).Asaresult,itusesonlytwolines
theserialdataline(SDL)fordataandtheserialclockline(SCL), whichindicateswhenvalid data
2
areonthedataline.Figure4.6showsthestructureofatypicalI Cbussystem.
•
Every nodeinthenetworkisconnectedtobothSCLandSDL.Somenodesmaybeabletoact
asbusmastersandthebusmay havemorethanonemaster.Othernodesmay actasslavesthat
onlyrespondtorequests frommasters.
• The basic electrical interface to the bus is shown in Figure 4.7.Thebus does not define
particular voltagestobeusedforhighorlowsothateitherbipolarorMOScircuitscanbe
connectedtothebus.
•Bothbussignalsuseopencollector/opendraincircuits.1Apull-upresistorkeepsthedefault
stateofthesignalhigh,andtransistorsareusedineachbusdevicetopulldownthesignalwhen a0is
tobetransmitted.
• The
Opencollector/opendrainsignalingallowsseveraldevicestosimultaneouslywritethebus
withoutcausingelectricaldamage.The opencollector/opendraincircuitryallowsaslavedevice
tostretchaclocksignalduring areadfromaslave.Themasterisresponsibleforgeneratingthe SCL
clock,buttheslavecanstretchthelowperiodoftheclock(butnotthehighperiod)if necessary.
• TheI2Cinterfaceonamicrocontrollercanbeimplementedwithvaryingpercentagesofthe
functionalityinsoftware andhardware[Phi89]. AsillustratedinFigure4.8,atypicalsystem has
a1-bithardwareinterfacewithroutinesforbyte level functions.
2
• TheI Cdevicetakescareofgeneratingtheclockanddata.Theapplicationcodecallsroutines
tosendanaddress,sendadatabyte,andsoon,whichthengeneratestheSCL andSDL,
acknowledges,andsoforth.
I2C signaling
o Sender pulls down bus for 0.
o Sender listens to bus---if it tried to send a 1 and heard a 0, someone else is si-
multaneously transmitting.
o Transmissions occur in 8-bit bytes.
I C data link layer
2
•
Oneofthemicrocontroller’stimersistypicallyusedtocontrolthelengthofbitsonthebus.
Interruptsmaybeusedtorecognizebits.However,whenusedinmastermode,polledI/Omay
beacceptableifnootherpending taskscanbeperformed,sincemastersinitiatetheirown transfers.
3 i)Draw the CAN data frame format and explain the bus arbitration process in CAN
protocol.
The CAN data link layer comprises two protocols: Classical CAN introduced in 1986 and
implemented for the first time in 1988 and CAN FD launched in 2012 and internationally
standardized in 2015 in ISO 11898-1. For a transitional period there are also non-ISO
compliant implementations on the market. They are application-transparent, meaning they
can be used for software development and designing prototype networks. However, CiA
doesn’t recommend using them for serial production.
The two CAN data link layer protocols have some common features. Any node has the right
to request transmission rights at any time. The necessary bus arbitration method to avoid
transmission conflicts is the same: Frames with the highest assigned identifier get bus access
without delay. All frame types (data, remote, error, and overload frame) are transmitted in
broadcast. The data frame structure comprising several fields is the same.
One of the unique features of the CAN data link layers is that all single-bit errors are detec-
ted. Multi-bit errors are detected with a high probability. In order to provide data consistency
in all nodes, local errors are globalized. Additionally, the fault confinement implemented in
the CAN data link layers precludes a single node from corrupting the communication of the
others permanently.
(ii) Explain in detail about the I/O devices used in embedded systems. (MAY2018)
Input and Output Devices
Input and output devices allow the computer system to interact with the outside world by
moving data into and out of the system. An input device is used to bring data into the system.
Some input devices are:
Keyboard
Mouse
Microphone
Bar code reader
Graphics tablet
An output device is used to send data out of the system. Some output devices are:
Monitor
Printer
Speaker
Input/output devices are usually called I/O devices. They are directly connected to an
electronic module inside the systems unit called a device controller. For example, the
speakers of a multimedia computer system are directly connected to a device controller called
an audio card (such as a Soundblaster), which in turn is connected to the rest of the system.
Sometimes secondary memory devices like the hard disk are called I/O devices (because they
move data in and out of main memory.) What counts as an I/O device depends on context. To
a user, an I/O device is something outside of the system box. To a programmer, everything
outside of the processor and main memory looks like an I/O devices. To an engineer working
on the design of a processor, everything outside of the processor is an I/O device.
A computer that is dedicated to running a program that controls another device is
an embedded system. An embedded system is usually embedded inside the device it controls.
Usually they run just one program that is permanently kept in a special kind of main memory
called ROM (for Read Only Memory). More processor chips are sold per year for embedded
systems than for all other purposes.
4 Explain the CAN architecture with neat diagram. (Dec 2017) (Dec 2014)
TheControllerAreaNetwork(CAN)buswasdevelopedforautomotiveelectronics.Itprovides
megabitratesandcanhandlelargenumbersofdevices.
Ethernetandvariations ofstandardEthernetareusedforavarietyofcontrolapplications
CAN bus
First used in 1991. Serial bus, 1 Mb/sec up to 40 m. Synchronous bus.
Logic 0 dominates logic 1 on bus. Arbitrated with CSMA/AMP:
Arbitration on message priority.
CAN Controller
Controller implements physical and data link layers.
No network layer needed---bus provides end-to-end connections.
5. Give the advantages and disadvantages of using serial communication devices and
parallel communication devices. (MAY2018)
There are two ways to transfer data between computers: Serial Transmission and Parallel
Transmission.
Serial Transmission
Applications
Serial transmission occurs between two computers or from a computer to an external device
located some distance away. Parallel transmission can take place within a computer system,
through a computer bus or to an external device located a close distance away.
Examples
An example of serial mode transmission include connection between a computer and a
modem using the RS-232 protocol. An RS-232 cable can accommodate 25 wires, but only
two of these wires are for data transmission, the rest are for overhead control signaling. The
two data wires run on simple serial transmission in either direction.In this example, a
computer may be far from the modem, making parallel transmission very expensive. With
this, speed of transmission is considered less important compared to the economic advantage
of serial transmission.
An example of parallel mode transmission include connection between a computer and a
printer. Most printers are within 6 meters or 20 feet from the transmitting computer and the
slight cost for extra wires is offset by the added speed gained through parallel transmission of
data.
6. Explain about the Input/ Output Devices and uses of UART and HDLC and explain how
data is transferred using PCI/X. List the major features. (DEC 2014
7.i)Describe the various components of synchronous serial input and output ports.
(Nov/Dec-2013)
7. (ii) Explain the function of embedded processor architecture and I/O devices
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.)
Bus Protocols:
The basic building block of most bus protocols is the four-cycle handshake,
illustrated in Figure. 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.
1. Device 1 raises its output to signal an enquiry, which tells device 2 that it should get ready
to listen for data.
2. 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.
3. Once the data transfer is complete, device 2 lowers its output, signaling that it has
received the data.
4. 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.
8. Explain in detail about SPI communication protocol and its interfacing techniques.
(MAY 2016).
SPI is a common communication protocol used by many different modules. For example, SD
card modules, RFID card reader modules, and 2.4 GHz wireless transmitter/receivers all use
SPI to communicate with the microcontroller.One unique benefit of SPI is the fact that data
can be transferred without interruption. Any number of bits can be sent or received in
a continuous stream. With I2C and UART, data is sent in packets, limited to a specific
number of bits. Start and stop conditions define the beginning and end of each packet, so the
data is interrupted during transmission.
Devices communicating via SPI are in a master-slave relationship. The master is the
controlling device (usually a microcontroller), while the slave (usually a sensor, display, or
memory chip) takes instruction from the master. The simplest configuration of SPI is a single
master, single slave system, but one master can control more than one slave (more on this
below).
Data
Handshake
Ground
Other
Data
Handshake
Ground
10. Explain with all necessary sketches to enable intra communications among
peripherals using I2C bus.(May 2017) (DEC 2016)
TheI2CBus:
• TheI2Cbus[Phi92]isawell-knownbuscommonlyusedtolinkmicrocontrollersinto
systems. IthasevenbeenusedforthecommandinterfaceinanMPEG-2 videochip[van97];whilea
separatebuswasusedforhigh-speedvideo data,setupinformation wastransmittedtotheon-
chipcontrollerthroughanI2Cbusinterface.
•I2Cisdesignedtobelowcost,easytoimplement,andofmoderatespeed(upto100KB/sfor
thestandardbusandupto400KB/sfortheextendedbus).Asaresult,itusesonlytwolines
theserialdataline(SDL)fordataandtheserialclockline(SCL), whichindicateswhenvalid data
areonthedataline.Figure4.6showsthestructureofatypicalI2Cbussystem.
•
Every nodeinthenetworkisconnectedtobothSCLandSDL.Somenodesmaybeabletoact
asbusmastersandthebusmay havemorethanonemaster.Othernodesmay actasslavesthat
onlyrespondtorequests frommasters.
•
TheOpencollector/opendrainsignalingallowsseveraldevicestosimultaneouslywritethebus
withoutcausingelectricaldamage.Theopencollector/opendraincircuitryallowsaslavedevice
tostretchaclocksignalduring areadfromaslave.Themasterisresponsibleforgeneratingthe SCL
clock,buttheslavecanstretchthelowperiodoftheclock(butnotthehighperiod)if necessary.
• TheI2Cinterfaceonamicrocontrollercanbeimplementedwithvaryingpercentagesofthe
functionalityinsoftware andhardware[Phi89]. AsillustratedinFigure4.8,atypicalsystem
has a1-bithardwareinterfacewithroutinesforbyte level functions.
• TheI2Cdevicetakescareofgeneratingtheclockanddata.Theapplicationcodecallsroutines
tosendanaddress,sendadatabyte,andsoon,whichthengeneratestheSCL andSDL,
acknowledges,andsoforth.
I2C signaling
o Sender pulls down bus for 0.
o Sender listens to bus---if it tried to send a 1 and heard a 0, someone else is
simultaneously transmitting.
o Transmissions occur in 8-bit bytes.
I2C data link layer
o Every device has an address (7 bits in standard, 10 bits in extension).
o Bit 8 of address signals read or write.
o General call address allows broadcast.
I C bus arbitration
2
UNIT – III
EMBEDDED FIRMWARE DEVELOPMENT ENVIRONMENT
PART B(C402.3)
1. Illustrate with functional description about the different phases of Embedded
Design Life Cycle model. (MAY 2016) (May 2017) (DEC 2016) (Dec 2017)
(i)EDLC is an Analysis-Design-Implementation based problem solving approach for the
product development. Analysis – What product need to be developed Design – Good
approach for building it Implementation – To develop it EDLC is an Analysis-Design-
Implementation based problem solving approach for the product development. Analysis
– What product need to be developed Design – Good approach for building it
Implementation – To develop it
(ii) Essential in understanding the scope and complexities involved in anyEmbedded
product development. Defines interaction and activities among Various groups of
product development sector. Project management , System design and development ,
System testing , Release management and quality assurance
(iii) Aim of any product development is the Marginal benefit Marginal benefit =
Return on investment Product needs to be acceptable by the end user i.e. it has to meet
the requirements of the end user in terms of quality, reliability & functionality. EDLC
helps in ensuring all these requirements by following three objective Ensuring that high
quality products are delivered to user Risk minimization and defect prevention in product
development through project management Maximize productivity
6. The primary definition of quality in any embedded product development is return on
investment achieved by the product. In order to survive in market, quality is very
important factor to be taken care of while developing the product. Qualitative attributes
depends on the budget of the product so budget allocation is very important. Budget
allocation might have done after studying the market, trends & requirements of product,
competition .etc.
7. Project management (PM) Adds an extra cost on budget But essential for ensuring the
development process is going in right direction Projects in EDLC requires Loose project
management or tight project management. PM is required for Predictability Analyze the
time to finish the product (PDS = no of person days ) Co-ordination Resources
(developers) needed to do the job Risk management. Backup of resources to overcome
critical situation . Ensuring defective product is not developed
8. Measure of efficiency as well as ROI Different ways to improve the productivity are
Saving the manpower X members – X period X/2 members – X period Use of automated
tools where ever is required Re-usable effort – work which has been done for the
previous product can be used if similarities present b/w previous and present product. Use
of resources with specific set of skills which exactly matches the requirements of the
product, which reduces the time in training the resource
9. A life cycle of product development is commonly referred as the “model” A simple
model contains fivephases Requirement analysis Design Development and test
Deployment and maintenance The no of phases involved in EDLC model depends on the
complexity of the product Classic Embedded product development life cycle model
10. NEED: Any embedded product may evolves as an output of a need. Need may come
from an individual/from public/from company(generally speaking from an end
user/client) ,New/custom product development , Product re-engineering , Product
maintenance CONCEPTUALIZATION:
Design flows
A design flow is a sequence of steps to be followed during a design
Design flow: sequence of steps in a design methodology.
May be partially or fully automated.
Use tools to transform, verify design.
Design flow is one component of methodology. Methodology also includes management
organization, etc.
Waterfall Model
The waterfall development model consists of five major phases: requirements analysis
determines the basic characteristics of the system; architecture design decomposes the
functionality into major components; coding implements the pieces and integrates them;
testing uncovers bugs; and maintenance entails deployment in the field, bug fixes, and
upgrades. The waterfall model gets its name from the largely one-way flow of work and
information from higher levels of abstraction to more detailed design steps. Although top-
down design is ideal because it implies good foreknowledge of the implementation during
early design phases, most designs are clearly not quite so top down. Most design projects
entail experimentation and changes that require bottom-up feedback. As a result, the
waterfall model is today cited as an unrealistic design process.
Spiral model
As design progresses, more complex systems will be constructed. At each level of design,
the designers go through requirements, construction, and testing phases. At later stages
when more complete versions of the system are constructed, each phase requires more
work, widening the design spiral. This successive refinement approach helps the
designers understand the system they are working on through a series of design cycles.
The first cycles at the top of the spiral are very small and short, while the final cycles at
the spiral’s bottom add detail learned from the earlier cycles of the spiral. The spiral
model is more realistic than the waterfall model because multiple iterations are often
necessary to add enough detail to complete a design. However, a spiral methodology with
too many spirals may take too long when design time is a major requirement.
Embedded computing systems often involve the design of hardware as well as software.
Even if you aren’t designing a board, you may be selecting boards and plugging together
multiple hardware components as well as writing code. Front-end activities such as
specification and architecture simultaneously consider hardware and software aspects.
Similarly, back-end integration and testing consider the entire system. In the middle,
however, development of hardware and software components can go on relatively
independently— while testing of one will require stubs of the other, most of the hardware
and software work can proceed relatively independently.
ii) Iterative or Fountain Model.
It follows analysis, design and implementation. Evaluate the product and cycle back
trough and conduct analysis, design and repeat the cycle.
It is a cascade of series of linear models. Here, requirements are known at the begin-
ning and are derived into groups.
Advantages
Provides good development cycle feedback at each function/ feature implementation
and data can be used as reference for similar product development in future.
St. Joseph’s College of Engineering 48
EE8691-Embedded Systems Department of EIE 2021-2022
More responsive to changing user needs.
Provides a working model with minimum features at first cycle itself.
Less manufacturing risk.
Product development can be stopped at any stage.
Drawbacks
Extensive review requirement impact on operations due to new releases.
Training for each new deployment.
Compilation begins with high-level language code such as C and generally produces
assembly code. (Directly producing object code simply duplicates the functions of an
assembler which is a very desirable stand-alone program to have.)
The high-level language program is parsed to break it into statements and expressions. In
addition, a symbol table is generated, which includes all the named objects in the
program. Some compilers may then perform higher-level optimizations that can be
viewed as modifying the high-level language program input without reference to
instructions.
Simplifying arithmetic expressions is one example of a machine-independent
optimization. Not all compilers do such optimizations, and compilers can vary widely
regarding which combinations of machine-independent optimizations they do perform.
Instruction-level optimizations are aimed at generating code. They may work directly on
real instructions or on a pseudo-instruction format that is later mapped onto the
instructions of the target CPU. This level of optimization also helps modularize the
compiler by allowing code generation to create simpler code that is later optimized. For
example, consider the following array access code:
x[i] = c*x[i];
A simple code generator would generate the address for x[i] twice, once for each
appearance in the statement. The later optimization phases can recognize this as an
example of common expressions that need not be duplicated. While in this simple case
it would be
possible to create a code generator that never generated the redundant expression, taking
into account every such optimization at code generation time is very difficult. We get
better code
and more reliable compilers by generating simple code first and then optimizing it.
11(i) Write detailed notes on software and hardware interface techniques. (May 2017)
The Hardware/Software Codesign Overview module is intended to introduce
the hardware/software codesign to the practicing design, software, and systems
engineers, . The module provides key codesign concepts and attempts to show the
benefits of the codesign approach over the current design process.
The module consists of five sections. The topic is introduced by defining codesign,
illustrating its usefulness, and introducing example systems that require this new
methodology. the components that make up an ideal codesign environment.
The second describes the unified representation for hardware and software that is one of
the components for an ideal codesign environment.
The third section describes techniques used to partition a system into hardware and
software components. An automated partitioning algorithm is the ideal way to go, but this
(ii) Explain about sequential program model for the development of embedded
platform.(May2017)
*Despite benefits of state machine model, most popular development tools use
sequential programming language C, C++, Java, Ada, VHDL, Verilog, etc.
*Development tools are complex and expensive, therefore not easy to adapt or replace
Must protect investment
*Two approaches to capturing state machine model with sequential programming
language
*Front-end tool approach, Additional tool installed to support state machine language
Graphical and/or textual state machine languages
*May support graphical simulation
*Automatically generate code in sequential programming language that is input to main
development tool
*Drawback: must support additional tool (licensing costs, upgrades, training,
etc.),Language subset approach
*Most common approach...
Follow rules (template) for capturing state machine constructs in equivalent sequential
language constructs
Used with software (e.g.,C) and hardware languages (e.g.,VHDL) ,Capturing UnitControl
state machine in C,Enumerate all states (#define)
*Declare state variable initialized to initial state (IDLE) Single switch statement branches
to current state’s case.Each case has actions up, down, open, timer_start
*Each case checks transition conditions to determine next state
if(…) {state = …;}
UNIT–IV
RTOS BASED EMBEDDED SYSTEM DESIGN
PART B(C402.4)
1. Explain in detail the features and scheduling algorithm used in RTOS of μC/OS-II.
(May 2017)
RTOS
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. The example we discussed in the beginning of this article is an example of
catastrophic affect of an RTOS missing a deadline.
As discussed above that the embedded systems are becoming 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.
Classification of RTOS
RTOS can be classified into three types :
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
discussed in the beginning of this article is example of a hard RTOS as missing a deadline
there could cause a life.
Cyclostatic scheduling.
Round-robin scheduling.
But unlike cyclostatic scheduling, if a process does not have any useful
work to do, the round-robin scheduler moves on to the next process in
order to fill the time slot with useful work.
In this example, all three processes execute during the first hyper period,
but during the second one, P1 has no useful work and is skipped.
The processes are always evaluated in the same order. The last time slot in
the hyper period is left empty; if we have occasional, non-periodic tasks
without deadlines.
Round-robin scheduling is often used in hardware such as buses because it
is very simple to implement but it provides some amount of flexibility.
In addition to utilization, we must also consider scheduling overhead—
the execution time required to choose the next execution process, which is
incurred in addition to any context switching overhead
In general, the more sophisticated the scheduling policy, the more CPU
time it takes during system operation to implement it.
Moreover, we generally achieve higher theoretical CPU utilization by
applying more complex scheduling policies with higher overheads.
The final decision on a scheduling policy must take into account both
theoretical utilization and practical scheduling overhead.
4. Explain in detail about task, process and threads in RTOS based embedded system
design.
Many (if not most) embedded computing systems do more than one thing
that is, the environment can cause mode changes that in turn cause the
embedded system to behave quite differently.
For example, when designing a telephone answering machine, We can
define recording a phone call and operating the user’s control panel as
distinct tasks, because they perform logically distinct operations and they
must be performed at very different rates.
These different tasks are part of the system’s functionality, but that
application-level organization of functionality is often reflected in the
structure of the program as well.
A process is a single execution of a program. If we run the same program
two different times, we have created two different processes. Each process
has its own state that includes not only its registers but all of its memory.
VxWorks:
VxWorks is a real-time operating system (RTOS) developed as proprietary
software by Wind River Systems, an Intel subsidiary of Alameda, California, US. First
released in 1987, VxWorks is designed for use in embedded systems requiring real-time,
deterministic performance and, in many cases, safety and security certification, for industries,
such as aerospace and defense, medical devices, industrial equipment, robotics, energy,
transportation, network infrastructure, automotive, and consumer electronics.
VxWorks supports Intel architecture, POWER architecture, and ARM architectures. The
RTOS can be used in multicore asymmetric multiprocessing (AMP), symmetric
multiprocessing (SMP), and mixed modes] and multi-OS (via Type 1 hypervisor) designs
on 32- and 64-bit processors.
VxWorks comes with the kernel, middleware, board support packages, Wind River
Workbench development suite and complementary third-party software and hardware
technologies. In its latest release, VxWorks 7, the RTOS has been re-engineered for
modularity and upgradeability so the OS kernel is separate from middleware, applications
and other packages. Scalability, security, safety, connectivity, and graphics have been
improved to address Internet of Things (IoT) needs.
VxWorks supports Intel architecture, Power architecture, and ARM architectures. The RTOS
can be used in multi-core asymmetric multiprocessing (AMP), symmetric
multiprocessing (SMP), and mixed modes and multi-OS (via Type 1 hypervisor) designs on
32- and 64-bit processors.
The VxWorks consists of a set of runtime components and development tools. The run time
components are an operating system (UP and SMP; 32- and 64-bit), software for applications
support (file system, core network stack, USB stack and inter-process communications) and
hardware support (architecture adapter, processor support library, device driver library and
board support packages). VxWorks core development tools are compilers such as Diab,
GNU, and Intel C++ Compiler (ICC)) and its build and configuration tools. The system also
includes productivity tools such as its Workbench development suite and Intel tools and
development support tools for asset tracking and host support.
The platform is a modular, vendor-neutral, open system that supports a range of third-party
software and hardware. The OS kernel is separate from middleware, applications and other
packages, which enables easier bug fixes and testing of new features. An implementation of a
layered source build system allows multiple versions of any stack to be installed at the same
time so developers can select which version of any feature set should go into the VxWorks
kernel libraries.
Optional advanced technology for VxWorks provides add-on technology-related capabilities,
such as:
Advanced security features to safeguard devices and data residing in and traveling
across the Internet of Things (IoT)
St. Joseph’s College of Engineering 64
EE8691-Embedded Systems Department of EIE 2021-2022
Advanced safety partitioning to enable reliable application consolidation
Real-time advanced visual edge analytics allowing autonomous responses on Vx-
Works-based devices in real time without latency
Optimized embedded Java runtime engine enabling the deployment of Java applica-
tions
Virtualization capability with a real-time embedded, Type 1 hypervisor
Multitasking kernel with preemptive and round-robin scheduling and fast interrupt re-
sponse
Native 64-bit operating system (only one 64-bit architecture supported: x86-64). Data
model: LP64.
User-mode applications ("Real-Time Processes", or RTP) isolated from other user-
mode applications as well as the kernel via memory protection mechanisms.
SMP, AMP and mixed mode multiprocessing support
Error handling framework
Bluetooth, USB, CAN protocols, Firewire IEEE 1394, BLE, L2CAP, Continua stack,
health device profile
Binary, counting, and mutual exclusion semaphores with priority inheritance
Local and distributed message queues
POSIX PSE52 certified conformity in user-mode execution environment
File systems: High Reliability File System (HRFS), FAT-based file system
(DOSFS), Network File System (NFS), and TFFS
Dual-mode IPv6 networking stack with IPv6 Ready Logo certification
Memory protection including real-time processes (RTPs), error detection and report-
ing, and IPC
Multi-OS messaging using TIPC and Wind River multi-OS IPC
Symbolic debugging
In March 2014, Wind River introduced VxWorks 7, which emphasizes scalability, security,
safety, connectivity, graphics, and virtualization. The following lists some of the release 7
updates. More information can be found on the Wind Rivers VxWorks website.
Modular, componentized architecture using a layered build system with the ability to
update each layer of code independently
VxWorks microkernel (a full RTOS that can be as small as 20 KB)
Security features such as digitally-signed modules (X.509), encryption, password
management, ability to add/delete users at runtime
SHA-256 hashing algorithm as the default password hashing algorithm
Human machine interface with Vector Graphics, and Tilcon user interface (UI)
Graphical user interface (GUI): OpenVG stack, Open GL, Tilcon UI, Frame Buffer
Driver, EV Dev Interface
Updated configuration interfaces for VxWorks Source Build VSB projects and Vx-
Works Image Projects
Single authentication control used for Telnet, SSH, FTP, and rlogin daemons
Connectivity with Bluetooth and SocketCAN protocol stacks
Inclusion of MIPC File System (MFS) and MIPC Network Device (MND)
Networking features with 64-bit support including Wind River MACsec, Wind
River’s implementation of IEEE 802.1A, Point-to-Point Protocol (PPP) over L2TP, PPP
over virtual local area network (VLAN) and Diameter secure key storage
New Wind River Workbench 4 for VxWorks 7 integrated development environment
with new system analysis tools
Wind River Diab Compiler 5.9.4; Wind River GNU Compiler 4.8; Intel C++ Com-
piler 14 and Intel Integrated Performance Primitives (IPP) 8
St. Joseph’s College of Engineering 65
EE8691-Embedded Systems Department of EIE 2021-2022
RTLinux
RTLinux is a hard realtime RTOS microkernel that runs the entire Linux operating system as
a fully preemptiveprocess. The hard real-time property makes it possible to control robots,
data acquisition systems, manufacturing plants, and other time-sensitive instruments and
machines from RTLinux applications. Even with a similar name it is not related the "Real-
Time Linux" project of the Linux Foundation.
RTLinux was developed by Victor Yodaiken, Michael Barabanov, CortDougan and others at
the New Mexico Institute of Mining and Technology and then as a commercial product
at FSMLabs. Wind River Systems acquired FSMLabs embedded technology in February
2007 and made a version available as Wind River Real-Time Core for Wind River Linux. As
of August 2011, Wind River has discontinued the Wind River Real-Time Core product line,
effectively ending commercial support for the RTLinux product. RTLinux provides the
capability of running special real-time tasks and interrupt handlers on the same machine as
standard Linux. These tasks and handlers execute when they need to execute no matter what
Linux is doing. The worst case time between the moment a hardware interrupt is detected by
the processor and the moment an interrupt handler starts to execute is under 15 microseconds
on RTLinux running on a generic x86 (circa 2000). A RTLinux periodic task runs within 35
microseconds of its scheduled time on the same hardware. These times are hardware limited,
and as hardware improves RTLinux will also improve. Standard Linux has excellent average
performance and can even provide millisecond level scheduling precision for tasks using the
POSIX soft real-time capabilities. Standard Linux is not, however, designed to provide sub-
millisecond precision and reliable timing guarantees. RTLinux was based on a lightweight
virtual machine where the Linux "guest" was given a virtualized interrupt controller and
timer, and all other hardware access was direct. From the point of view of the real-time
"host", the Linux kernel is a thread. Interrupts needed for deterministic processing are
processed by the real-time core, while other interrupts are forwarded to Linux, which runs at
a lower priority than real-time threads. Linux drivers handled almost all I/O. First-In-First-
Out pipes (FIFOs) or shared memory can be used to share data between the operating system
and RTLinux.
The majority of RTLinux functionality is in a collection of loadable kernel modules that
provide optional services and levels of abstraction. These modules include:
1. rtlsched - a priority scheduler that supports both a "lite POSIX" interface described
below and the original V1 RTLinux API.
2. rtl time - which controls the processor clocks and exports an abstract interface for
connecting handlers to clocks.
3. rtlposixio - supports POSIX style read/write/open interface to device drivers.
4. rtlfifo - connects RT tasks and interrupt handlers to Linux processes through a device
layer so that Linux processes can read/write to RT components.
5. semaphore - a contributed package by Jerry Epplin which gives RT tasks blocking
semaphores.
6. POSIX mutex support is planned to be available in the next minor version update of
RTLinux.
7. mbuff is a contributed package written by Tomasz Motylewski for providing shared
memory between RT components and Linux processes.
RTLinuxrealtime tasks get implemented as kernel modules similar to the type of module that
Linux uses for drivers, file systems, and so on. Realtime tasks have direct access to the
hardware and do not use virtual memory. On initialization, a realtime task (module) informs
the RTLinux kernel of its deadline, period, and release-time constraints.
The key RTLinux design objective is that the system should be transparent, modular, and
extensible. Transparency means that there are no unopenable black boxes and the cost of any
operation should be determinable. Modularity means that it is possible to omit functionality
St. Joseph’s College of Engineering 66
EE8691-Embedded Systems Department of EIE 2021-2022
and the expense of that functionality if it is not needed. And extensibility means that
programmers should be able to add modules and tailor the system to their requirements. The
base RTLinux system supports high speed interrupt handling and no more. It has simple
priority scheduler that can be easily replaced by schedulers more suited to the needs of some
specific application. When developing RTLinux, it was designed to maximize the advantage
we get from having Linux and its powerful capabilities available. RTLinux is structured as a
small core component and a set of optional components. The core component permits
installation of very low latency interrupt handlers that cannot be delayed or preempted by
Linux itself and some low level synchronization and interrupt control routines. This core
component has been extended to support SMP and at the same time it has been simplified by
removing some functionality that can be provided outside the core.
µC/OS-II
Micro-Controller Operating Systems (MicroC/OS, stylized as µC/OS) is a real-time
operating system (RTOS) designed by embedded software developer, Jean J. Labrosse in
1991. It is a priority-based preemptive real-time kernel for microprocessors, written mostly in
the programming language C. It is intended for use in embedded systems.
MicroC/OS allows defining several functions in C, each of which can execute as an
independent thread or task. Each task runs at a different priority, and runs as if it owns
the central processing unit (CPU). Lower priority tasks can be preempted by higher priority
tasks at any time. Higher priority tasks use operating system (OS) services (such as a delay or
event) to allow lower priority tasks to execute. OS services are provided for managing tasks
and memory, communicating between tasks, and timing.
Based on the source code written for µC/OS, and introduced as a commercial product in 1998, µC/
OS-II is a portable, ROM-able, scalable, preemptive, real-time, deterministic, multitasking ker-
nel for microprocessors, and digital signal processors (DSPs). It manages up to 255 application tasks.
Its size can be scaled (between 5 and 24 Kbytes) to only contain the features needed for a given use.
Most of µC/OS-II is written in highly portable ANSI C, with target microprocessor-specific code
written in assembly language. Use of the latter is minimized to ease porting to other processors.
Uses in embedded systems
µC/OS-II was designed for embedded uses. If the producer has the proper tool chain (i.e., C compiler,
assembler, and linker-locator), µC/OS-II can be embedded as part of a product.
µC/OS-II is used in many embedded systems, including:
Avionics
Medical equipment and devices
Data communications equipment
White goods (appliances)
Mobile phones, personal digital assistants (PDAs), MIDs
Industrial controls
Consumer electronics
Automotive
Task states
µC/OS-II is a multitasking operating system. Each task is an infinite loop and can be in any one of the
following five states.
Dormant
Ready
Running
Waiting (for an event)
Interrupted (interrupt service routine (ISR))
Task feature
Task creation
Task stack & stack checking
Task deletion
Change a task’s priority
Suspend and resume a task
Get information about a task
Task States:
(i) Idle state [Not attached or not registered]
(ii) Ready State [Attached or registered]
(iii) Running state
(iv) Blocked (waiting) state
(v) Delayed for a preset period - Number of possible states depends on the RTOS.
Advanced security features to safeguard devices and data residing in and traveling
across the Internet of Things (IoT)
Advanced safety partitioning to enable reliable application consolidation
Real-time advanced visual edge analytics allowing autonomous responses on Vx-
Works-based devices in real time without latency
Optimized embedded Java runtime engine enabling the deployment of Java applica-
tions
Virtualization capability with a real-time embedded, Type 1 hypervisor
12. Discuss about inter process communication and context switching in detail.
(Dec16) (May 2017).
Intertask or interprocess communication in µC/OS-II occurs via: semaphores, message mailbox, mes-
sage queues, tasks, and interrupt service routines (ISRs). They can interact with each other when a
task or an ISR signals a task through a kernel object called an event control block (ECB). The signal
is considered to be an event.
MicroC/OS-III
µC/OS-III is the acronym for Micro-Controller Operating Systems Version 3, introduced in 2009 and
adding functionality to the µC/OS-II RTOS.
St. Joseph’s College of Engineering 72
EE8691-Embedded Systems Department of EIE 2021-2022
µC/OS-III offers all of the features and functions of µC/OS-II. The biggest difference is the number of
supported tasks. µC/OS-II allows only 1 task at each of 255 priority levels, for a maximum of 255
tasks. µC/OS-III allows any number of application tasks, priority levels, and tasks per level, limited
only by processor access to memory.
µC/OS-II and µC/OS-III are currently maintained by Micrium, Inc., a subsidiary of Silicon Labs, and
can be licensed per product or per product line.
Uses in embedded systems
The uses are the same as for µC/OS-II
Task states
µC/OS-III is a multitasking operating system. Each task is an infinite loop and can be in any one of
five states (dormant, ready, running, interrupted, or pending). Task priorities can range from 0
(highest priority) to a maximum of 255 (lowest possible priority).
Round robin scheduling
When two or more tasks have the same priority, the kernel allows one task to run for a predetermined
amount of time, named a quantum, and then selects another task. This process is termed round robin
scheduling or time slicing. The kernel gives control to the next task in line if:
13. Explain Task, Process and Thread with their types and examples. (DEC 2017)
Many (if not most) embedded computing systems do more than one thing that is, the
environment can cause mode changes that in turn cause the embedded system to behave
quite differently.
For example, when designing a telephone answering machine, We can define recording a
phone call and operating the user’s control panel as distinct tasks, because they perform
logically distinct operations and they must be performed at very different rates.
These different tasks are part of the system’s functionality, but that application-level
organization of functionality is often reflected in the structure of the program as well.
A process is a single execution of a program. If we run the same program two different
times, we have created two different processes. Each process has its own state that
includes not only its registers but all of its memory.
In some OSs, the memory management unit is used to keep each process in a separate
address space. In others, particularly lightweight RTOSs, the processes run in the same
address space. Processes that share the same address space are often called threads.
As shown in below figure this device is connected to serial ports on both ends. The input
to the box is an uncompressed stream of bytes.
The box emits a compressed string of bits on the output serial line, based on a predefined
compression table. Such a box may be used, for example, to compress data being sent to a
modem.
The program’s need to receive and send data at different rates for example, the program
may emit 2 bits for the first byte and then 7 bits for the second byte will obviously find
itself reflected in the structure of the code.
It is easy to create irregular, ungainly code to solve this problem; a more elegant solution
is to create a queue of output bits, with those bits being removed from the queue and sent
to the serial port in 8-bit sets.
In simple words, "the task with the shortest periodicity executes with the highest
priority."
Rate-monotonic is a priority based scheduling. The scheduling scheme is pre-emptive; it
ensures that a task is pre-empted if another task with a shorter period is expected to
run.This scheme is typically used in embedded systems where the nature of the
scheduling is deterministic. When implementing RMS scheduling in applications, the
rates should be designed/picked such that utilization of the system is high.
In other words the tasks period, execution time should be designed such that all tasks get
a fair chance to execute or at least get a chance to run when the tasks are expected to run,
because the nature of the scheduling always puts priority to tasks with shorter duration.
Consider two tasks with a rate 10 ms-task1, and 20 ms-task2. As per RMS, task1 should
always execute at the rate of 10 ms as it is the task with the shorter duration. Task2 will
execute at the rate of 20 ms if the task1 is not executing. Consider a case in which the
tasks are implemented such that execution time of task1 is 10 ms and task2 is also 10 ms.
In this scenario, the task2 will never execute as the task1 will always execute at every 10
ms. So the tasks need to be designed such that other tasks at least get a chance to execute.
In this case if task1 takes 8 msexecution time and task2 takes around 10 ms, then we can
be sure that task2 at least executes at around 100 ms as it gets 2 ms free every 20 ms.Both
execution time, and rates of the task must be perused before we implement a RMS
scheme for an application.
UNIT –V
EMBEDDED SYSTEM APPLICATION DEVELOPMENT
PART B (C402.5)
1.List and explain the hardware units that must be present in the embedded systems.
(Dec2017)
Embedded Systems Hardware Components
Power Supply. The power supply is an essential part of any embedded systems cir-
cuits. ...
Processor. A processor is the main brain inside any embedded systems. ...
Memory. ...
Timers-Counters. ...
Communication Ports. ...
Input and Output. ...
Application Specific Circuits. ...
St. Joseph’s College of Engineering 75
EE8691-Embedded Systems Department of EIE 2021-2022
It is a very common circuit that produces 5 Volt at the output. You can change the voltage
regulator to 7808,7812 depending upon the output required.
5. Explain the components of hardware and software units for smart card. (May 2018)
Smart card System Application:
Smart Card: Smart card is an equipment that comprise of an embedded integrated circuit chip
also known as ICC. This ICC can either be a self-asserting micocontroller or matching
intelligence with inbuilt memory or just a memory chip lone. A smart card gets connected to
the reader only when its directly physically contacted or with the aid of a remote contactless
radio-frequency interlace. With an embedded microcontroller, smart card have the idiomatic
capability to accumulate huge amount of information or data. performing their individual on-
card operations such as- mutual authentication, encryption and interact cleverly with the
smart card reader. This smart card technology harmonize with the international market
standards (ISO/IEC 14443 & ISO/IEC 7816) and is existing in a large number of forms such
as- SIMs (subscriber identity modules) employed in GSM cell phones, plastic cards, USB
based tokens, fobs, etc.
6. Elucidate the selection of processor and memory for any one embedded applications
with suitable diagram in detail.(May 2016) (May 2017)
Mobile phones or Smart phones are the devices which uses Embedded systems. A
Smartphone is a mobile phone with highly advanced features. Smartphones do contain
several embedded systems, like the modem core and the single-chip WiFi+Blue Tooth+GPS
solutions.
Block diagram of Mobile phone:
St. Joseph’s College of Engineering 85
EE8691-Embedded Systems Department of EIE 2021-2022
7. Explain the various form of memories present in an embedded system. (Dec 2017)
Types of RAM
The RAM family includes two important memory devices: static RAM (SRAM) and dynamic
RAM (DRAM). The primary difference between them is the lifetime of the data they store.
SRAM retains its contents as long as electrical power is applied to the chip. If the power is
turned off or lost temporarily, its contents will be lost forever. DRAM, on the other hand, has
an extremely short data lifetime-typically about four milliseconds. This is true even when
power is applied constantly.
In short, SRAM has all the properties of the memory you think of when you hear the word
RAM. Compared to that, DRAM seems kind of useless. By itself, it is. However, a simple
piece of hardware called a DRAM controller can be used to make DRAM behave more like
SRAM. The job of the DRAM controller is to periodically refresh the data stored in the
DRAM. By refreshing the data before it expires, the contents of memory can be kept alive for
as long as they are needed. So DRAM is as useful as SRAM after all.
When deciding which type of RAM to use, a system designer must consider access time and
cost. SRAM devices offer extremely fast access times (approximately four times faster than
DRAM) but are much more expensive to produce. Generally, SRAM is used only where ac-
cess speed is extremely important. A lower cost-per-byte makes DRAM attractive whenever
large amounts of RAM are required. Many embedded systems include both types: a small
block of SRAM (a few kilobytes) along a critical data path and a much larger block of
DRAM (perhaps even Megabytes) for everything else.
Types of ROM
Memories in the ROM family are distinguished by the methods used to write new data to
them (usually called programming), and the number of times they can be rewritten. This clas-
sification reflects the evolution of ROM devices from hardwired to programmable to eras-
able-and-programmable. A common feature of all these devices is their ability to retain data
and programs forever, even during a power failure.
The very first ROMs were hardwired devices that contained a preprogrammed set of data or
instructions. The contents of the ROM had to be specified before chip production, so the ac-
tual data could be used to arrange the transistors inside the chip. Hardwired memories are still
used, though they are now called "masked ROMs" to distinguish them from other types of
ROM. The primary advantage of a masked ROM is its low production cost. Unfortunately,
the cost is low only when large quantities of the same ROM are required.
One step up from the masked ROM is the PROM (programmable ROM), which is purchased
in an unprogrammed state. If you were to look at the contents of an unprogrammed PROM,
you would see that the data is made up entirely of 1's. The process of writing your data to the
PROM involves a special piece of equipment called a device programmer. The device pro-
grammer writes data to the device one word at a time by applying an electrical charge to the
input pins of the chip. Once a PROM has been programmed in this way, its contents can
never be changed. If the code or data stored in the PROM must be changed, the current
St. Joseph’s College of Engineering 88
EE8691-Embedded Systems Department of EIE 2021-2022
device must be discarded. As a result, PROMs are also known as one-time programmable
(OTP) devices.
An EPROM (erasable-and-programmable ROM) is programmed in exactly the same manner
as a PROM. However, EPROMs can be erased and reprogrammed repeatedly. To erase an
EPROM, you simply expose the device to a strong source of ultraviolet light. (A window in
the top of the device allows the light to reach the silicon.) By doing this, you essentially reset
the entire chip to its initial--unprogrammed--state. Though more expensive than PROMs,
their ability to be reprogrammed makes EPROMs an essential part of the software develop-
ment and testing process.
Hybrids
As memory technology has matured in recent years, the line between RAM and ROM has
blurred. Now, several types of memory combine features of both. These devices do not be-
long to either group and can be collectively referred to as hybrid memory devices. Hybrid
memories can be read and written as desired, like RAM, but maintain their contents without
electrical power, just like ROM. Two of the hybrid devices, EEPROM and flash, are descend-
ants of ROM devices. These are typically used to store code. The third hybrid, NVRAM, is a
modified version of SRAM. NVRAM usually holds persistent data.
EEPROMs are electrically-erasable-and-programmable. Internally, they are similar to
EPROMs, but the erase operation is accomplished electrically, rather than by exposure to ul-
traviolet light. Any byte within an EEPROM may be erased and rewritten. Once written, the
new data will remain in the device forever--or at least until it is electrically erased. The
primary tradeoff for this improved functionality is higher cost, though write cycles are also
significantly longer than writes to a RAM. So you wouldn't want to use an EEPROM for your
main system memory.
Flash memory combines the best features of the memory devices described thus far. Flash
memory devices are high density, low cost, nonvolatile, fast (to read, but not to write), and
electrically reprogrammable. These advantages are overwhelming and, as a direct result, the
use of flash memory has increased dramatically in embedded systems. From a software view-
point, flash and EEPROM technologies are very similar. The major difference is that flash
devices can only be erased one sector at a time, not byte-by-byte. Typical sector sizes are in
the range 256 bytes to 16KB. Despite this disadvantage, flash is much more popular than EE-
PROM and is rapidly displacing many of the ROM devices as well.
The third member of the hybrid memory class is NVRAM (non-volatile RAM). Nonvolatility
is also a characteristic of the ROM and hybrid memories discussed previously. However, an
NVRAM is physically very different from those devices. An NVRAM is usually just an
SRAM with a battery backup. When the power is turned on, the NVRAM operates just like
any other SRAM. When the power is turned off, the NVRAM draws just enough power from
the battery to retain its data. NVRAM is fairly common in embedded systems. However, it is
expensive--even more expensive than SRAM, because of the battery--so its applications are
typically limited to the storage of a few hundred bytes of system-critical information that
can't be stored in any better way.
8. With suitable diagram explain in detail about the concepts of smart card applications
in embedded system?(Dec 16) (May 2017)
A smart card is a special type of card like device which contains an integrated circuit chip
embedded on it. The IC chip can be a microprocessor with memory or just simple memory
circuit. In simple layman’s words, a smart card is the card with which we can exchange the
data, store it and manipulate data.
Working of smart card:
A smart card is connected to the host computer or controller via a card reader which gets in-
formation from the smart card and accordingly passes the information to the host computer or
controller.
Basic Smart Card Working System
Domestic: The most frequently used smart card in domestic field is the DTH smart
card. This card provides authorized access to the information coming from the satellites.
In simple words the card with which we can get access to the Direct to Home TV services
is nothing but a smart card. The information is encrypted and decrypted within a smart
card.
Ecommerce and Retail: Smart card can be used to store information like a person’s
account details, the transaction details and can be used in purchasing goods online by
acting as a credit card. Some retailers can also use smart cards to store points for a
particular customer and provide necessary incentives to repeated customers.
Banking Application: The most prominent use of smart card in banking application
is the replacement of the traditional magnetic stripe based credit or debit card. An ex-
ample is the MasterCard and VISA.
10.Explain in detail about the hardware and software parts of chocolate vending
Machine. (May 2018).
Inputs
Coin slot to insert the coins of different denominations and the keypad to enter the user
commands.
Signals, events and Notifications
An interrupt is generated at each port after the coin is received in the coin slot. Each port
interrupt starts an Interrupt Service Routine (ISR), which increases value of amount collected
by corresponding rupees (1, 2, 5 or 10). A notification is generated for each selection in the
menu.
St. Joseph’s College of Engineering 93
EE8691-Embedded Systems Department of EIE 2021-2022
Outputs
The display is used to show the GUIs, time and date, advertisements, welcome and thanks
messages. Chocolate and signal (IPC) to the system that subtracts the cost from the value of
amount collected.
Functions of the system
A child (user) sends commands to the ACVM using a GUI (graphic user interface). GUI
consists of the LCD and keypad units. At first, in the Coin insertion slot, the child inserts the
coins ( Task_Collect through Port_Collect) for the cost of chocolate and the machine delivers
the chocolate in the delivery slot. If the coins are not inserted as per the cost of chocolate for
a reasonable amount of time, then all coins are refunded (Task_Refund through
Port_Refund). If the inserted coins amount is more than the cost of chocolate, the excess
amount is refunded along with chocolate (Task_ExcessRefund through Port_ExcessRefund).
If the chocolate is of different rupees, then the port is assigned to each rupee, and then the
interrupt is sent to the corresponding port (Task_ReadPorts through Port_Read). After that
chocolate is delivered through the delivery slot (Task_Deliver through Port_Deliver). The
coins for the chocolates purchased collect inside the machine in a collector channel
(Task_Collect), so that owner can get the money, again through appropriate commands using
the GUI (Task_Display). USB wireless modem enables communication through Internet to
the ACVM system owner.
ACVM Hardware
The heart of an ACVM is a Microcontroller or ASIP (Application Specific Instruction Set
Processor). The 8051 can be used as the microcontroller and MUCOS the RTOS used in the
ACVM. ACVM specific hardware is required to sort the coins of different denomination
using coin sorter and the main Power supply needed is 220V 50Hz or 110V 60Hz. Internal
circuits need a supply of 5V 50mA for electronics and 12V, 2A for mechanical systems. By
programming the 8051 timer, the 1s resolution timer is obtained. A RAM is used for storing
temporary variables and the stack, and a ROM for application codes, and the RTOS codes for
scheduling the tasks. It also has flash memory for storing user preferences, contact data, user
address, a user date of birth, user identification code and answers to frequently asked
questions (FAQs). Timer and Interrupt controller are also needed to control the process of
ACVM. It has a TCP/IP port (Internet broadband connection) to the ACVM for remote
control and for providing the system status reports to the owner. It also has an ACVM
specific hardware and a power supply.
ACVM Software
Software is required to handle the following:
Read input from keypad, display text/graphics, control coins reader, and control delivery port
(to deliver the chocolate). In addition to these, we also need the TCP/IP stack communication
for remote control, and an RTOS (say, MUCOS), to run the ACVM software.