ES Notes Complete
ES Notes Complete
A system is an arrangement in which all its unit assemble work together according to a set of
rules. It can also be defined as a way of working, organizing or doing one or many tasks
according to a fixed plan. For example, a watch is a time displaying system. Its components
follow a set of rules to show time. If one of its parts fails, the watch will stop working. So we
can say, in a system, all its subcomponents depend on each other.
Embedded System
As its name suggests, Embedded means something that is attached to another thing. An
embedded system can be thought of as a computer hardware system having software embedded
in it. An embedded system can be an independent system or it can be a part of a large system.
An embedded system is a microcontroller or microprocessor based system which is designed
to perform a specific task. For example, a fire alarm is an embedded system; it will sense only
smoke.
It has hardware.
It has application software.
It has Real Time Operating system (RTOS) that supervises the application software and
provide mechanism to let the processor run a process as per scheduling by following a
plan to control the latencies. RTOS defines the way the system works. It sets the rules
during the execution of application program. A small scale embedded system may not
have RTOS.
The embedded design process is not as simple as figure depicts. A considerable amount of
iteration and optimization occurs within phases and between phases. Defects found in later
stages often cause us to “go back”. For example, when product testing reveals performance
deficiencies that render the design noncompetitive, we might have to
rewrite algorithms, redesign custom hardware such as application specific integrated circuits
(ASIC) for better performance - speed up the processor, choose a new processor and so on.
Product specifications:
Design of any system starts at its specifications, specifications uses a language, which may be
simple English, some programming languages like C, or it may be some formal techniques
using petri nets, state chart and so on.
The choice of the microprocessor and some other key elements of a design are important
Hardware/software partitioning:
Embedded design involve both hardware and software components, we have to decide which
portion of the problem will be solved in hardware and which in software. This choice is called
the “partitioning decision”. A general purpose processor will have software implementation of
the task, while a dedicated processor can be implemented on FPGA (field programmable gate
array) or ASIC (application specific integrated circuit), to have better performance.
The partitioning decision is a complex optimization problem. Many embedded designs are
required to be
•Price sensitive
•Leading edge performers
•Non standard
•Market competitive
•Proprietary
Hardware/Software integration:
The hardware/software integration phase of the development cycle must have
special tools and methods to manage the complexity. The process of integrating embedded
software and hardware is exercise in debugging and discovery
Debugging an embedded system:
Debugging an embedded system is similar to debugging a host based applications. If the target
system contains an available communication channel to the host computer, the debugger can
exist as two pieces: a debug kernel in the target system and a host application that
communicates with it and manages the source database and symbol tables. Many embedded
systems are impossible to debug unless they are operating at full speed. Running an embedded
program under a debugger can slow the program down by one or more orders of magnitude.
In general, there are three requirements for debugging an embedded or real-time system:
•Run control- the ability to start, stop, peak, and poke the processor and memory.
•Memory substitution- replacing ROM-based memory with RAM for rapid and easy
code download, debug, and repair cycles.
•Real-time analysis- following code flow in real time with real-time trace analysis
2. Microprocessors
A microprocessor is a processor that is contained on a microchip, or integrated circuit (IC). It
is a central processing unit (CPU) that executes the instructions of a computer program. Some
features of microprocessors include:
Instruction set: Microprocessors have a specific instruction set that defines the operations that
they can perform.
Clock speed: The clock speed of a microprocessor determines how fast it can execute
instructions. Microprocessors typically have high clock speeds, which allows them to perform
tasks quickly.
Data bus: The data bus is a communication pathway that is used to transfer data between the
microprocessor and other components in a system.
Address bus: The address bus is a communication pathway that is used to transfer the address
of a memory location between the microprocessor and other components in a system.
Cache: Many microprocessors have one or more levels of cache, which is a small amount of
high-speed memory that is used to store frequently accessed data. This helps to improve the
performance of the microprocessor.
Power consumption: Microprocessors can have relatively high power consumption, which
can be a concern in devices where power is limited.
Size: Microprocessors are designed to be small, as they are typically used in devices where
space is at a premium.
Cost: Microprocessors can vary in cost depending on their capabilities and features.
3. Microcontrollers
A microcontroller is a small, low-power computer that is contained in a single integrated circuit
(IC). It is a type of embedded processor that is used in a wide range of devices, including
consumer electronics, industrial control systems, and automotive systems. Some features of
microcontrollers include:
On-chip peripherals: Many microcontrollers have a variety of on-chip peripherals, such as
timers, serial ports, and analog-to-digital converters, which allow them to interface with
external devices.
Memory: Microcontrollers have both program memory, which stores the instructions that are
executed by the processor, and data memory, which is used to store variables and other data.
Input/output (I/O) pins: Microcontrollers have a set of I/O pins that can be used to interface
with external devices, such as sensors or actuators.
Low power consumption: Microcontrollers are designed to be low-power, which makes them
suitable for use in battery-powered devices.
Cost: Microcontrollers are typically less expensive than general-purpose processors, as they
are designed for specific tasks and do not have as many capabilities.
Size: Microcontrollers are small, which makes them suitable for use in compact devices.
Flexibility: Microcontrollers are highly flexible and can be programmed to perform a wide
range of tasks.
SPI
A different approach is SPI. Introduced in the late 1980s, this technology aimed to replace
asynchronous serial communication towards peripherals, by introducing a number of
improvements:
Serial clock line to synchronize the endpoints
Master-slave protocol
One-to-many communication over the same three-wire bus
The master device, usually the microcontroller, shares the bus with one or more slaves. To
trigger the communication, a separate slave select (SS) signal is used to address each slave
connected to the bus. The bus uses two independent signals for data transfer, one per direction,
and a shared clock line that synchronizes the two ends of the communication. Due to the clock
line being generated by the master, the data transfer is more reliable, making it possible to
achieve higher bitrates than ordinary UART. One of the keys for the continued success of SPI
over multiple generations of microcontrollers is the low complexity required for the design of
slaves, which can be as simple as a single shift register. SPI is commonly used in sensor
devices, LCD displays, flash memory controllers, and network interfaces.
I2C
I2C is slightly more complex, and that is because it is designed with a different purpose in
mind: interconnecting multiple microcontrollers, as well as multiple slave devices, on the same
two-wire bus. The two signals are serial clock (SCL) and serial data (SDA). Unlike SPI or
UART, the bus is half-duplex, as the two directions of the flow share the same signal. Thanks
to a 7-bit slave-addressing mechanism incorporated in the protocol, it does not require
additional signals dedicated to the selection of the slaves. Multiple masters are allowed on the
same line, given that all the masters in the system follow the arbitration logic in the case of bus
contention.
USB
The USB protocol, originally designed to replace UART and include many protocols in the
same hardware connector, is very popular in personal computers, portable devices, and a huge
number of peripherals.
This protocol works in host-device mode, with one side of communication, the device,
exposing services that can be used by the controller, on the host side. USB transceivers present
in many microcontrollers can work in both modes. By implementing the upper layer of the
USB standards, different types of devices can be emulated by the microcontroller, such as serial
ports, storage devices, and point-to-point Ethernet interfaces, creating microcontroller-based
USB devices that can be connected to a host system.
If the transceiver supports host mode, the embedded system can act as a USB host and devices
can be connected to it. In this case, the system should implement device drivers and
applications to access the functionality provided by the device.
When both modes are implemented on the same USB controller, the transceiver works in on-
the-go (OTG) mode, and the selection and configuration of the desired mode can be done at
runtime.
IDE SELECTION
You can find many modern integrated development environments (IDEs) on the market with a
range of features and different price points. Many IDEs are open source, or free to use and
configure. The following are some criteria to consider when choosing an IDE:
Automation features
The three common features in most IDES are the source code editor, build automation, and
debugger. Additional features may vary and can include the following:
Code editor UI enhancements
Automated testing features
Code deployment support via plugin integration
Code refactoring support
Application packaging support
IDE customization
Some IDEs include the ability to customize workflows to match a developer's needs and
preferences. You can download and use plugins, extensions, and add-ons to customize your
programming experience.
Toolchain
A toolchain is the set of tools that compiles source code into executables that can run on your
target device, and includes a compiler, a linker, and run-time libraries. Initially, you need one
to build the other three elements of an embedded Linux system: the bootloader, the kernel, and
the root filesystem. It has to be able to compile code written in assembly, C, and C++ since
these are the languages used in the base open source packages.
C
The most widely used programming language for embedded devices is C. It is a low-level
language made to be quick and effective. C is used to develop software for microcontrollers,
which are small computers that are embedded in a wide range of devices. C is a powerful
language that allows developers to write code that is close to the hardware, which makes it
ideal for embedded systems programming.
C is a procedural language that provides low-level access to memory and hardware. It is a
language that is widely used in the development of operating systems, embedded systems, and
real-time systems. C is a language that is highly portable and can be used on a wide range of
hardware platforms.
C++
C++ is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. C++ is an extension of the C programming
language, and it includes features such as object-oriented programming and templates. C++ is
a popular choice for embedded systems programming because it is a powerful language that
allows developers to write efficient code.
C++ is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of video games, operating
systems, and embedded systems. C++ is a language that is highly portable and can be used on
a wide range of hardware platforms.
Assembly Language
Assembly language is a low-level programming language that is used to develop software for
microcontrollers. Assembly language is used to write code that is specific to the hardware that
it is running on. Assembly language is a powerful language that allows developers to write
code that is highly efficient and fast.
Assembly language is a language that provides low-level access to memory and hardware. It is
a language that is widely used in the development of operating systems, embedded systems,
and real-time systems. Assembly language is a language that is highly specific to the hardware
platform that it is running on.
Python
Python is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. Python is a popular choice for embedded systems
programming because it is easy to learn and use. Python is a powerful language that allows
developers to write code that is efficient and fast.
Python is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of web applications, scientific
computing, and embedded systems. Python is a language that is highly portable and can be
used on a wide range of hardware platforms.
Java
Java is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. Java is a popular choice for embedded systems
programming because it is a powerful language that allows developers to write code that is
efficient and fast. Java is also a portable language, which means that it can run on a wide range
of hardware platforms.
Java is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of web applications, enterprise
applications, and embedded systems. Java is a language that is highly portable and can be used
on a wide range of hardware platforms.
UNIT 2
It is specially built for a specific application or purpose. If compared to any other device, ASIC
has improved speed. Basically, it is an integrated circuit that’s been specified for one specific
purpose and is not software programmable to perform a wide variety of different tasks. These
are widely used in applications, including auto emission control, environmental monitoring,
and personal digital assistants. It often has an embedded CPU to manage suitable tasks.
ASIC Categories
Programmable: These are not custom made, and can be run in the data center, campus,
or in a metro Ethernet environment. It is further subdivided into two categories.
FPGAs: These are complex and larger reconfigurable devices, which include programming
logic cells and interconnect. For Example Xilinx, Altera, QuikLogic, etc are some of the FPGA
companies
PLDs: These are the electronic devices used to build reconfigurable circuits. For
Example- GAL ROM, PROM, EPROM, EEPROM, etc.
Full Custom: These are custom-made from scratch for a specific application. It is a
design methodology useful for integrated circuits. There are the resistors, transistors,
digital logic, capacitors, and analog circuits are positioned in the circuit layout. For
Example Microprocessor. It takes a minimum time of 8 weeks for normal
manufacturing and is quite expensive. Features- Maximum performance, minimized
area, and the highest degree of flexibility.
Semi-Custom: These are customized partially so that they can perform the different
functions within the area of their general application. Basically, it is an alternative to
full-custom designs. It is further subdivided into two categories:
Gate Array Based: These have pre-defined transistors on the silicon wafer.
Standard Cell Based: Some logic gates such as AND gates, OR gates, multiplexers, flip-flops
are pre-designed by designers by using different configurations, standardized, and stored in the
form of a library, this is known as a standard cell library. The cell area or flexible block is made
up of standard cells arranged in the form of rows, with these flexible blocks mega cells like
microcontrollers or even microprocessors are used on-chip.
Processor Selection
There are a number of different factors that should be taken into consideration when assessing
a CPU to use in your embedded system. This criteria includes elements such as CPU
performance, power consumption, memory, supporting peripherals, industry requirements, and
overall costs. Performance, power consumption, and functionality of the unit should be the
primary parameters that guide your final decision.
Performance
The most important parameter to judge a CPU system is its performance. While you may be
bombarded with loads of values, comparisons, and benchmarks that show just how well
performing a processor is, you need to determine for yourself whether or not the unit will be
able to successfully address the particular needs of your application. You want the processor
to be fast and skillful enough to fulfil your requirements. A good way to select a CPU is to
shortlist a few options and run trial simulations with your code to formulate your own
benchmarks.
Memory
You will have to go for a processor that is able to support the entirety of your software program
on its onboard memory. Remember: most microcontrollers have a limited amount of onboard
address space, which is why you need to actively search for a solution that can accommodate
your program.
Power
Keep in mind that if you are investing in a processor with great performance, it is also going to
increase the power consumption. If you search around, you will be able to find solutions that
offer high performance with low power consumption.
Peripherals
The supporting peripherals that accompany your CPU are just as important as the unit itself.
Since you are paying an additional cost for them, you will want to maximize their potential.
Ideally, you will want to go with a processor whose peripherals overlap with the technology
your application requires for execution. This results in cost savings, which is a welcome bonus.
Costs
The costs associated with the CPU are very important to take into consideration. Not only
should the price of the unit itself fall within your budget, but you also need to think about the
training costs, supporting development tools, and peripherals you will need to maximize the
use of the processor. Make sure to check all the peripherals beforehand and determine whether
or not the system as a whole is worth the price.
RISC Processor
RISC stands for Reduced Instruction Set Computer Processor, a microprocessor
architecture with a simple collection and highly customized set of instructions. It is built to
minimize the instruction execution time by optimizing and limiting the number of instructions.
It means each instruction cycle requires only one clock cycle, and each cycle contains three
parameters: fetch, decode and execute. The RISC processor is also used to perform various
complex instructions by combining them into simpler ones. RISC chips require several
transistors, making it cheaper to design and reduce the execution time for instruction.
Examples of RISC processors are SUN's SPARC, PowerPC, Microchip PIC processors, RISC-
V.
Advantages of RISC Processor
The RISC processor's performance is better due to the simple and limited number of
the instruction set.
It requires several transistors that make it cheaper to design.
RISC allows the instruction to use free space on a microprocessor because of its
simplicity.
RISC processor is simpler than a CISC processor because of its simple and quick
design, and it can complete its work in one clock cycle.
Disadvantages of RISC Processor
The RISC processor's performance may vary according to the code executed because
subsequent instructions may depend on the previous instruction for their execution in a
cycle.
Programmers and compilers often use complex instructions.
RISC processors require very fast memory to save various instructions that require a
large collection of cache memory to respond to the instruction in a short time.
RISC Architecture
It is a highly customized set of instructions used in portable devices due to system
reliability such as Apple iPod, mobiles/smartphones, Nintendo DS
CISC Processor
The CISC Stands for Complex Instruction Set Computer, developed by the Intel. It has a
large collection of complex instructions that range from simple to very complex and specialized
in the assembly language level, which takes a long time to execute the instructions. So, CISC
approaches reducing the number of instruction on each program and ignoring the number of
cycles per instruction. It emphasizes to build complex instructions directly in the hardware
because the hardware is always faster than software. However, CISC chips are relatively slower
as compared to RISC chips but use little instruction than RISC. Examples of CISC processors
are VAX, AMD, Intel x86 and the System/360.
Types of RTOS
1. Hard Real-Time Operating System: These operating systems guarantee that critical
tasks are completed within a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early or too late, the
car cannot be sold, so it is a hard real-time system that requires complete car welding by the
robot hardly on time., scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
2. Soft real-time operating system: This operating system provides some relaxation in the
time limit.
For example – Multimedia systems, digital audio systems, etc. Explicit, programmer-defined,
and controlled processes are encountered in real-time systems. A separate process is changed
by handling a single external event. The process is activated upon the occurrence of the related
event signaled by an interrupt.
Multitasking operation is accomplished by scheduling processes for execution independently
of each other. Each process is assigned a certain level of priority that corresponds to the relative
importance of the event that it services. The processor is allocated to the highest-priority
processes. This type of schedule, called, priority-based preemptive scheduling is used by real-
time systems.
3. Firm Real-time Operating System: RTOS of this type have to follow deadlines as well.
In spite of its small impact, missing a deadline can have unintended consequences,
including a reduction in the quality of the product. Example: Multimedia applications.
4. Deterministic Real-time operating System: Consistency is the main key in this type of
real-time operating system. It ensures that all the task and processes execute with
predictable timing all the time,which make it more suitable for applications in which timing
accuracy is very important. Examples: INTEGRITY, PikeOS.
Advantages:
The advantages of real-time operating systems are as follows-
Maximum consumption: Maximum utilization of devices and systems. Thus more
output from all the resources.
Task Shifting: Time assigned for shifting tasks in these systems is very less. For
example, in older systems, it takes about 10 microseconds. Shifting one task to another
and in the latest systems, it takes 3 microseconds.
Focus On Application: Focus on running applications and less importance to
applications that are in the queue.
Real-Time Operating System In Embedded System: Since the size of programs is
small, RTOS can also be embedded systems like in transport and others.
Error Free: These types of systems are error-free.
Memory Allocation: Memory allocation is best managed in these types of systems.
Disadvantages:
The disadvantages of real-time operating systems are as follows-
Limited Tasks: Very few tasks run simultaneously, and their concentration is very less
on few applications to avoid errors.
Use Heavy System Resources: Sometimes the system resources are not so good and
they are expensive as well.
Complex Algorithms: The algorithms are very complex and difficult for the designer
to write on.
Device Driver And Interrupt signals: It needs specific device drivers and interrupts
signals to respond earliest to interrupts.
Thread Priority: It is not good to set thread priority as these systems are very less
prone to switching tasks.
Minimum Switching: RTOS performs minimal task switching.
Comparison of Regular and Real-Time operating systems:
Regular OS Real-Time OS (RTOS)
Complex Simple
https://prezi.com/p/oqfzyoqtfko0/interrupt-handling-in-rtos/
Watchdog Timer
Watchdog timer is a piece of hardware in micro-controller. Watchdog timer is used to generates
system reset if system gets stuck somewhere i.e. if system goes into endless loop of execution
watchdog timer will reset the system to come out of endless loop. Watchdog is safety
mechanism in embedded system which makes your system reliable, but it depends on how you
make use of watchdog timer.
NAND flash memory has a higher NOR flash memory has a lower density than
density(store more data in a smaller space) NAND Flash
NAND flash memory has a faster read NOR flash memory has faster random
speed. access times than NAND flash memory,
NAND flash memory can survive less NOR flash memory can survive more
erase/write cycles before starting to degrade erase/write cycles before starting to degrade
than NOR than NAND
Free RTOS
FreeRTOS is a market-leading real-time operating system (RTOS) for microcontrollers and
small microprocessors. Distributed freely under the MIT open source license, FreeRTOS
includes a kernel and a growing set of IoT libraries suitable for use across all industry sectors.
FreeRTOS is built with an emphasis on reliability and ease of use.
FreeRTOS provides methods for multiple threads or tasks, mutexes, semaphores and
software timers.
Thread priorities are supported.
FreeRTOS applications can be statically allocated, but objects can also be dynamically
allocated with five schemes of memory management (allocation).
A tickless mode is provided for low power applications.
UNIT 4
Performance analysis
https://rcet.org.in/uploads/academics/rohini_87815623574.pdf
FPGA
https://digilent.com/blog/what-is-an-fpga/
SoC
https://www.ansys.com/en-in/blog/what-is-system-on-a-chip
Debugging
https://epgp.inflibnet.ac.in/epgpdata/uploads/epgp_content/S000007CS/P001072/M023189/E
T/1505901474lect37(1.pdf
https://educationalstuff1.tripod.com/ice.pdf