Professional Documents
Culture Documents
Embedded System
Embedded System
ON
EMBEDDED
SYSTEM
1. Power supply
2. Processor
3. Memory
4. Timers counters
5. Communication ports
Types of Processors
GPP core(s) or ASIP core(s) on either an Application Specific Integrated Circuit (ASIC) or a Very
Large Scale Integration (VLSI) circuit.
An embedded device is a computer that's embedded into an end product. It might require an OS
if the computer's functionality is complex, but not necessarily. A non-embedded device is a
computer that works on its own, and is the end product itself.
6. Explain the important considerations when selecting a processor.
The most important factor to consider when choosing a processor for an embedded system is its
performance. A processor’s speed is primarily determined by its architecture and silicon design.
Increasing the logic density and clock speed have an adverse impact on the power requirement
of the processor. Faster charging and discharging cycles in the capacitor, leakage currents may
lead to more power consumption.
Peripheral support
Apart from the processor, the embedded system has many other peripherals to perform input
and output operations. It is important to have the right peripherals to assist the processor in
optimized performance.
Advanced Processing
Along with the core processor, the presence of various co-processors and specialized processing
units can add more value to the processing performance. The instructions fetched by the core
processor are executed by the co-processors in parallel, thereby reducing the processing load.
Cost
For all the required functionalities to be built up in a system, certainly the price will be the
determining factor during the selection of processor for an embedded system.
Direct memory access (DMA) is a feature of computer systems that allows certain hardware
subsystems to access main system memory independently of the central processing unit (CPU).
A watchdog timer (WDT) is a timer that monitors microcontroller (MCU) programs to see if they
are out of control or have stopped operating. It acts as a “watchdog” watching over MCU
operation. A microcontroller (MCU) is a compact processor for controlling electronic devices.
Software pipelining is a type of out-of-order execution, except that the reordering is done by a
compiler (or in the case of hand written assembly code, by the programmer) instead of the
processor. Some computer architectures have explicit support for software pipelining, notably
Intel's IA-64 architecture.
A software timer (or just a 'timer') allows a function to be executed at a set time in the future.
The function executed by the timer is called the timer's callback function. The time between a
timer being started, and its callback function being executed, is called the timer's period.
9. Define the terms (i) Real Time Clock (ii) Memory Management.
Real-time clock: Integrated circuit that contains a timer that supplies the time of day (and often,
the date). An RTC generally contains a long-life battery to allow it to keep track of the time even
when there is no power applied.
The task of subdividing the memory among different processes is called memory management.
Memory management is a method in the operating system to manage operations between main
memory and disk during process execution. The main aim of memory management is to achieve
efficient utilization of memory.
The process which converts source code to executable code is called as the build process.
This Process involves many steps and tools but the main three distinct steps of this process are:
Each of the source files must be compiled or assembled into an object file.
All of the object files that result from the first step must be linked together to produce a single
object file, called the relocatable program.
Physical memory addresses must be assigned to the relative offsets within the relocatable
program in a process called relocation.
A simulator is designed to create an environment that contains all of the software variables and
configurations that will exist in an app's actual production environment. In contrast, an emulator
attempts to mimic all of the hardware features of a production environment and software
features.
compiler, computer software that translates (compiles) source code written in a high-level
language (e.g., C++) into a set of machine-language instructions that can be understood by a
digital computer's CPU. Compilers are very large programs, with error-checking and other
abilities.
A cross compiler is a compiler capable of creating executable code for a platform other than the
one on which the compiler is running. For example, a compiler that runs on a PC but generates
code that runs on Android smartphone is a cross compiler.
14. Define the terms (i) Program Counter (ii) Memory Management Unit.
The program counter (PC) is a register that manages the memory address of the instruction to
be executed next. The address specified by the PC will be + n (+1 for a 1-word instruction and +2
for a 2-word instruction) each time one instruction is executed.
A memory management unit (MMU) is a computer hardware component that handles all
memory and caching operations associated with the processor. In other words, the MMU is
responsible for all aspects of memory management.
The memory management function keeps track of the status of each memory location, either
allocated or free. It determines how memory is allocated among competing processes, deciding
which gets memory, when they receive it, and how much they are allowed.
Debugging tactics can involve interactive debugging, control flow analysis, unit testing,
integration testing, log file analysis, monitoring at the application or system level, memory
dumps, and profiling. Many programming languages and software development tools also offer
programs to aid in debugging, known as debuggers.
Six famous memory management techniques are: Fixed Partitioning, Dynamic Partitioning,
Simple Paging, Simple Segmentation, Virtual-Memory Paging and Virtual- Memory
Segmentation.
Debugging is important because it allows software engineers and developers to fix errors in a
program before releasing it to the public. It's a complementary process to testing, which
involves learning how an error affects a program overall.
There are two types of debugging techniques: reactive debugging and preemptive debugging.
Most debugging is reactive — a defect is reported in the application or an error occurs, and the
developer tries to find the root cause of the error to fix it.
2. CAN Bus
The baud rate is the rate at which information is transferred in a communication channel. Baud
rate is commonly used when discussing electronics that use serial communication. In the serial
port context, "9600 baud" means that the serial port is capable of transferring a maximum of
9600 bits per second.
RS232 is more than able to perform for a short distance and low data speed requirements.
RS232 has a transmission speed of 1Mb/s up to 15M. However, RS485 has a data transmission
speed of up to 10Mb/s for a distance of 15M. At the maximum of 1200M, RS485 transmits at
100Kb/s.
RS-232 is a standard communication protocol for connecting computers and their peripheral
devices to enable serial data exchange. In simple terms, RS232 represents the voltage for the
path used for data exchange between the devices.
Synchronous communications is that which takes place in real-time between two or more
parties. Put simply; a synchronous communication exchange is an interactive, 'live' interchange
between people.
RS-422 can work and receive with full-duplex operation through two pairs of twisted pairs.
RS485 can only work half-duplex and cannot perform transmission and reception
simultaneously, but it only needs one couple of twisted pairs. RS422 and RS485 can transmit
1200 meters at 19kpbs.
RS-485 is an industrial specification that defines the electrical interface and physical layer for
point-to-point communication of electrical devices. The RS-485 standard allows for long cabling
distances in electrically noisy environments and can support multiple devices on the same bus.
I2C uses resistive pull-up for its bus. Limiting the bus speed.
Bus speed is directly dependent on the bus capacitance, meaning longer I2C bus traces will limit
the bus speed.
I2C bus is shared by multiple slave devices, if any one of these slaves misbehave (pull either SCL
or SDA low for indefinite time) the bus will be stalled. No further communication will take place.
Since the bus is shared by many devices, debugging an I2C bus (detecting which device is
misbehaving) for issues is pretty difficult.
I2C master protocol is straightforward and easy to implement (even in firmware), but that is not
the case if you want to implement the protocol in slave devices. I2C protocol implementation for
slave devices is a bit complicated.
(Controller Area Network bus) A rugged, digital serial bus designed for industrial environments.
Introduced by Bosch in the mid-1980s for in-vehicle communications, it is used in myriad
applications including factory automation, building automation, aircraft and aerospace as well
as in cars, trucks and buses.
Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between
microcontrollers and small peripherals such as shift registers, sensors, and SD cards. It uses
separate clock and data lines, along with a select line to choose the device you wish to talk to.
A device driver is a particular form of software application that allows one hardware device
(such as a personal computer) to interact with another hardware device (such as a printer). A
device driver may also be called a software driver.
Flexible: CAN nodes are not limited by the protocol and can be easily connected or
disconnected. Fast: CAN supports a data rate of 1 MBit/s @ 40m bus length. Fault confinement:
Faulty nodes do not disturb the communication. Broadcast capabilities: Messages can be sent to
one /many/all nodes.
Device Drivers are very essential for a computer system to work properly because without
device driver the particular hardware fails to work accordingly means it fails in doing a particular
function/action for which it has been created.
41. What is EDLC? List the different phases in EDLC.
Embedded Product Development Life Cycle (Let us call it as EDLC, though it is not a standard and
universal term) is an 'Analysis -Design -Implementation' based standard problem solving
approach for Embedded Product Development.
Concept.
Requirement gathering.
Design phase.
Integration.
Verification.
Models are forms of description often adopted in software development. They are abstractions
used to represent and communicate what is important, devoid of unnecessary detail, and to
help developers deal with the complexity of the problem being investigated or the solution
being developed.
WATERFALL MODEL
PROTOTYPING MODEL
SPIRAL MODEL
44. Define the Linear or Water fall Model with suitable flow chart.
The waterfall model is a classical model used in system development life cycle to create a
system with a linear and sequential approach. It is termed as waterfall because the model
develops systematically from one phase to another in a downward fashion.
The product development process can be broadly navigated in three stages: Ideation, Feasibility,
and Capability.
46. Mention different models used for the development of an embedded system.
Three types of models should be used when designing such systems: analytic models,
executable simulations, and prototypes.
not about making products to look aesthetically pleasing ordesign and development programs.
New products or services,
which are developed on a regular basis, are one of the main
requirements.
Prototyping Model
Spiral Model
Through a rich and often boisterous discussion, four teachers collectively broke down the
engineering design process into four main phases: problem definition, design exploration,
design optimization, and design communication.
The deployment phase is the final step in the software development life cycle and delivers the
final product to the customer in a live production environment. After the product deploys, the
product is ready for customers to use.
A state machine model is a mathematical model that groups all possible system occurrences,
called states. Every possible state of a system is evaluated, showing all possible interactions
between subjects and objects. If every state is proven to be secure, the system is proven to be
secure.
4. What is meant by Memory? Explain the different types of memory devices (i) ROM (ii) RAM.
Computer memory is a generic term for all of the different types of data storage technology
that a computer may use, including RAM, ROM, and flash memory. Some types of computer
memory are designed to be very fast, meaning that the central processing unit (CPU) can access
data stored there very quickly.
It is also called read-write memory or the main memory or the primary memory.
The programs and data that the CPU requires during the execution of a program are stored in
this memory.
It is a volatile memory as the data is lost when the power is turned off.
RAM is further classified into two types- SRAM (Static Random Access Memory) and DRAM
(Dynamic Random Access Memory).
Stores crucial information essential to operate the system, like the program essential to boot
the computer.
It is not volatile.
ROM is further classified into four types- MROM, PROM, EPROM, and EEPROM.
5. Explain the following types of Embedded Software (i) Machine Code Format (ii) Assembly
It uses the instruction set of a particular computer architecture. It is usually written in binary.
Machine code is the lowest level of software. Other programming languages are translated into
machine code so the computer can execute them. An instruction tells the process what
operation to perform.
It is a necessary bridge between software programs and their underlying hardware platforms.
Today, assemble languages are rarely written directly, although they are still used in some niche
applications such as when performance requirements are particularly high.
In contrast, assembly languages are considered low-level because they are very close to
machine languages.
6. How to select the processor based upon its architecture and applications.
With numerous kinds of processors with various design philosophies available at our disposal for
using in our design, following considerations need to be factored during processor selection for
an embedded system.
Performance Considerations
Power considerations
Peripheral Set
Operating Voltage
Performance considerations
The first and foremost consideration in selecting the processor is its performance. The
performance 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 performance.
Rather than simply stating the clock frequency of the processor which has limited significance 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 followed 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 benefits
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 popular co-
processors include
RISC cores supports primarily integer only instruction set. Hence presence of a FP co-processor
can be very helpful in application involving complex mathematical operations including
multimedia, imaging, codecs, signal processing etc.
GPU(Graphic Processing Unit) also called as Visual processing unit is responsible for drawing
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 involves 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, gaming 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.
DSP is a processor designed specifically for signal processing applications. Its architecture
supports processing of multiple data in parallel. It can manipulate real time signal and convert to
other domains for processing. DSP’s are either available as the part of the SoC or separate in an
external package. DSP’s are very helpful in multimedia applications. It is possible to use a DSP
along with a processor or use the DSP as the main processor itself.
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 capacities
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 functionalities,
price will be the determining factor when designing the system and choosing the right
processor.
In the upcoming blog, we will discuss about various memory technologies and factors to be
considered when selecting them.
7. With a neat diagram explain the working of Direct Memory Access (DMA) with architecture and
timing diagram.
Direct memory access (DMA) is a mode of data transfer between the memory and I/O devices.
This happens without the involvement of the processor. We have two other methods of data
transfer, programmed I/O and Interrupt driven I/O.
The architecture and timing diagram of DMA are shown above.
Memory allocation is a process by which computer programs and services are assigned with
physical or virtual memory space.
In computer science, a memory leak is a type of resource leak that occurs when a computer
program incorrectly manages memory allocations[1] in a way that memory which is no longer
needed is not released. A memory leak may also happen when an object is stored in memory
but cannot be accessed by the running code.[2] A memory leak has symptoms similar to a
number of other problems and generally can only be diagnosed by a programmer with access to
the program's source code.
Memory Segmentation.
• Fixed partitioning: this partitioning approach
external fragmentation.
need for external fragmentation, transfers between disks can be at the granularity of individual
pages.
memory utilization
management.
9. Discuss in detail about the timer and counter devices inEmbedded System
A timer is a specialized type of clock which is used to measure time intervals. A timer that
counts from zero upwards for measuring time elapsed is often called a stopwatch. It is a device
that counts down from a specified time interval and used to generate a time delay, for example,
an hourglass is a timer.
A counter is a device that stores (and sometimes displays) the number of times a particular
event or process occurred, with respect to a clock signal. It is used to count the events
happening outside the microcontroller. In electronics, counters can be implemented quite easily
using register-type circuits such as a flip-flop.
Registers
The 8051 has two timers, Timer 0 and Timer 1. They can be used as timers or as event counters.
Both Timer 0 and Timer 1 are 16-bit wide. Since the 8051 follows an 8-bit architecture, each 16
bit is accessed as two separate registers of low-byte and high-byte.
Timer 0 Register
The 16-bit register of Timer 0 is accessed as low- and high-byte. The low-byte register is called
TL0 (Timer 0 low byte) and the high-byte register is called TH0 (Timer 0 high byte). These
registers can be accessed like any other register. For example, the instruction MOV TL0, #4H
moves the value into the low-byte of Timer #0.
Timer 0
Timer 1 Register
The 16-bit register of Timer 1 is accessed as low- and high-byte. The low-byte register is called
TL1 (Timer 1 low byte) and the high-byte register is called TH1 (Timer 1 high byte). These
registers can be accessed like any other register. For example, the instruction MOV TL1, #4H
moves the value into the low-byte of Timer 1.
Timer 1
Both Timer 0 and Timer 1 use the same register to set the various timer operation modes. It is
an 8-bit register in which the lower 4 bits are set aside for Timer 0 and the upper four bits for
Timers. In each case, the lower 2 bits are used to set the timer mode in advance and the upper 2
bits are used to specify the location.
10. Explain (i) Building Process for Embedded System (ii) Structural unit of Embedded Processor
The build process for embedded systems is different. This is because the code to be run on an
embedded system is written one platform i.e. general purpose computer and executed on
another platform i.e. the target hardware.
An Embedded system would also use tools such as a Compiler, Linker, Locater and Debugger to
perform the entire build process. These tools would be a part of a larger IDE.
A compiler which produces the executable code to be run on a different platform is called a
cross-compiler; else it is called a native compiler.
Ex. Turbo C++ is a native compiler. The compiler in case of embedded systems development is a
cross compiler.
Compiling
Linking
Locating
Internal Buses
It internally connects all the structural units inside the processor. Its width can be of 8, 16, 32 or
64 bits. The internal buses include address bus, data bus and control bus. All the internal units of
the processor are communicated with the external buses through an interface unit called Bus
Interface Unit(BIU).
Instruction Units
The processor executes several operations with the help of a piece of code or program called
instructions. All these instruction are arranged in a queue called Instruction Queue(IQ). This
helps the Instruction Register to execute the instructions without the need to wait.
Caches
In general, cache is the temporary storage place in the processor, where the data can easily be
retrieved by the CPU for quick operation. Cache is available in your computers, laptop, mobile
phone, browser, app, etc. The embedded processor has three cache memory for fast operation.
Control Units
The control unit(CU) is one of the important structural units in an any embedded processor. It is
responsible for all the control of the bus activities and unit functions needed for processing. It
directs all the units of a processor to respond to the instruction that is executed.
Processing Units
Processing units receives the input data, process it and produces the output. Depending on the
function of the embedded system, the processing is done through different units like ALU, FLPU,
AOU and advanced units.
Register Sets
Application Register Set(ARS) is a set of on-chip registers used during processing of instructions
of the application program of the user. A register window consists of a subset of registers with
each subset storing static variables of software – routine.
Memory Registers
Registers are smallest part of the CPU, where the data and address can be stored and accessed
quickly. There are various registers like accumulator, general purpose registers, flag registers,
memory address register, memory data register, program counter, stack pointer, etc.
Program counter is a register that stores the address of the next instruction to be executed from
the memory. It generates the instruction cycle to fetch the address from memory through MAR.
11. With a neat diagram discuss the following terms in Embedded Processor (i) DMA Architecture
2 A watchdog timer (WDT) is a timer that monitors microcontroller (MCU) programs to see if
they are out of control or have stopped operating. It acts as a “watchdog” watching over MCU
operation.
This makes safeguarding normal MCU operation essential. Should the MCU program, for some
reason, run out of control or stop running altogether, the electronic device may behave
erratically, which in the worst case could cause damage or an accident.
To proactively prevent such incidents, it falls to the role of the watchdog timer to constantly
watch over the MCU to ensure it is operating normally.
3 A real-time clock (RTC) is an electronic device (most often in the form of an integrated circuit)
that measures the passage of time.Although the term often refers to the devices in personal
computers, servers and embedded systems, RTCs are present in almost any electronic device
which needs to keep accurate time of day.
12. Illustrate the synchronous and asynchronous communications from serial devices.
A synchronous serial interface always pairs its data line(s) with a clock signal, and all devices on
a synchronous serial bus share a common clock. This makes for a more straightforward, even
faster serial transfer, but it also requires at least one extra wire between communicating
devices. In simple terms which interface required SCK, SCLK pin the synchronous.
In synchronous method, for example in SPI there are 4 pins used, 2 pins are for MISO & MOSI
(Master In Slave Out & Master Out Slave In), 1 pin for fixed Clock (from single master device)
and 1 Data pin for each slave device. Here SS1, SS2, SS3 are data pins for 3 slave devices.
IN ASYNCHRONOUS METHOD
This is also Serial communication but data transfer without any support from an external clock
signal or in other words in this you do not need a clock for communicating with other devices.
For example UART, RS232 etc. are Asynchronous serial communication methods.
Usually RS232, RS422 & RS485 have two wires RX and TX with predefined data rate (also called
baud rate) and no predetermined master or slave device.
13. Describe the functions of a typical parallel I/O interface with a neat diagram.
The main purpose of the I/O interfaces is to transmit and receive data; however, the portion
designated as an I/O interface may contain additional resources, such as voltage translators,
registers, impedances, and buffers.
The term used for the I/O interface section may vary, depending on the manufacturer; however,
the general function is the same. Consult the specific FPGA manufacturer's datasheet or
application notes for the complete I/O interface details. As an example, a brief description of
Altera's and Xilinx's I/O interface is presented.
Altera calls its I/O interfaces I/O elements (IOEs). They provide the basic internal to external
interface function, support various differential and single-ended I/Os, and provide
programmable pull-up resistors and I/O delays.
Normally, a serial port is a male port, while a parallel port is a female port. System resource
configurations are chosen for each port and are identified by COM1, COM2, COM3, COM4, and
so forth. Each COM position represents an input/output (I/O) and an interrupt request (IRQ)
address. The I/O address transfers and receives data to and from a peripheral device such as a
mouse or keyboard.
The serial port standard is RS-232. This standard is used for transmitting serial communication
between devices, which are usually called data communications equipment (DCE) and data
terminal equipment (DTE). The serial port uses a nine-pin (DE-9) connector or a 25-pin (DB-25)
connector. Originally, the standard used 25 pins. Because many of the pins were unused and
were quite bulky, the smaller DE-9 connector became popular.
Higher speed communication was needed for serial communication, such as external data
storage units. In 1998, the Universal Serial Bus (USB) and FireWire introduced faster interfaces.
This new technology could transfer data at high rates on the same bus, called a daisy chain.
Today, the serial port is seldom used but can be found as a communication device for GPS
receivers, LED and LCD text displays, bar-code scanners and flat-screen monitors.
Mouse - One of the most commonly used devices for serial ports, usually used with computers
with no PS/2 or USB ports and specialty mice.
Modem - Another commonly used device for serial ports. Used commonly with older computers,
however, is also commonly used for its ease of use.
Network - One of the original uses of the serial port, which allowed two computers to connect
together and allow large files to be transferred between the two.
Printer - Today, this not a commonly used device for serial ports. However, was frequently used
with older printers and plotters.