Embedded Systems
Embedded Systems
The ARM Cortex™-M3 processor, the first of the Cortex generation of processors released by
ARM in 2006, was primarily designed to target the 32-bit microcontroller market. The Cortex-M3
processor provides excellent performance at low gate count and comes with many new features
previously available only in high-end processors. The Cortex-M3 addresses the requirements for
the 32-bit embedded processor market in the following ways:
• Greater performance efficiency: allowing more work to be done without increasing the frequency
or power requirements
• Low power consumption: enabling longer battery life, especially critical in portable products
including wireless networking applications.
Enhanced determinism: guaranteeing that critical tasks and interrupts are serviced as
quickly as possible and in a known number of cycles
• Improved code density: ensuring that code fits in even the smallest memory footprints
• Ease of use: providing easier programmability and debugging for the growing number of 8-bit
and 16-bit users migrating to 32 bits
• Lower cost solutions: reducing 32-bit-based system costs close to those of legacy 8-bit and 16-
bit devices and enabling low-end, 32-bit microcontrollers to be priced at less than US$1 for the
first time
• Wide choice of development tools: from low-cost or free compilers to full-featured development
suites from many development tool vendors.
ARM was formed in 1990 as Advanced RISC Machines Ltd., a joint venture of Apple Computer,
Acorn Computer Group, and VLSI Technology. In 1991, ARM introduced the ARM6 processor
family, and VLSI became the initial licensee. Subsequently, additional companies, including Texas
Instruments, NEC, Sharp, and ST Microelectronics, licensed the ARM processor designs,
extending the applications of ARM processors into mobile phones, computer hard disks, personal
digital assistants (PDAs), home entertainment systems, and many other consumer products.
Architecture Versions:
Over the years, ARM has continued to develop new processors and system blocks. These include the
popular ARM7TDMI processor and, more recently, the ARM1176TZ(F)-S processor, which is used in
high-end applications such as smart phones. The evolution of features and enhancements to the processors
over time has led to successive versions of the ARM architecture. Note that architecture version numbers
are independent from processor names. For example, the ARM7TDMI processor is based on the ARMv4T
architecture (the T is for Thumb® instruction mode support).
Over the past several years, ARM extended its product portfolio by diversifying its CPU
development, which resulted in the architecture version 7 or v7. In this version, the architecture
design is divided into three profiles:
• The R profile is designed for high-end embedded systems in which real-time performance is
needed.
The Thumb-23 technology extended the Thumb Instruction Set Architecture (ISA) into a
highly efficient and powerful instruction set that delivers significant benefits in terms of
ease of use, code size, and performance (see Figure 1). The extended instruction set in
Thumb-2 is a superset of the previous 16-bit Thumb instruction set, with additional 16-bit
instructions alongside 32-bit instructions. It allows more complex operations to be carried
out in the Thumb state, thus allowing higher efficiency by reducing the number of states
switching between ARM state and Thumb state.
Fig.1 the Relationship between the Thumb Instructions Set in Thumb-2 Technology and the Traditional
Thumb
With support for both 16-bit and 32-bit instructions in the Thumb-2 instruction set, there is no need
to switch the processor between Thumb state (16-bit instructions) and ARM state (32-bit
instructions). For example, in ARM7 or ARM9 family processors, you might need to switch to
ARM state if you want to carry out complex calculations or a large number of conditional
operations and good performance is needed, whereas in the Cortex-M3 processor, you can mix 32-
bit instructions with 16-bit instructions without switching state, getting high code density and high
performance with no extra complexity.
The Cortex™-M3 is a 32-bit microprocessor. It has a 32-bit data path, a 32-bit register bank, and
32-bit memory interfaces (see Figure 2). The processor has a Harvard architecture, which means
that it has a separate instruction bus and data bus. This allows instructions and data accesses to
take place at the same time, and as a result of this, the performance of the processor increases
because data accesses do not affect the instruction pipeline. This feature results in multiple bus
interfaces on Cortex-M3, each with optimized usage and the ability to be used simultaneous ly.
However, the instruction and data buses share the same memory space (a unified memory system).
In other words, you cannot get 8 GB of memory space just because you have separate bus
interfaces.
The Cortex-M3 processor is a 32-bit processor, with a 32-bit wide data path, register bank
and memory interface. There are 13 general-purpose registers, two stack pointers, a link
register, a program counter and a number of special registers including a program status
register.
The Cortex-M3 core contains a decoder for traditional Thumb and new Thumb-2
instructions, an advanced ALU with support for hardware multiply and divide, control
logic, and interfaces to the other components of the processor.
The Cortex-M3 processor is a 32-bit processor, with a 32-bit wide data path, register bank
and memory interface. There are 13 general-purpose registers, two stack pointers, a link
register, a program counter and a number of special registers including a program status
register.
The Cortex-M3 processor is a memory mapped system with a simple, fixed memory map
for up to 4 gigabytes of addressable memory space with predefined, dedicated addresses
for code (code space), SRAM(memory space), external memories/devices and
internal/external peripherals. There is also a special region to provide for vendor specific
addressability.
The MPU is an optional component of the Cortex-M3 processor that can improve the
reliability of an embedded system by protecting critical data used by the operating system
from user applications, separating processing tasks by disallowing access to each other's
data, disabling access to memory regions, allowing memory regions to be defined as read-
only and detecting unexpected memory accesses that could potentially break the system.
The highly configurable NVIC is an integral part of the Cortex-M3 processor and provides
the processor’s outstanding interrupt handling abilities. In its standard implementation it
supplies a NonMaskable Interrupt (NMI) and 32 general purpose physical interrupts with
8 levels of pre-emption priority. It can be configured to anywhere between 1 and 240
physical interrupts with up to 256 levels of priority though simple synthesis choices.
The debug access into a Cortex-M3 processor based system is through the Debug Access
Port (DAP) that can be implemented as either a Serial Wire Debug Port (SW-DP) for a
two-pin (clock and data) Interface or a Serial Wire JTAG Debug Port (SWJ-DP) that
enables either JTAG or SW protocol to be used. The SWJ-DP defaults to JTAG mode on
power reset and can be made to switch protocols with a specific control sequence provided
by the external debug hardware.
The Cortex-M3 processor bus matrix connects the processor and debug interface to the external
buses; the 32-bit AMBA® AHB-Lite based ICode, DCode and System interfaces and the 32-bit
AMBA APB™ based Private Peripheral Bus (PPB). The bus matrix also implements unaligned
data accesses and bit banding.
The Cortex-M3 processor has registers R0 through R15. R13 (the stack pointer) is banked, with only
one copy of the R13 visible at a time.
R0–R12: General-Purpose Registers: R0–R12 are 32-bit general-purpose registers for data
operations. Some 16-bit Thumb® instructions can only access a subset of these registers (low registers,
R0–R7).
R13: Stack Pointers : The Cortex-M3 contains two stack pointers (R13). They are banked so that only
one is visible at a time. The two stack pointers are as follows:
• Main Stack Pointer (MSP): The default stack pointer, used by the operating system (OS) kernel and
exception handlers
R14: The Link Register When a subroutine is called, the return address is stored in the link register.
R15: The Program Counter The program counter is the current program address. This register can be
written to control the program flow.
R13 is the stack pointer (SP). In the Cortex-M3 processor, there are two SPs. This duality allows
two separate stack memories to be set up. When using the register name R13, you can only access
the current SP; the other one is inaccessible unless you use special instructions to move to special
register from general-purpose register (MSR) and move special register to general-purpose register
(MRS).
• Main Stack Pointer (MSP) or SP_main in ARM documentation: This is the default SP; it is
used by the operating system (OS) kernel, exception handlers, and all application codes that require
privileged access.
• Process Stack Pointer (PSP) or SP_process in ARM documentation: This is used by the base-
level application code (when not running an exception handler).
In the Cortex-M3, the instructions for accessing stack memory are PUSH and POP. The assembly language
syntax is as follows (text after each semicolon [;] is a comment):
R14 is the link register (LR). Inside an assembly program, you can write it as either R14 or LR.
LR is used to store the return program counter (PC) when a subroutine or function is called—for
example, when you’re using the branch and link (BL) instruction:
R15 is the PC. You can access it in assembler code by either R15 or PC. Because of the pipelined nature of
the Cortex-M3 processor, when you read this register, you will find that the value is different than the
location of the executing instruction, normally by 4.
In other instructions like literal load (reading of a memory location related to current PC value), the effective
value of PC might not be instruction address plus 4 due to alignment in address calculation. But the PC
value is still at least 2 bytes ahead of the instruction address during execution.
Special Registers:
Special registers can only be accessed via MSR and MRS instructions; they do not have memory
addresses:
The Cortex-M3 processor includes an interrupt controller called the Nested Vectored Interrupt
Controller (NVIC). It is closely coupled to the processor core and provides a number of features
as follows:
Nested Interrupt Support: The NVIC provides nested interrupt support. All the external
interrupts and most of the system exceptions can be programmed to different priority levels. When
an interrupt occurs, the NVIC compares the priority of this interrupt to the current running priority
level. If the priority of the new interrupt is higher than the current level, the interrupt handler of
the new interrupt will override the current running task.
Vectored Interrupt Support: The Cortex-M3 processor has vectored interrupt support.
When an interrupt is accepted, the starting address of the interrupt service routine (ISR) is located
from a vector table in memory. There is no need to use software to determine and branch to the
starting address of the ISR. Thus, it takes less time to process the interrupt request.
Reduction of Interrupt Latency: The Cortex-M3 processor also includes a number of advanced
features to lower the interrupt latency. These include automatic saving and restoring some register
contents, reducing delay in switching from one ISR to another, and handling of late arrival
interrupts
Interrupt Masking: Interrupts and system exceptions can be masked based on their priority
level or masked completely using the interrupt masking registers BASEPRI, PRIMASK, and
FAULTMASK. They can be used to ensure that time-critical tasks can be finished on time without
being interrupted.
The Cortex-M3 has a predefined memory map. This allows the built-in peripherals, such as the
interrupt controller and the debug components, to be accessed by simple memory access
instructions. Thus, most system features are accessible in C program code. The predefined memory
map also allows the Cortex-M3 processor to be highly optimized for speed and ease of integration
in system-on-a-chip (SoC) designs.
The Cortex-M3 design has an internal bus infrastructure optimized for this memory usage. In
addition, the design allows these regions to be used differently. For example, data memory can
still be put into the CODE region, and program code can be executed from an external Random
Access Memory (RAM) region.
• System bus
The code memory region access is carried out on the code memory buses, which physically consist
of two buses, one called I-Code and other called D-Code. These are optimized for instruction
fetches for best instruction execution speed. The system bus is used to access memory and
peripherals. This provides access to the Static Random Access Memory (SRAM), peripherals,
external RAM, external devices, and part of the system level memory regions.
The Cortex-M3 supports the Thumb-2 instruction set. This is one of the most important features
of the Cortex-M3 processor because it allows 32-bit instructions and 16-bit instructions to be used
together for high code density and high efficiency. It is flexible and powerful yet easy to use.
In previous ARM processors, the central processing unit (CPU) had two operation states: a 32-bit
ARM state and a 16-bit Thumb state. In the ARM state, the instructions are 32 bits and can execute
all supported instructions with very high performance. In the Thumb state, the instructions are 16
bits, so there is a much higher instruction code density, but the Thumb state does not have all the
functionality of ARM instructions and may require more instructions to complete certain types of
operations.
The Cortex-M3 processor has a number of advantages over traditional ARM processors, such as:
• No state switching overhead, saving both execution time and instruction space
• No need to separate ARM code and Thumb code source files, making software development and
maintenance easier
• It’s easier to get the best efficiency and performance, in turn making it easier to write software,
because there is no need to worry about switching code between ARM and Thumb to try to get the
best density/performance.
The Cortex-M3 processor has a number of interesting and powerful instructions. Here are a few
examples:
• UFBX, BFI, and BFC: Bit field extract, insert, and clear instructions
• WFE, WFI, and SEV: Wait-For-Event, Wait-For-Interrupts, and Send-Event; these allow the
processor to enter sleep mode and to handle task synchronization on multiprocessor systems
• MSR and MRS: Move to special register from general-purpose register and move special register
to general-purpose register; for access to the special registers.
The Cortex-M3 processor implements a new exception model, introduced in the ARMv7-M
architecture. This exception model differs from the traditional ARM exception model, enabling
very efficient exception handling. It has a number of system exception handling. It has a number
of system exceptions plus a number of external Interrupt Request (IRQs) (external interrupt
inputs).
There is no fast interrupt (FIQ) (fast interrupt in ARM7/ARM9/ ARM10/ARM11) in the Cortex-
M3; however, interrupt priority handling and nested interrupt support are now included in the
interrupt architecture. Therefore, it is easy to set up a system that supports nested interrupts (a
higher-priority interrupt can override or preempt a lower-priority interrupt handler) and that
behaves just like the FIQ in traditional ARM processors.
Debugging Support:
The Cortex-M3 processor includes a number of debugging features, such as program execution
controls, including halting and stepping, instruction breakpoints, data watchpoints, registers and
memory accesses, profiling, and traces. The debugging hardware of the Cortex-M3 processor is
based on the CoreSight™ architecture.
Unlike traditional ARM processors, the CPU core itself does not have a Joint Test Action Group
(JTAG) interface. Instead, a debug interface module is decoupled from the core, and a bus interface
called the Debug Access Port (DAP) is provided at the core level. Through this bus interface,
external debuggers can access control registers to debug hardware as well as system memory, even
when the processor is running. The control of this bus interface is carried out by a Debug Port (DP)
device.
The DPs currently available are the Serial-Wire JTAG Debug Port (SWJ-DP) (supports the
traditional JTAG protocol as well as the Serial-Wire protocol) or the SW-DP (supports the Serial-
Wire protocol only). A JTAG-DP module from the ARM CoreSight product family can also be
used. Chip manufacturers can choose to attach one of these DP modules to provide the debug
interface.
Chip manufacturers can also include an Embedded Trace Macrocell (ETM) to allow instruction
trace. Trace information is output via the Trace Port Interface Unit (TPIU), and the debug host
(usually a Personal Computer [PC]) can then collect the executed instruction information via
external trace capturing hardware.
In the Cortex-M3, besides normal software-controlled stack PUSH and POP, the stack PUSH and POP
operations are also carried out automatically when entering or exiting an exception/interrupt handler. In this
section, we examine the software stack operations.
Operation:
In general, stack operations are memory write or read operations, with the address specified by an
SP. Data in registers is saved into stack memory by a PUSH operation and can be restored to
registers later by a POP operation. The SP is adjusted automatically in PUSH and POP so that
multiple data PUSH will not cause old stacked data to be erased.
The function of the stack is to store register contents in memory so that they can be restored later,
after a processing task is completed. For normal uses, for each store (PUSH), there must be a
corresponding read (POP), and the address of the POP operation should match that of the PUSH
operation. When PUSH/POP instructions are used, the SP is incremented/decremented
automatically. When program control returns to the main program, the R0–R2 contents are the
same as before.
Notice the order of PUSH and POP: The POP order must be the reverse of PUSH. These operations
can be simplified, thanks to PUSH and POP instructions allowing multiple load and store. In this
case, the ordering of a register POP is automatically reversed by the processor. You can also
combine RETURN with a POP operation. This is done by pushing the LR to the stack and popping
it back to PC at the end of the subroutine.
Reset Sequence: After the processor exits reset, it will read two words from memory
• Address 0x00000000: Starting value of R13 (the SP)
• Address 0x00000004: Reset vector (the starting address of program execution; LSB should be set to 1 to
indicate Thumb state)
This differs from traditional ARM processor behavior. Previous ARM processors executed program code
starting from address 0x0. Furthermore, the vector table in previous ARM devices was instructions .
Fig3.Reset sequence
FIG.4 Initial Stack Pointer Value and Initial Program Counter Value Example.
In the Cortex-M3, the initial value for the MSP is put at the beginning of the memory map,
followed by the vector table, which contains vector address values. (The vector table can be
relocated to another location later, during program execution.) In addition, the contents of the
vector table are address values not branch instructions. The first vector in the vector table
(exception type 1) is the reset vector, which is the second piece of data fetched by the processor
after reset. Because the stack operation in the Cortex-M3 is a full descending stack (SP decrement
before store), the initial SP value should be set to the first memory after the top of the stack region.
For example, if you have a stack memory range from 0x20007C00 to 0x20007FFF (1 KB), the
initial stack value should be set to 0x20008000.
Assembly basics:
Registers
The Cortex™-M3 processor has registers R0 through R15 and a number of special registers. R0
through R12 are general purpose, but some of the 16-bit Thumb® instructions can only access
R0 through R7 (low registers), whereas 32-bit Thumb-2 instructions can access all these
registers. Special registers have predefined functions and can only be accessed by special register
access instructions.
General Purpose Registers R0 through R7
The R0 through R7 general purpose registers are also called low registers. They can be accessed
by all 16-bit Thumb instructions and all 32-bit Thumb-2 instructions. They are all 32 bits; the
reset value is unpredictable.
General Purpose Registers R8 through R12
The R8 through R12 registers are also called high registers. They are accessible by all Thumb-2
Instructions but not by all 16-bit Thumb instructions. These registers are all 32 bits; the reset
value is unpredictable.
The text after each semicolon (;) is a comment. These comments do not affect the program
operation, but they can make programs easier for humans to understand.
The command to move data between registers is MOV (move). For example, moving data from
register R3 to register R8 looks like this:
MOV R8, R3
Another instruction can generate the negative value of the original data; it is called MVN (move
negative).
The basic instructions for accessing memory are Load and Store.
Load (LDR) : Transfers data from memory to registers, and
Store (STR) : Transfers data from registers to memory.
The exclamation mark (!) in the instruction specifies whether the register Rd should be updated
after the instruction is completed.
For example, if R8 equals 0x8000:
STMIA.W R8!, {R0-R3} ; R8 changed to 0x8010 after store; (increment by 4 words)
ARM processors also support memory accesses with preindexing and postindexing. For
preindexing, the register holding the memory address is adjusted. The memory transfer then
takes place with the updated address. For example,
LDR.W R0,[R1, #offset]! ; Read memory[R1+offset], with R1
; update to R1+offset
Two other types of memory operation are stack PUSH and stack POP. For example,
PUSH {R0, R4-R7, R9} ; Push R0, R4, R5, R6, R7, R9 into stack memory
In this case, instead of popping the LR register back and then branching to the address in LR, we
POP the address value directly in the program counter. The Cortex-M3 has a number of special
registers.
To access these registers, we use the instructions MRS and MSR.
For example,
The Cortex-M3 provides many different instructions for data processing. A few basic ones are
Introduced here. Many data operation instructions can have multiple instruction formats. For
example,an ADD instruction can operate between two registers or between one register and an
immediate data value:
ADD R0, R0, R1 ; R0 = R0 + R1
ADDS R0, R0, #0x12 ; R0 = R0 + 0x12
ADD.W R0, R1, R2 ; R0 = R1 + R2
These are all ADD instructions, but they have different syntaxes and binary coding. With the
traditional Thumb instruction syntax, when 16-bit Thumb code is used, an ADD instruction can
change the flags in the PSR. However, 32-bit Thumb-2 code can either change a flag or keep it
unchanged. To separate the two different operations, the S suffix should be used if the following
operation depends on the flags:
The compare (CMP) instruction subtracts two values and updates the flags (just like SUBS), but
the result is not stored in any registers. CMP can have the following formats:
CMP R0, R1 ; Calculate R0 – R1 and update flag
CMP R0, #0x12 ; Calculate R0 – 0x12 and update flag
A similar instruction is the CMN (compare negative). It compares one value to the negative
(two’s complement) of a second value; the flags are updated, but the result is not stored in any
registers:
CMN R0, R1 ; Calculate R0 – (-R1) and update flag
CMN R0, #0x12 ; Calculate R0 – (-0x12) and update flag
The TST (test) instruction is more like the AND instruction. It ANDs two values and updates the
flags. However, the result is not stored in any register. Similarly to CMP, it has two input
formats:
The usage of CBNZ is similar to CBZ, apart from the fact that the branch is taken if the Z flag is
not set (result is not zero). For example,
status = strchr(email_address, '@');
if (status == 0){//status is 0 if @ is not in email_address
show_error_message();
exit(1);
}
Various software programs are available for developing Cortex-M3 applications. The concepts of
code Generation flow in terms of these tools are similar. For the most basic uses, you will need
assembler, a C compiler, a linker, and binary file generation utilities.
A washing machine from an embedded systems point of view has: a. Hardware: Buttons, Display
& buzzer, electronic circuitry. b. Software: It has a chip on the circuit that holds the software which
drives controls & monitors the various operations possible. c. Mechanical Components: the
internals of a washing machine which actually wash the clothes control the input and output of
water, the chassis itself.
An Air Conditioner from an embedded systems point of view has: a. Hardware: Remote, Display
& buzzer, Infrared Sensors, electronic circuitry. b. Software: It has a chip on the circuit that holds
the software which drives controls & monitors the various operations possible. The software
monitors the external temperature through the sensors and then releases the coolant or suppresses
it. c. Mechanical Components: the internals of an air conditioner the motor, the chassis, the outlet,
etc An embedded system is designed to do a specific job only.
Example: a washing machine can only wash clothes, an air conditioner can control the
temperature in the room in which it is placed.
The hardware & mechanical components will consist all the physically visible things that are used
for input, output, etc. An embedded system will always have a chip (either microprocessor or
microcontroller) that has the code or software which drives the system
The Embedded System and the General purpose computer are at two extremes. The embedded
system is designed to perform a specific task whereas as per definition the general purpose
computer is meant for general use. It can be used for playing games, watching movies, creating
software, work on documents or spreadsheets etc. Following are certain specific points that
differenciates between embedded systems and general purpose computers:
On generation
On complexity & performance
On deterministic behavior
On triggering
On generation:
4. Fourth generation:
2. Medium-scale:
3. Large-scale:
On deterministic behavior:
The application areas and the products in the embedded domain are countless.
4. Home automation & security systems: Air conditioners, sprinklers, fire alarms.
1. Data Collection/Storage/Representation
Embedded system designed for the purpose of data collection performs acquisition
of data from the external world.
Data collection is usually done for storage, analysis, manipulation and
transmission.
Data can be analog or digital.
Embedded systems with analog data capturing techniques collect data directly in
the form of analog signal whereas embedded systems with digital data collection
mechanism converts the analog signal to the digital signal using analog to digital
converters.
If the data is digital it can be directly captured by digital embedded system.
A digital camera is a typical example of an embedded System with data
collection/storage/representation of data.
Images are captured and the captured image may be stored within the memory of
the camera. The captured image can also be presented to the user through a graphic
LCD unit.
2. Data communication
Embedded data communication systems are deployed inapplications from complex
satellite communication to simple home networking systems.
The transmission of data is achieved either by a wire-lin medium or by a wire-less
medium. Data can either be transmitted by analog means or by digital means.
Wireless modules-Bluetooth, Wi-Fi.
Wire-line modules-USB, TCP/IP.
Network hubs, routers, switches are examples of dedicated data transmission
embedded systems.
4. Monitoring
All embedded products coming under the medical domain are with monitoring
functions. Electro cardiogram machine is intended to do the monitoring of the
heartbeat of a patient but it cannot impose control over the heartbeat.
Other examples with monitoring function are digital CRO, digital multi-meters, and
logic analyzers.
5. Control
A system with control functionality contains both sensors and actuators Sensors are
connected to the input port for capturing the changes in environmental variable and
the actuators connected to the output port are controlled according to the changes
in the input variable.
Air conditioner system used to control the room temperature to a specified limit is
a typical example for CONTROL purpose.
Embedded systems are domain and application specific and are built around a central core. The
core of the embedded system falls into any of the following categories:
Microprocessors
Developers of microprocessors.
Microcontrollers
A microcontroller is a highly integrated chip that contains aCPU, scratch pad RAM, special
and general purpose register arrays,on chip ROM/FLASH memory for program storage ,
timer and interrupt control units and dedicated I/O ports.
Texas Instrument’s TMS 1000 Is considered as the world’s first microcontroller.
Some embedded system application require only 8 bit controllers whereas some requiring
superior performance and computational needs demand 16/32 bit controllers.
The instruction set of a microcontroller can be RISC or CISC.
Microcontrollers are designed for either general purpose application requirement or
domain specific application requirement.
DSP are powerful special purpose 8/16/32 bit microprocessor designed to meet the
computational demands and power constraints of today’s embedded audio, video and
communication applications. DSP are 2 to 3 times faster than general purpose
microprocessors in signal processing applications.
This is because of the architectural difference between DSP and general purpose
microprocessors.
DSPs implement algorithms in hardware which speeds up the execution whereas general
purpose processor implement the algorithm in software and the speed of execution depends
primarily on the clock for the processors.
DSP includes following key units:
i. Program memory: It is a memory for storing the program required by DSP to process
the data. ii. Data memory: It is a working memory for storing temporary variables and
data/signal to be processed.
iii. Computational engine: It performs the signal processing in accordance with the stored
program memory computational engine incorporated many specialized arithmetic units and
each of them operates simultaneously to increase the execution speed. It also includes
multiple hardware shifters for shifting operands and saves execution time.
iv. I/O unit: It acts as an interface between the outside world and DSP. It is responsible for
capturing signals to be processed and delivering the processed signals.
Examples: Audio video signal processing, telecommunication and multimedia
applications. SOP(Sum of Products) calculation, convolution, FFT(Fast Fourier
Transform), DFT(Discrete Fourier Transform), etc are some of the operation performed by
DSP.
A PLD is an electronic component. It used to build digital circuits which are reconfigurable.
A logic gate has a fixed function but a PLD does not have a defined function at the time of
manufacture.
PLDs offer customers a wide range of logic capacity, features, speed, voltage
characteristics. PLDs can be reconfigured to perform any number of functions at any time.
A variety of tools are available for the designers of PLDswhich are inexpensive and help
to develop, simulate and test the designs.
Advantages of PLDs :- 1) PLDs offer customer much more flexibility during the design
cycle.
2) PLDs do not require long lead times for prototypes or production parts because PLDs
are already on a distributors shelf and ready for shipment.
3) PLDs can be reprogrammed even after a piece of equipment is shipped to a customer
3) The major advantage of using COTS is that they are readily available in the market, are
chip and a developer can cut down his/her development time to a great extent
4) The major drawback of using COTS components in embedded design is that the
manufacturer of the COTS component may withdraw the product or discontinue the
production of the COTS at any time if rapid change in technology occurs.
Advantages of COTS:
1) Ready to use
2) Easy to integrate
3) Reduces development time
Disadvantages of COTS:
1) No operational or manufacturing standard (all proprietary)
2) Vendor or manufacturer may discontinue production of a particular COTS product
Sensor
It is a transducer that converts energy from one form to another for any measurement or
control purpose Ex. A Temperature sensor
Actuator
Actuator is used for output. It is a transducer that may be either mechanical or electrical which
converts signals to corresponding physical actions.
LED is a p-n junction diode and contains a CATHODE and ANODE For functioning the anode
is connected to +ve end of power supply and cathode is connected to –ve end of power supply.
The maximum current flowing through the LED is limited by connecting a RESISTOR in series
between the power supply and LED as shown in the figure below
1. The Anode of LED is connected to the port pin and cathode to Ground : In this approach the
port pin sources the current to the LED when it is at logic high(ie. 1).
2. The Cathode of LED is connected to the port pin and Anode to Vcc : In this approach the port
pin sources the current to the LED when it is at logic high (ie. 1). Here the port pin sinks the current
and the LED is turned ON when the port pin is at Logic low (ie. 0)
7-segment display:
The seven elements of the display can be lit in different combinations to represent the Arabic
numerals. Often the seven segments are arranged in an oblique (slanted) arrangement, which aids
readability. In most applications, the seven segments are of nearly uniform shape and size (usually
elongated hexagons, though trapezoids and rectangles can also be used), though in the case
of adding machines, the vertical segments are longer and more oddly shaped at the ends in an effort
to further enhance readability.
The numerals 6 and 9 may be represented by two different glyphs on seven-segment displays, with
or without a 'tail'.[2][3] The numeral 7 also has two versions, with or without segment F. [4]
The seven segments are arranged as a rectangle of two vertical segments on each side with one
horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the
rectangle horizontally. There are also fourteen-segment displays and sixteen-segment
displays (for full alphanumerics); however, these have mostly been replaced by dot matrix
displays. Twenty-two segment displays capable of displaying the full ASCII character set[5] were
briefly available in the early 1980s, but did not prove popular.
The segments of a 7-segment display are referred to by the letters A to G, where the
optional decimal point (an "eighth segment", referred to as DP) is used for the display of non-
integer numbers.
Optical coupler:
An optical coupler, also called opto-isolator, optocoupler, opto coupler, photocoupler or optical
isolator, is a passive optical component that can combine or split transmission data (optical power)
from optical fibers. It is an electronic device which is designed to transfer electrical signals by
using light waves in order to provide coupling with electrical isolation between its input and output.
The main purpose of an optocoupler is to prevent rapidly changing voltages or high voltages on
one side of a circuit from distorting transmissions or damaging components on the other side of
the circuit. An optocoupler contains a light source often near an LED which converts electrical
input signal into light, a closed optical channel and a photosensor, which detects incoming light
and either modulates electric current flowing from an external power supply or generates electric
energy directly. The sensor can either be a photoresistor, a silicon-controlled rectifier, a
photodiode, a phototransistor or a triac.
Relay :
Magnetic latching relays require one pulse of coil power to move their contacts in one direction,
and another, redirected pulse to move them back. Repeated pulses from the same input have no
effect. Magnetic latching relays are useful in applications where interrupted power should not be
able to transition the contacts.
Magnetic latching relays can have either single or dual coils. On a single coil device, the relay will
operate in one direction when power is applied with one polarity, and will reset when the polarity
is reversed. On a dual coil device, when polarized voltage is applied to the reset coil the contacts
will transition. AC controlled magnetic latch relays have single coils that employ steering diodes
to differentiate between operate and reset commands.
Buzzer :
Types of Buzzers
There are several different kinds of buzzers. At Future Electronics we stock many of the most
common types categorized by Type, Sound Level, Frequency, Rated Voltage, Dimension and
Packaging Type. The parametric filters on our website can help refine your search results
depending on the required specifications.
The most common sizes for Sound Level are 80 dB, 85 dB, 90 dB and 95 dB. We also carry buzzers
with Sound Level up to 105 dB. There are several types available including Electro-Acoustic,
Electromagnetic, Electromechanic, Magnetic and Piezo, among others.
Game shows
Sporting events
Household appliances
A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for
controlling some aspect of a machine or a process. Buttons are typically made out of hard material,
usually plastic or metal.[1] The surface is usually flat or shaped to accommodate the human finger
or hand, so as to be easily depressed or pushed. Buttons are most often biased switches, although
many un-biased buttons (due to their physical nature) still require a spring to return to their un-
pushed state. Terms for the "pushing" of a button include pressing, depressing, mashing, hitting,
and punching. The "push-button" has been utilized in calculators, push-button telephones, kitchen
appliances, and various other mechanical and electronic devices, home and commercial.
In industrial and commercial applications, push buttons can be connected together by a mechanical
linkage so that the act of pushing one button causes the other button to be released. In this way, a
stop button can "force" a start button to be released. This method of linkage is used in simple
manual operations in which the machine or process has no electrical circuits for control.
Red pushbuttons can also have large heads (called mushroom heads) for easy operation and to
facilitate the stopping of a machine. These pushbuttons are called emergency stop buttons and for
increased safety are mandated by the electrical code in many jurisdictions. This large mushroom
shape can also be found in buttons for use with operators who need to wear glovesfor their work
and could not actuate a regular flush-mounted push button.
For any embedded system, the communication interfaces can broadly classified into:
1. Onboard Communication Interfaces :These are used for internal communication of the
embedded system i.e: communication between different components present on the system.
1-Wire Interface
Parallel Interface
I2C was originally developed in 1982 by Philips for various Philips chips. The original spec
allowed for only 100kHz communications, and provided only for 7-bit addresses, limiting the
number of devices on the bus to 112 (there are several reserved addresses, which will never be
used for valid I2C addresses). In 1992, the first public specification was published, adding a
400kHz fast-mode as well as an expanded 10-bit address space. Much of the time (for instance, in
the ATMega328 device on many Arduino-compatible boards) , device support for I 2C ends at this
point. There are three additional modes specified: fast-mode plus, at 1MHz; high-speed mode, at
3.4MHz; and ultra-fast mode, at 5MHz.
Each I2C bus consists of two signals: SCL and SDA. SCL is the clock signal, and SDA is the data
signal. The clock signal is always generated by the current bus master; some slave devices may
force the clock low at times to delay the master sending more data (or to require more time to
prepare data before the master attempts to clock it out). This is called “clock stretching” and is
described on the protocol page.
Unlike UART or SPI connections, the I2C bus drivers are “open drain”, meaning that they can
pull the corresponding signal line low, but cannot drive it high. Thus, there can be no bus
contention where one device is trying to drive the line high while another tries to pull it low,
eliminating the potential for damage to the drivers or excessive power dissipation in the
system.Each signal line has a pull-up resistor on it, to restore the signal to high when no device is
asserting it low.
Serial Peripheral Interface, or SPI, is a very common communication protocol used for two-way
communication between two devices. A standard SPI bus consists of 4
signals, Master Out Slave In (MOSI), Master In Slave Out (MISO), the clock (SCK),
and Slave Select (SS). Unlike an asynchronous serial interface, SPI is not symmetric. An SPI bus
has one master and one or more slaves. The master can talk to any slave on the bus, but each slave
can only talk to the master. Each slave on the bus must have it's own unique slave select signal.
The master uses the slave select signals to select which slave it will be talking to. Since SPI also
includes a clock signal, both devices don't need to agree on a data rate beforehand. The only
requirement is that the clock is lower than the maximum frequency for all devices involved.
Each SPI transfer is full-duplex, meaning that data is sent from the master to the slave and from
the slave to the master at the same time. There is no way for a slave to opt-out of sending data
when the master makes a transfer, however, devices will send dummy bytes (usually all 1's or all
0's) when communication should be one way. If the master is reading data in for a slave, the slave
will know to ignore the data being sent by the master.
Devices that use SPI typically will send/receive multiple bytes each time the SS signal goes low.
This way the SS signal acts as a way to frame a transmission. For example, if you had a flash
memory that had an SPI bus and you want to read some data, the SS signal would go low, the
master would send the command to read memory at a certain address, and as long as the master
kept SS low and toggling SCK the flash memory would keep sending out data. Once SS returned
high the flash memory knows to end the read command.
Since the MISO signal can be connected to multiple devices, each device will only drive the line
when its SS signal is low. This is shown by the grey area.
Advantages of SPI:
Disadvantages of SPI:
The communications must be well-defined in advance (you can’t send random amounts
of data whenever you want)
The master must control all communications (slaves can’t talk directly to each other)
It usually requires separate SS lines to each slave, which can be problematic if numerous
slaves are needed.
UART
In UART communication, two UARTs communicate directly with each other. The transmitting
UART converts parallel data from a controlling device like a CPU into serial form, transmits it in
serial to the receiving UART, which then converts the serial data back into parallel data for the
receiving device. Only two wires are needed to transmit data between two UARTs. Data flows
from the Tx pin of the transmitting UART to the Rx pin of the receiving UART:
UARTs transmit data asynchronously, which means there is no clock signal to synchronize the
output of bits from the transmitting UART to the sampling of bits by the receiving UART. Instead
of a clock signal, the transmitting UART adds start and stop bits to the data packet being
transferred. These bits define the beginning and end of the data packet so the receiving UART
knows when to start reading the bits.
When the receiving UART detects a start bit, it starts to read the incoming bits at a
specific frequency known as the baud rate. Baud rate is a measure of the speed of data
transfer, expressed in bits per second (bps). Both UARTs must operate at about the same baud rate.
The baud rate between the transmitting and receiving UARTs can only differ by about 10% before
the timing of bits gets too far off.
1-wire interface:
A 1994 application note explained that the only serial-port interface options for 1-Wire devices
were microcontroller port pins, UARTs, and UART-based COM ports. Since that time special
driver chips have been developed for direct connection to a UART, I²C bus, or USB port.
Meanwhile, the number of 1-Wire devices also grew to a long list.These various developments
made it necessary to update the earlier documentation. Instead of merging the specifics of all
relevant information into a single document, this new document refers the reader to other
application notes whenever possible.
The first 1-Wire devices, the DS199x series, were produced in SRAM technology. Next the
nonvolatile EPROM technology became available, and the DS198x and DS250x series devices
were released. These EPROM devices need a 12V programming pulse and are not erasable. The
next leap forward was EEPROM technology, which allows programming and erasing at 5V or
less. EEPROM technology is found in DS197x, DS243x and DS28Exx series devices. To ensure
proper power, EEPROM devices may need a master that supports "strong pullup", a feature that
temporarily bypasses the 1-Wire pullup resistor with a low-impedance path. The extra power is
needed for write cycles and, in case of the DS1977, also for reading. Besides EEPROM devices,
the strong pullup also powers 1-Wire temperature sensors and special functions such as a SHA-1
engine, which is found in secure 1-Wire devices. Temperature logger iButtons® use SRAM
technology and, therefore, do not have any special, external power requirements.
General Information:
1-Wire is the only voltage-based digital system that works with two contacts, data and ground, for
half-duplex bidirectional communication. A 1-Wire system consists of a single 1-Wire master and
one or more 1-Wire slaves. The 1-Wire concept relies both on a master that initiates digital
communication, and on self-timed 1-Wire slave devices that synchronize to the master's signal.
The timing logic of master and slave must measure and generate digital pulses of various widths.
When idle, a high-impedance path between the 1-Wire bus and the operating voltage puts the 1-
Wire bus in the logic-high state. Each device on the bus must be able to pull the 1-Wire bus low
at the appropriate time by using an open-drain output (wired AND). If a transaction needs to be
suspended for any reason, the bus must be left in the idle state so the transaction can resume.
Parallel port:
A parallel port is a type of interface found on computers (personal and otherwise) for connecting
peripherals. The name refers to the way the data is sent; parallel ports send multiple bits of data at
once, in parallel communication, as opposed to serial interfaces that send bits one at a time. To do
this, parallel ports require multiple data lines in their cables and port connectors, and tend to be
larger than contemporary serial ports which only require one data line.
There are many types of parallel ports, but the term has become most closely associated with
the printer port or Centronics port found on most personal computers from the 1970s through the
2000s. It was an industry de factostandard for many years, and was finally standardized as IEEE
1284 in the late 1990s, which defined the Enhanced Parallel Port (EPP) and Extended Capability
Port (ECP) bi-directional versions. Today, the parallel port interface is virtually non-existent
because of the rise of Universal Serial Bus (USB) devices, along with network printing
using Ethernet and Wi-Fi connected printers.
The parallel port interface was originally known as the Parallel Printer Adapter on IBM PC-
compatible computers. It was primarily designed to operate printers that used IBM's eight-
bit extended ASCII character set to print text, but could also be used to adapt other peripherals.
Graphical printers, along with a host of other devices, have been designed to communicate with
the system.
An RS-232 serial port was once a standard feature of a personal computer, used for connections
to modems, printers, mice, data storage, uninterruptible power supplies, and other peripheral
devices. RS-232, when compared to later interfaces such as RS-422, RS-485 and Ethernet, has
lower transmission speed, short maximum cable length, large voltage swing, large standard
connectors, no multipoint capability and limited multidrop capability. In modern personal
computers, USBhas displaced RS-232 from most of its peripheral interface roles. Many computers
no longer come equipped with RS-232 ports (although some motherboards come equipped with a
COM port header that allows the user to install a bracket with a DE-9 port) and must use either an
external USB-to-RS-232 converter or an internal expansion card with one or more serial ports to
connect to RS-232 peripherals. Nevertheless, thanks to their simplicity and past ubiquity, RS-232
interfaces are still used—particularly in industrial machines, networking equipment, and scientific
instruments where a short-range, point-to-point, low-speed wired data connection is adequate.
USB:
USB, short for Universal Serial Bus, is a standard type of connection for many different kinds of
devices. Generally, USB refers to the types of cables and connectors used to connect these many
types of external devices to computers.
The Universal Serial Bus standard has been extremely successful. USB ports and cables are used
to connect hardware such as printers, scanners, keyboards, mice, flash drives, external hard drives,
joysticks, cameras, and more to computers of all kinds, including desktops, tablets, laptops,
netbooks, etc.
In fact, USB has become so common that you'll find the connection available on nearly any
computer-like device such as video game consoles, home audio/visual equipment, and even in
many automobiles.
Many portable devices, like smartphones, ebook readers, and small tablets, use USB primarily for
charging. USB charging has become so common that it's now easy to find replacement electrical
outlets at home improvement stores with USB ports built it, negating the need for a USB power
adapter.
USB Versions
There have been three major USB standards, 3.1 being the newest:
USB 3.1: Called Superspeed+, USB 3.1 compliant devices are able to transfer data at 10
Gbps (10,240 Mbps).
USB 3.0: Called SuperSpeed USB, USB 3.0 compliant hardware can reach a maximum
transmission rate of 5 Gbps (5,120 Mbps).
USB 2.0: Called High-Speed USB, USB 2.0 compliant devices can reach a maximum
transmission rate of 480 Mbps.
USB 1.1: Called Full Speed USB, USB 1.1 devices can reach a maximum transmission rate
of 12 Mbps.
Most USB devices and cables today adhere to USB 2.0, and a growing number to USB 3.0.
Important: The parts of a USB-connected system, including the host (like a computer), the cable,
and the device, can all support different USB standards so long as they are physically compatible.
However, all parts must support the same standard if you want it to achieve the maximum data rate
possible.
IEEE1394:
IEEE 1394, High Performance Serial Bus, is an electronics standard for connecting devices to your
personal computer. IEEE 1394 provides a single plug-and-socket connection on which up to 63
devices can be attached with data transfer speeds up to 400 Mbps ( megabit s per second). The
standard describes a serial bus or pathway between one or more peripheral devices and your
computer's microprocessor . Many peripheral devices now come equipped to meet IEEE 1394.
Two popular implementations of IEEE 1394 are Apple's FireWire and Sony's i.LINK . IEEE 1394
implementations provide:
A simple common plug-in serial connector on the back of your computer and on many different
types of peripheral devices
A thin serial cable rather than the thicker parallel cable you now use to your printer, for example
A very high-speed rate of data transfer that will accommodate multimedia applications (100
and 200 megabits per second today; with much higher rates later)
Hot-plug and plug and play capability without disrupting your computer
The ability to chain devices together in a number of different ways without terminators or
complicated set-up requirements
Working
There are two levels of interface in IEEE 1394, one for the backplane bus within the computer and
another for the point-to-point interface between device and computer on the serial cable. A simple
bridge connects the two environments. The backplane bus supports 12.5, 25, or 50 megabits per
second data transfer. The cable interface supports 100, 200, or 400 megabits per second. Each of
these interfaces can handle any of the possible data rates and change from one to another as needed.
IrDA
Bluetooth
Bluetooth is a wireless technology standard for exchanging data over short distances (using short-
wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile
devices, and building personal area networks(PANs). Invented by telecom vendor Ericsson in
1994, it was originally conceived as a wireless alternative to RS-232data cables.
Bluetooth is managed by the Bluetooth Special Interest Group (SIG), which has more than 30,000
member companies in the areas of telecommunication, computing, networking, and consumer
electronics.[5] The IEEE standardized Bluetooth as IEEE 802.15.1, but no longer maintains the
standard. The Bluetooth SIG oversees development of the specification, manages the qualification
program, and protects the trademarks. [6] A manufacturer must meet Bluetooth SIG standards to
market it as a Bluetooth device.
Bluetooth operates at frequencies between 2402 and 2480 MHz, or 2400 and 2483.5 MHz
including guard bands 2 MHz wide at the bottom end and 3.5 MHz wide at the top. [15] This is in
the globally unlicensed (but not unregulated) industrial, scientific and medical (ISM) 2.4 GHz
short-range radio frequency band. Bluetooth uses a radio technology called frequency-hopping
spread spectrum. Bluetooth divides transmitted data into packets, and transmits each packet on one
of 79 designated Bluetooth channels. Each channel has a bandwidth of 1 MHz. It usually performs
800 hops per second, with Adaptive Frequency-Hopping (AFH) enabled. Bluetooth Low
Energy uses 2 MHz spacing, which accommodates 40 channels.
Originally, Gaussian frequency-shift keying (GFSK) modulation was the only modulation scheme
available. Since the introduction of Bluetooth 2.0+EDR, π/4-DQPSK(differential quadrature phase
shift keying) and 8DPSK modulation may also be used between compatible devices. Devices
functioning with GFSK are said to be operating in basic rate (BR) mode where an instantaneous bit
rate of 1 Mbit/s is possible. The term Enhanced Data Rate (EDR) is used to describe π/4-DPSK
and 8DPSK schemes, each giving 2 and 3 Mbit/s respectively. The combination of these (BR and
EDR) modes in Bluetooth radio technology is classified as a "BR/EDR radio".
Wifi :
Wi-Fi is a technology for wireless local area networking with devices based on the IEEE
802.11standards. Wi-Fi is a trademark of the Wi-Fi Alliance, which restricts the use of the
term Wi-Fi Certified to products that successfully complete interoperability certification testing.
Devices that can use Wi-Fi technology include personal computers, video-game
consoles, phones and tablets, digital cameras, smart TVs, digital audio players and modern
printers. Wi-Fi compatible devices can connect to the Internet via a WLAN and a wireless access
point. Such an access point (or hotspot) has a range of about 20 meters (66 feet) indoors and a
greater range outdoors. Hotspot coverage can be as small as a single room with walls that block
radio waves, or as large as many square kilometres achieved by using multiple overlapping access
points.
Wi-Fi most commonly uses the 2.4 gigahertz (12 cm) UHF and 5.8 gigahertz
(5 cm) SHF ISM radio bands. Anyone within range with a wireless modem can attempt to access
the network; because of this, Wi-Fi is more vulnerable to attack (called eavesdropping) than wired
Zigbee :
The technology defined by the Zigbee specification is intended to be simpler and less expensive
than other wireless personal area networks (WPANs), such as Bluetooth or more general wireless
networking such as Wi-Fi. Applications include wireless light switches, home energy monitors,
traffic management systems, and other consumer and industrial equipment that requires short-
range low-rate wireless data transfer.
Its low power consumption limits transmission distances to 10–100 meters line-of-sight ,
depending on power output and environmental characteristics. Zigbee devices can transmit data
over long distances by passing data through a mesh network of intermediate devices to reach more
distant ones. Zigbee is typically used in low data rate applications that require long battery life and
secure networking (Zigbee networks are secured by 128 bit symmetric encryption keys.) Zigbee
has a defined rate of 250 kbit/s, best suited for intermittent data transmissions from a sensor or
input device.
Zigbee was conceived in 1998, standardized in 2003, and revised in 2006. The name refers to
the waggle dance of honey bees after their return to the beehive.
Industrial control
Embedded sensing
Medical data collection
Smoke and intruder warning
Building automation
Remote wireless microphone configuration, in Shure Wireless Microphone Systems [13]
GPRS usage is typically charged based on volume of data transferred, contrasting with circuit
switched data, which is usually billed per minute of connection time. Sometimes billing time
is broken down to every third of a minute. Usage above the bundle cap is charged per
megabyte, speed limited, or disallowed.
GPRS is a best-effort service, implying variable throughput and latency that depend on the
number of other users sharing the service concurrently, as opposed to circuit switching, where
a certain quality of service (QoS) is guaranteed during the connection. In 2G systems, GPRS
provides data rates of 56–114 kbit/second.[ 2G cellular technology combined with GPRS is
sometimes described as 2.5G, that is, a technology between the second (2G) and third (3G)
generations of mobile telephony. It provides moderate-speed data transfer, by using
unused time division multiple access (TDMA) channels in, for example, the GSM system.
GPRS is integrated into GSM Release 97 and newer releases.
MEMORIES
There are different types of memories available to be used in computers as well as embedded
system. This chapter guides the reader through the different types of memories that are available
and can be used and tries to explain their differences in simple words.
TYPES OF MEMORY
It is non-volatile memory, i.e. the contents are retained even after electricity is switched off
and available after it is switched on. Data access to ROM is slow compared to RAM.
Like RAM the contents to hybrid memory can be read and written Like ROM the contents
of hybrid memory are non volatile
TYPES OF RAM
If the power is turned off then its contents will be lost forever.
DRAM has extremely short Data lifetime(usually less than a quarter of second).
c) The DRAM controller periodically refreshes the data stored in the DRAM. By
refreshing the data several times a second, the DRAM controller keeps the contents
of memory alive for a long time.
TYPES OF ROM
Masked ROM
b. (it is just like an Audio CD that contains songs pre-written on it and does not allow to
write any other data)
a) This memory device comes in an un-programmed state i.e. at the time of purchased it is
in an un-programmed state and it allows the user to write his/her own program or code into
this ROM.
b) In the un-programmed state the data is entirely made up of 1’s. c) PROMs are also
known as one-time-programmable (OTP) device because any data can be written on it only
once. If the data on the chip has some error and needs to be modified this memory chip has
to be discarded and the modified data has to be written to another new PROM.
c) The erase operation in case of an EPROM is performed by exposing the chip to a source
of ultraviolet light.
Flash
b. Flash memory devices are high density, low cost, nonvolatile, fast (to read, but not to
write), and electrically reprogrammable.
c. Flash is much more popular than EEPROM and is rapidly displacing many of the ROM
devices.
d. Flash devices can be erased only one sector at a time, not byte by byte.
NVRAM
b. When power is turned on, the NVRAM operates just like any other SRAM but when
power is off, the NVRAM draws enough electrical power from the battery to retain its
content.
DMA is a technique for transferring blocks of data directly between two hardware
devices. In the absence of DMA the processor must read the data from one device and
write it to the other one byte or word at a time. DMA Absence Disadvantage: If the amount
of data to be transferred is large or frequency of transfer is high the rest of the software
might never get a chance to run.
DMA Presence Advantage: The DMA Controller performs entire transfer with little help
from the Processor. Working of DMA The Processor provides the DMA Controller with
source and destination address & total number of bytes of the block of data which needs
transfer. After copying each byte each address is incremented & remaining bytes are
reduced by one. When number of bytes reaches zeros the block transfer ends & DMA
Controller sends an Interrupt to Processor.
EMBEDDED FIRMWARE
Embedded firmware is the flash memory chip that stores specialized software running in a chip in
an embedded device to control its functions.
Firmware in embedded systems fills the same purpose as a ROM but can be updated more easily
for better adaptability to conditions or interconnecting with additional equipment.
Hardware makers use embedded firmware to control the functions of various hardware devices
and systems much like a computer’s operating system controls the function of software
applications. Embedded firmware exists in everything from appliances so simple you might not
imagine they had computer control, like toasters, to complex tracking systems in missiles. The
toaster would likely never need updating but the tracking system sometimes does. As the
complexity of a device increases, it often makes sense to use firmware in case of design errors that
an update might correct.
Embedded firmware is used to control the limited, set functions of hardware devices and systems
of greater complexity but still gives more appliance-like usage instead of a series of terminal
commands. Embedded firmware functions are activated by external controls or external actions of
the hardware. Embedded firmware and ROM-based embedded software often have
communication links to other devices for functionality or to address the need for the device to be
adjusted, calibrated or diagnosed or to output log files. It is also through these connections that
someone might attempt embedded device hacking.
Other components :
Reset circuit:
Microprocessors are complex, state-driven devices that must start up in a consistent way to
function properly. You can establish proper processor operation by supplying a reset input
that is normally asserted until the system is ready to execute the boot-up firmware. When the
reset signal is deasserted, some subset of the processor's registers (depending on the specific
chip) will be initialized to default values and the processor will start executing from fixed
location (also specific to the chip). It's crucial to design this reset circuit properly to avoid
system lockup, erratic processor operation, and possible corruption of your nonvolatile
memory.
This is all complex enough that many companies now offer integrated circuit reset devices,
commonly referred to as "reset supervisors." Good design practice suggests using these reset
supervisors for most embedded systems because designing discrete reset circuitry is beyond
the expertise of many embedded systems engineers. My personal experience has led me to
rely on reset supervisors exclusively and ignore the various RC, transistor, and diode networks
that are scattered throughout data books and shown in "example" circuits.
Brownout Protection
Brownout protection inbuilt in them but when connecting a controller to an industry sensor and
controlling devices(which are extremely costly) its better we know what is a brownout and how is
it detected in a microcontroller cause many devices in low to medium scale industry may not be
as immune to brownout as our controller. The brown out can cause one of the three things for a dc
supply system. These things in turn can damage the connected embedded systems.
1. An unregulated direct current supply will produce a lower output voltage for
electronic circuits. The output ripple voltage will decrease in line with the usually reduced
load current.
2. A linear direct current regulated supply will maintain the output voltage unless the
brownout is severe and the input voltage drops below the drop out voltage for the regulator,
at which point the output voltage will fall and high levels of ripple from the
rectifier/reservoir capacitor will appear on the output.
3. A switched-mode power supply which has a regulated output will be affected. As
the input voltage falls, the current draw will increase to maintain the same output voltage
and current, until such a point that the power supply malfunctions.
Oscillator circuit :
The majority of clock sources for microcontrollers can be grouped into two types: those
based on mechanical resonant devices, such as crystals and ceramic resonators, and those
based on electrical phase-shift circuits such as RC (resistor, capacitor) oscillators. Silicon
oscillators are typically a fully integrated version of the RC oscillator with the added
benefits of current sources, matched resistors and capacitors, and temperature-
compensation circuits for increased stability.
These modules contain all oscillator circuit components and provide a clock signal as a
low-impedance square-wave output. Operation is guaranteed over a range of conditions.
Crystal oscillator modules and fully integrated silicon oscillators are most common. Crystal
oscillator modules provide accuracy similar to discrete component circuits using crystals.
Silicon oscillators are more precise than discrete component RC oscillator circuits, and
many provide comparable accuracy to ceramic resonator-based oscillators.
RTC
A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that
keeps track of the current 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. A
common RTC used in single-board computers is the DS1307.
Although keeping time can be done without an RTC,[1] using one has benefits:
RTCs are widely used in many different devices which need accurate time keeping.
Real-time clocks normally have batteries attached to them that have very long life.
Therefore, the batteries last a very long time, several years. The battery keeps the RTC
operating, even when there is no power to the microcontroller that is connected up to. So
even if the microcontroller powers off, the RTC can keep operating due to its battery.
Therefore, it can always keep track of the current time and have accurate time, ongoing.
An RTC maintains its clock by counting the cycles of an oscillator – usually an external 32.768kHz
crystal oscillator circuit, an internal capacitor based oscillator, or even an embedded quartz crystal.
Some can detect transitions and count the periodicity of an input that may be connected.
This can enable an RTC to sense the 50/60Hz ripple on a mains power supply, or detect and
accumulate transitions coming from a GPS unit epoch tick. An RTC that does this operates like a
phase locked loop (PLL), shifting its internal clock reference to ‘lock’ it onto the external signal.
If the RTC loses its external reference, it can detect this event (as its PLL goes out of lock) and
free run from its internal oscillator.
WDT is a hardware timer that automatically generates a system reset if the main program
neglects to periodically service it. It is often used to automatically reset an embedded device
that hangs because of a software or hardware fault. Some systems may also refer to it as a
computer operating properly (COP) timer. Many microcontrollers including the embedded
processor have watchdog timer hardware.
The main program typically has a loop that it constantly goes through performing various
functions. The watchdog timer is loaded with an initial value greater than the worst case time
delay through the main program loop. Each time it goes through the main loop the code resets
the watchdog timer (sometimes called “kicking” or “feeding” the dog). If a fault occurs and the
main program does not get back to reset the timer before it counts down, an interrupt is
generated to reset the processor. Used in this way, the watchdog timer can detect a fault on an
unattended embedded device and attempt corrective action with a reset. Typically after reset, a
register can also be read to determine if the watchdog timer generated the reset or if it was a
normal reset. On the mbed this register is called the Reset Source Identification Register
(RSID).
The characteristics of embedded system are different from those of a general purpose computer and so
are its Quality metrics. This chapter gives a brief introduction on the characteristics of an embedded
system and the attributes that are associated with its quality.
Following are some of the characteristics of an embedded system that make it different from a
general purpose computer:
1. Application and Domain specific
An embedded system is designed for a specific purpose only. It will not do any other task.
Ex. A washing machine can only wash, it cannot cook
Certain embedded systems are specific to a domain: ex. A hearing aid is an application that
belongs to the domain of signal processing.
These are the attributes that together form the deciding factor about the quality of an embedded
system.
There are two types of quality attributes are:-
1. Operational Quality Attributes.
These are attributes related to operation or functioning of an embedded system. The way
an embedded system operates affects its overall quality.
2. Non-Operational Quality Attributes.
These are attributes not related to operation or functioning of an embedded system. The
way an embedded system operates affects its overall quality.
These are the attributes that are associated with the embedded system before it can be put
in operation.
Operational Attributes
a) Response
Response is a measure of quickness of the system.
It gives you an idea about how fast your system is tracking the input variables.
Most of the embedded system demand fast response which should be real-time.
b) Throughput
Throughput deals with the efficiency of system.
It can be defined as rate of production or process of a defined process over a stated period
of time.
In case of card reader like the ones used in buses, throughput means how much transaction
the reader can perform in a minute or hour or day.
c) Reliability
Reliability is a measure of how much percentage you rely upon the proper functioning of
the system .
Mean Time between failures and Mean Time To Repair are terms used in defining system
reliability.
Mean Time between failures can be defined as the average time the system is functioning
before a failure occurs.
Mean time to repair can be defined as the average time the system has spent in repairs.
d) Maintainability
Maintainability deals with support and maintenance to the end user or a client in case of
technical issues and product failures or on the basis of a routine system checkup
It can be classified into two types :-
e) Security
Confidentiality, Integrity and Availability are three corner stones of information security.
Confidentiality deals with protection data from unauthorized disclosure.
Integrity gives protection from unauthorized modification.
Availability gives protection from unauthorized user
Certain Embedded systems have to make sure they conform to the security measures.
Ex. An Electronic Safety Deposit Locker can be used only with a pin number like a
password.
f) Safety
Safety deals with the possible damage that can happen to the operating person and
environment due to the breakdown of an embedded system or due to the emission of
hazardous materials from the embedded products.
A safety analysis is a must in product engineering to evaluate the anticipated damage and
determine the best course of action to bring down the consequence of damages to an
acceptable level.
b) Evolvability
For embedded system, the qualitative attribute “Evolvability” refer to ease with which the
embedded product can be modified to take advantage of new firmware or hardware
technology.
c) Portability
Portability is measured of “system Independence”.
2) Water pump: The water pump circulates water through the washing machine. It works in two
directions, re-circulating the water during wash cycle and draining the water during the spin cycle
3) Tub: There are two types of tubs in the washing washing machine: inner and outer. The clothes
are loaded in the inner tub, where the clothes are washed, rinsed and dried. The inner tub has small
holes for draining the water. The external tub covers theinner tub and supports it during various
cycles of clothes washing.
4) Agitator or rotating disc: The agitator is located inside the tub of the washing machine. It is
the important part of the washing machine that actually performs the cleaning operation of the
clothes. During the wash cycle the agitator rotates continuously and produces strong rotating
currents within the water due to which the clothes also rotate inside the tub. The rotation of the
clothes within water containing the detergent enables the removal of the dirt particles from the
fabric of the clothes. Thus the agitator produces most important function of rubbing the clothes
with each other as well as with water.
In some washing machines, instead of the long agitator, there is a disc that contains blades on its
upper side. The rotation of the disc and the blades produce strong currents within the water and
the rubbing of clothes that helps in removing the dirt from clothes.
5) Motor of the washing machine : The motor is coupled to the agitator or the disc and produces
it rotator motion. These are multispeed motors, whose speed can be changed as per the
requirement. In the fully automatic washing machine the speed of the motor i.e. the agitator
changes automatically as per the load on the washing machine.
6) Timer: The timer helps setting the wash time for the clothes manually. In the automatic mode
the time is set automatically depending upon the number of clothes inside the washing machine.
7) Printed circuit board (PCB): The PCB comprises of the various electronic components and
circuits, which are programmed to perform in unique ways depending on the load conditions (the
condition and the amount of clothes loaded in the washing machine). They are sort of artificial
intelligence devices that sense the various external conditions and take the decisions accordingly.
These are also called as fuzzy logic systems. Thus the PCB will calculate the total weight of the
clothes, and find out the quantity of water and detergent required, and the total time required for
washing the clothes. Then they will decide the time required for washing and rinsing. The entire
processing is done on a kind of processor which may be a microprocessor or microcontroller.
8) Drain pipe: The drain pipe enables removing the dirty water from the washing that has been
used for the washing purpose.
One of the first and very popular use of embedded system in automotive industry was
microprocessor based fuel injection.
Some of the other uses of embedded controllers in a vehicle are listed below:
a. Air Conditioner
b. Engine Control
c. Fan Control
d. Headlamp Control
h. Power Windows
AES are normally built around microcontrollers or DSPs or a hybrid of the two and are generally
known as Electronic Control Units (ECUs).
LIN bus follows the master communication triggering to eliminate the bus arbitration
problem
LIN bus applications are mirror controls , fan controls , seat positioning controls
c. Media-Oriented System Transport(MOST):-
MOST is targeted for automotive audio/video equipment interfacing
A MOST bus is a multimedia fiber optics point–to- point network implemented in a star ,
ring or daisy chained topology over optical fiber cables.
MOST bus specifications define the physical as well as application layer , network layer
and media access control.
What Is OS ?
An Operating System (OS) is an interface between computer user and computer hardware. An
operating system is software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices
such as disk drives and printers. Some popular Operating Systems include Linux Operating
System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.
Definition:
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.
An Operating System provides services to both the users and to the programs. It provides programs
an environment to execute.
Following are a few common services provided by an operating system: Program execution
I/O operations
Communication
Error Detection
Resource Allocation
Protection
3. File Management:
File management is one of the most important components of an OS computer can
store information on several different types of physical media magnetic tape,
magnetic disk & optical disk are the most common media. Each medium is controlled
by a device such as disk drive or tape drive those has unique characteristics. These
characteristics include access speed, capacity, data transfer rate & access method
(sequential or random).For convenient use of computer system the OS provides a
uniform logical view of information storage. The OS abstracts from the physical
properties of its storage devices to define a logical storage unit the file. A file is
collection of related information defined by its creator. The OS is responsible for the
following activities of file management.
Creating & deleting files.
Creating & deleting directories.
Supporting primitives for manipulating files & directories.
Mapping files into secondary storage.
Backing up files on non-volatile media.
4. I/O System Management:
One of the purposes of an OS is to hide the peculiarities of specific hardware devices
from the user. For example, in UNIX the peculiarities of I/O devices are hidden from
the bulk of the OS itself by the I/O subsystem. The I/O subsystem consists of:
A memory management component that includes buffering, catching & spooling.
A general device- driver interfaces drivers for specific hardware devices. Only
the device driver knows the peculiarities of the specific device to which it is
assigned.
5. Secondary Storage Management:
The main purpose of computer system is to execute programs. These programs with
the data they access must be in main memory during execution. As the main memory
is too small to accommodate all data & programs & because the data that it holds are
lost when power is lost. The computer system must provide secondary storage to
back-up main memory. Most modern computer systems are disks as the storage
medium to store data & program. The operating system is responsible for the
• Problem: applications can e.g. – trash OS software. – trash another application. – hoard CPU
time. – abuse I/O devices. – Etc.
Alternative structure: – push some OS services into servers. – servers may be privileged (i.e.
operate in kernel mode).
• Still access kernel via system calls, but need new way to access servers: ⇒ inter-process
Real time system is used when there are rigid time requirements on the operation of a processor
or flow of data. Sensors bring data to the computers. The computer analyzes data and adjusts
controls to modify the sensors inputs. System that controls scientific experiments, medical imaging
systems and some display systems are real time systems. The disadvantages of real time system
are: a. A real time system is considered to function correctly only if it returns the correct result
within the time constraints. b. Secondary storage is limited or missing instead data is usually stored
• Hard real time systems: It guarantees that the critical task has been completed on time. The
sudden task is takes place at a sudden instant of time.
• Soft real time systems: It is a less restrictive type of real time system where a critical task gets
priority over other tasks and retains that priority until it computes. These have more limited utility
than hard real time systems. Missing an occasional deadline is acceptable e.g. QNX, VX works.
Digital audio or multimedia is included in this category. It is a special purpose OS in which there
are rigid time requirements on the operation of a processor. A real time OS has well defined fixed
time constraints. Processing must be done within the time constraint or the system will fail. A real
time system is said to function correctly only if it returns the correct result within the time
constraint. These systems are characterized by having time as a key parameter.
Task :
Task is a piece of code or program that is separate from another task and can be executed
independently of the other tasks.
In embedded systems, the operating system has to deal with a limited number of tasks
depending on the functionality to be implemented in the embedded system.
Multiple tasks are not executed at the same time instead they are executed in pseudo
parallel i.e. the tasks execute in turns as the use the processor.
From a multitasking point of view, executing multiple tasks is like a single book being
read by multiple people, at a time only one person can read it and then take turns to read it.
Different bookmarks may be used to help a reader identify where to resume reading next
time.
An Operating System decides which task to execute in case there are multiple tasks to be
executed. The operating system maintains information about every task and information
about the state of each task.
The information about a task is recorded in a data structure called the task context. When
a task is executing, it uses the processor and the registers available for all sorts of
processing. When a task leaves the processor for another task to execute before it has
Process Concept:
Process scheduling:
consists of all process in the system. The process that are residing in main memory
and are ready & waiting to execute or kept on a list called ready queue.
Process control block:
Each process is represented in the OS by a process control block. It is also by a
process control block. It is also known as task control block.
Threads :
Applications use concurrent processes to speed up their operation. However, switching between
processes within an application incurs high process switching overhead because the size of the
process state information is large, so operating system designers developed an alternative model
of execution of a program, called a thread, that could provide concurrency within an application
with less overhead
To understand the notion of threads, let us analyze process switching overhead and see where a
saving can be made. Process switching overhead has two components:
• Execution related overhead: The CPU state of the running process has to be saved
and the CPU state of the new process has to be loaded in the CPU. This overhead is
unavoidable.
A process creates a thread through a system call. The thread does not have resources of its own,
so it does not have a context; it operates by using the context of the process, and accesses the
resources of the process through it. We use the phrases ―thread(s) of a process‖ and ―parent
process of a thread‖ to describe the relationship between a thread and the process whose context
it uses.
Figure illustrates the relationship between threads and processes. In the abstract view of Figure ,
processPi has three threads,which are represented by wavy lines inside the circle representing
process Pi . Figure shows an implementation arrangement. Process Pi has a context and a PCB.
Each thread of Pi is an execution of a program, so it has its own stack and a thread control block
(TCB),which is analogous to the PCB and stores the following information:
1. Thread scheduling information—thread id, priority and state.
2. CPU state, i.e., contents of the PSW and GPRs.
3. Pointer to PCB of parent process.
4. TCB pointer, which is used to make lists of TCBs for scheduling.
POSIX Threads:
POSIX Threads, usually referred to as pthreads, is an execution model that exists independently
from a language, as well as a parallel execution model. It allows a program to control multiple
different flows of work that overlap in time. Each flow of work is referred to as a thread, and
creation and control over these flows is achieved by making calls to the POSIX Threads
API. POSIX Threads is an API defined by the standard POSIX.1c, Threads extensions (IEEE Std
1003.1c-1995).
Preemptive Scheduling:
It is the responsibility of CPU scheduler to allot a process to CPU whenever the CPU
is in the idle state. The CPU scheduler selects a process from ready queue and
allocates the process to CPU. The scheduling which takes place when a process
switches from running state to ready state or from waiting state to ready state is
called Preemptive Scheduling
Shortest Job First Scheduling (SJF) Algorithm: This algorithm associates with
each process if the CPU is available. This scheduling is also known as shortest next
CPU burst, because the scheduling is done by examining the length of the next CPU
burst of the process rather than its total length. Consider the following example:
Process CPU time
P1 3
P2 5
P3 2
P4 4
Solution:According to the SJF the Gantt chart will be
P3 P P2 P
1 4
0 2 5 9 14
P1 P P4 P P
2 1 3
0 1 5 10 17 26
The waiting time for
process P 1 = 10 - 1
=9
P2 = 1 – 1 = 0
P 3 = 17 – 2 = 15
P4 = 5 – 3 = 2
The average waiting time = (9 + 0 + 15 + 2)/4 = 26/4 = 6.5
Round Robin Scheduling Algorithm: This type of algorithm is designed only for the time
sharing system. It is similar to FCFS scheduling with preemption condition to switch
between processes. A small unit of time called quantum time or time slice is used to switch
between the processes. The average waiting time under the round robin policy is quiet long.
Consider the following example:
Process CPU time
P1 3
P2 5
P3 2
P4 4
P P2 P P P P2 P3 P4 P1 P2 P4 P2 P4 P2
1 3 4 1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
The waiting time for process
P 1 = 0 + (4 – 1) + (8 – 5) = 0 + 3 + 3 = 6
P 2 = 1 + (5 – 2) + (9 – 6) + (11 – 10) + (12 – 11) + (13 – 12) = 1 + 3 + 3 + 1 + 1 + 1 = 10
P 3 = 2 + (6 – 3) = 2 + 3 = 5
P 4 = 3 + (7 – 4) + (10 – 8) + (12 – 11) = 3 + 3 + 2 + 1 = 9
The average waiting time = (6 + 10 + 5 + 9)/4 = 7.5
Task Communication :
A shared memory is an extra piece of memory that is attached to some address spaces for their
owners to use. As a result, all of these processes share the same memory segment and have access
to it. Consequently, race conditions may occur if memory accesses are not handled properly. The
following figure shows two processes and their address spaces. The yellow rectangle is a shared
memory attached to both address spaces and both process 1 and process 2 can have access to this
shared memory as if the shared memory is part of its own address space. In some sense, the original
address spaces is "extended" by attaching this shared memory.
A pipe is a method used to pass information from one program process to another. Unlike other
types of inter-process communication, a pipe only offers one-way communication by passing a
parameter or output from one process to another. The information that is passed through the pipe
is held by the system until it can be read by the receiving process. also known as a FIFO for its
behavior.
In computing, a named pipe (also known as a FIFO) is one of the methods for intern-process
communication.
It is an extension to the traditional pipe concept on Unix. A traditional pipe is “unnamed”
and lasts only as long as the process.
A named pipe, however, can last as long as the system is up, beyond the life of the process.
It can be deleted if no longer used.
Usually a named pipe appears as a file, and generally processes attach to it for inter-process
communication. A FIFO file is a special kind of file on the local storage which allows two
or more processes to communicate with each other by reading/writing to/from this file.
A FIFO special file is entered into the filesystem by calling mkfifo() in C. Once we have
created a FIFO special file in this way, any process can open it for reading or writing, in the
same way as an ordinary file. However, it has to be open at both ends simultaneously before
you can proceed to do any input or output operations on it.
Message passing:
Message passing can be s ynchronous or as ynchronous . Synchronous message passing
systems require the sender and receiver to wait for each other while transferring the
message. In asynchronous communication the sender and receiver do not wait for each
other and can carry on their own computations while transfer of messages is being
done.
Message queue:
Message queues provide an asynchronous communications protocol, meaning that the sender and
receiver of the message do not need to interact with the message queue at the same time. Messages
placed onto the queue are stored until the recipient retrieves them. Message queues have implic it
or explicit limits on the size of data that may be transmitted in a single message and the number of
messages that may remain outstanding on the queue.
Other implementations allow the passing of messages between different computer systems,
potentially connecting multiple applications and multiple operating systems. [4] These message
queueing systems typically provide enhanced resilience functionality to ensure that messages do
not get "lost" in the event of a system failure. Examples of commercial implementations of this
kind of message queueing software (also known as message-oriented middleware) include IBM
WebSphere MQ (formerly MQ Series) and Oracle Advanced Queuing (AQ). There is
a Java standard called Java Message Service, which has several proprietary and free
software implementations.
Mail box:
Mailboxes provide a means of passing messages between tasks for data exchange or task
synchronization. For example, assume that a data gathering task that produces data needs to convey
the data to a calculation task that consumes the data. This data gathering task can convey the data
by placing it in a mailbox and using the SEND command; the calculation task uses RECEIVE to
retrieve the data. If the calculation task consumes data faster than the gatherer produces it, the tasks
need to be synchronized so that only new data is operated on by the calculation task. Using
mailboxes achieves synchronization by forcing the calculation task to wait for new data before it
operates. The data producer puts the data in a mailbox and SENDs it. The data consumer task
calls RECEIVE to check whether there is new data in the mailbox; if
not, RECEIVE calls Pause() to allow other tasks to execute while the consuming task is waiting
for the new data.
Signaling :
Signals are essentially software interrupts. It is possible for a process to ignore most signals, but
some cannot be blocked. Some of the common signals are Segmentation Violation (reading or
writing memory that does not belong to this process), Illegal Instruction (trying to execute
something that is not a proper instruction to the CPU), Halt (stop processing for the moment),
Continue (used after a Halt), Terminate (clean up and quit), and Kill (quit now without cleaning
up).
RPC:
Remote Procedure Call (RPC) is a powerful technique for constructing distributed, client-
server based applications. It is based on extending the conventional local procedure calling, so
that the called procedure need not exist in the same address space as the calling procedure.
The two processes may be on the same system, or they may be on different systems with a network
connecting them.
Process Synchronization
A co-operation process is one that can affect or be affected by other processes executing in the
system. Co-operating process may either directly share a logical address space or be allotted to
the shared data only through files. This concurrent access is known as Process synchronization.
Critical Section Problem:
Consider a system consisting of n processes (P 0, P 1, ………P n -1) each process has a segment
of code which is known as critical section in which the process may be changing common
variable, updating a table, writing a file and so on. The important feature of the system is that
when the process is executing in its critical section no other process is to be allowed to execute
in its critical section. The execution of critical sections by the processes is a mutually exclusive.
The critical section problem is to design a protocol that the process can use to cooperate each
process must request permission to enter its critical section. The section of code implementing
this request is the entry section. The critical section is followed on exit section. The remaining
code is the remainder section.
Example:
1. Mutual Exclusion: If process P i is executing in its critical section then no any other
Deadlock Characteristics: In a deadlock process never finish executing and system resources
are tied up. A deadlock situation can arise if the following four conditions hold simultaneous ly
in a system.
Mutual Exclusion: At a time only one process can use the resources. If another process
requests that resource, requesting process must wait until the resource has been released.
Hold and wait: A process must be holding at least one resource and waiting to additional
resource that is currently held by other processes.
No Preemption: Resources allocated to a process can’t be forcibly taken out from it
unless it releases that resource after completing the task.
Circular Wait: A set {P 0, P 1, …….P n} of waiting state/ process must exists such that
Dining Philosopher Problem: Consider 5 philosophers to spend their lives in thinking & eating.
A philosopher shares common circular table surrounded by 5 chairs each occupies by one
philosopher. In the center of the table there is a bowl of rice and the table is laid with 6
chopsticks as shown in below figure.
When a philosopher thinks she does not interact with her colleagues. From time to time a
philosopher gets hungry and tries to pickup two chopsticks that are closest to her. A philosopher
may pickup one chopstick or two chopsticks at a time but she cannot pickup a chopstick that is
already in hand of the neighbor. When a hungry philosopher has both her chopsticks at the same
time, she eats without releasing her chopsticks. When she finished eating, she puts down both of
her chopsticks and starts thinking again. This problem is considered as classic synchronization
problem. According to this problem each chopstick is represented by a semaphore. A philosopher
grabs the chopsticks by executing the wait operation on that semaphore. She releases the
chopsticks by executing the signal operation on the appropriate semaphore
One aim of the IDE is to reduce the configuration necessary to piece together multiple
development utilities, instead providing the same set of capabilities as a cohesive unit. Reducing
that setup time can increase developer productivity, in cases where learning to use the IDE is faster
than manually integrating all of the individual tools. Tighter integration of all development tasks
has the potential to improve overall productivity beyond just helping with setup tasks. For
example, code can be continuously parsed while it is being edited, providing instant feedback
when syntax errors are introduced. That can speed learning a new programming language and its
associated libraries.
Some IDEs are dedicated to a specific programming language, allowing a feature set that most
closely matches the programming paradigms of the language. However, there are many multiple -
language IDEs, such as Eclipse, ActiveState Komodo, IntelliJ IDEA, Oracle JDeveloper,
NetBeans, Codenvy and Microsoft Visual Studio. Xcode, Xojo and Delphi are dedicated to a
closed language or set of programming languages.
Compiling on a server farm. Similar to compiling for multiple machines, a complicated build
that involves many compile operations can be executed across any machine that is free,
regardless of its underlying hardware or the operating system version that it is running.
Bootstrapping to a new platform. When developing software for a new platform, or the
emulator of a future platform, one uses a cross compiler to compile necessary tools such as
the operating system and a native compiler.
What is a Disassembler?
Decompilers
Decompilers take the process a step further and actually try to reproduce the code in a
high level language. Frequently, this high level language is C, because C is simple and
primitive enough to facilitate the decompilation process. Decompilation does have its
drawbacks, because lots of data and readability constructs are lost during the original
compilation process, and they cannot be reproduced. Since the science of decompilation is
still young, and results are "good" but not "great", this page will limit itself to a listing of
decompilers, and a general (but brief) discussion of the possibilities of decompilation.
SVIT,ECE DEPT Page 27 Prof.Pavithra.G.S , Asst. Professor
RTOS AND IDE FOR ESD MODULE-5(18EC62)
Tools
As with other software, embedded system designers use compilers, assemblers, and
debuggers to develop embedded system software. However, they may also use some more
specific tools:
For systems using digital signal processing, developers may use a math workbench such as
Scilab / Scicos, MATLAB / Simulink, EICASLAB, MathCad, Mathematica,or FlowStone DSP to
simulate the mathematics. They might also use libraries for both the host and target which
eliminates developing DSP routines as done in DSPnano RTOS.
model based development tool like VisSim lets you create and simulate graphical data flow
and UML State chart diagrams of components like digital filters, motor controllers,
communication protocol decoding and multi-rate tasks. Interrupt handlers can also be
created graphically. After simulation, you can automatically generate C-code to the VisSim
RTOS which handles the main control task and preemption of background tasks, as well as
automatic setup and programming of on-chip peripherals.
Debugging
An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a
JTAG or Nexus interface. This allows the operation
Simulation is the imitation of the operation of a real-world process or system over time.[1]
The act of simulating something first requires that a model be developed; this model
represents the key characteristics or behaviors/functions of the selected physical or abstract
system or process. The model represents the system itself, whereas the simulation
represents the operation of the system over time.
Key issues in simulation include acquisition of valid source information about the relevant
selection of key characteristics and behaviours, the use of simplifying approximations and
assumptions within the simulation, and fidelity and validity of the simulation outcomes.
Emulator
This article is about emulators in computing. For a line of digital musical instruments, see
E-mu Emulator. For the Transformers character, see Circuit Breaker
(Transformers).#Shattered Glass. For other uses, see Emulation (disambiguation).
The above described focus on exact reproduction of behavior is in contrast to some other
forms of computer simulation, in which an abstract model of a system is being simulated.
For example, a computer simulation of a hurricane or a chemical reaction is not emulation.
OUT-OF-CIRCUIT :The code to be run on the target embedded system is always developed
on the host computer. This code is called the binary executable image or simply hex code.
The process of putting this code in the memory chip of the target embedded system is called
Downloading.
There are two ways of downloading the binary image on the embedded system:
1. Using a Device Programmer
A device programmer is a piece of hardware that works in two steps.
Step 1 Once the binary image is ready on the computer, the device programmer is connected
to the computer and the binary image is transferred to the device programmer.
The most primitive method of debugging is using LEDs. This is similar to using a printf
or a cout statement in c/c++ programs to test if the control enters the loop or not.
Similarly an LED blind or a pattern of LED blinks can be used to check if the control
enters a particular piece of code.
Remote Debuggers
Remote Debugger is a tool that can be commonly used for:
Downloading
Executing and
Debugging embedded software
A Remote Debugger contains a hardware interface between the host computer and
the target embedded system.