Unit 1 - Embedded System
Unit 1 - Embedded System
Unit 1 - Embedded System
Topics to be covered:
1. Introduction of Embedded system
2. Build Process
3. Structural Units
4. Selection of Processor and memory Devices
5. Memory management method
6. Timer and Counting Devices
7. Watchdog timer
8. Real-time clock
9. In the circuit emulator
10. Target hardware debugging
11. Direct Memory Access
The build process for embedded systems is different. This is because the
code to be run on an embedded system is written one platform i.e. general
purpose computer and executed in another platform i.e. the target
hardware.
An Embedded system would also use tools such as a Compiler, Linker,
Locater and Debugger to perform the entire build process. These tools ,
would be a part of a larger IDE.
Locating
The process of relocating is carried out by the relocater.
The embedded processor has three cache memory for fast operation:
1. Instruction Cache(I-Cache) sequentially stores the instructions in
FIFO mode. It lets the processor to execute the instructions at a
greater speed.
2. Branch Target Cache(BT Cache) facilitates the ready availability
of the next instruction set, when a branch instruction like jump,
call or loop is encountered. Its fetch unit foresees a branching
instruction in the I – cache.
3. Data Cache(D – Cache) stores the pre – fetched data from the
external memory. A data cache holds both the address and data
together at a location. It also stores the write-through data that is
to be transferred to the external memory addresses. Write-
through data is nothing but the output data from the execution
unit.
Control Units
1. The control unit(CU) is one of the important structural units in any
embedded processor. It is responsible for all the control of the bus
activities and unit functions needed for processing. It directs all the
units of a processor to respond to the instruction that is executed.
2. Pre fetch control Unit(PFCU) controls the fetching of data into the I-
Cache and D-Cache in advance from the memory unit. The instructions
and data are delivered when needed to the processor’s execution units.
3. Memory Management Unit(MMU) manages the memories such that
the instructions and data are readily available for processing. There are
several memory management methods for managing the memory in an
embedded processor such as fixed block allocation, dynamic block
allocation, dynamic page allocation, etc.
Processing Units
Processing units receive the input data, process it and produce the output.
Depending on the function of the embedded system, the processing is done
through different units like ALU, FLPU, AOU, and advanced units.
Register Sets
Application Register Set(ARS) is a set of on-chip registers used during
processing of instructions of the application program of the user. A register
window consists of a subset of registers with each subset storing static
variables of software – routine.
Memory Registers
Registers are the smallest part of the CPU, where the data and address can be
stored and accessed quickly. There are various registers like accumulators,
general purpose registers, flag registers, memory address registers, memory
data registers, program counters, stack pointers, etc.
Memory Address Register(MAR) holds the address of the data byte or word
that is to be fetched from external memories. Memory Data
Register(MDR) holds the data byte or word that is fetched from external
memory or stored to the external memory.
A stack pointer is a register that stores the address of the last program request
in a stack. It is a pointer for an address that corresponds to a stack top in the
memory.
Selection of processor:
1. Speed and performance.
2. Optimal power usage
3. Peripheral support
4. Advanced Processing
5. Cost
The number of instructions executed per second and the number of operations
per clock cycle must be evaluated for assessing performance. At the same time,
the efficiency of the computation units is also important when talking about
performance.
Processor architectures that support additional instruction can aid in improving
performance for specific applications. Pipelining and super-scalar architectures
boost processor performance even further.
More logic leads to higher power density thereby making the heat dissipation
difficult. With more emphasis on greener technologies and since many systems
are becoming battery operated, it is important to design the system for optimal
power usage. Silicon-on-Chip (SoC) comes with advanced power gating
techniques that can shut down clocks and power to unused modules.
Peripheral support
Apart from the processor, the embedded system has many other peripherals to
perform input and output operations. It is important to have the right
peripherals to assist the processor in optimized performance.
In recent days, almost all the processors used are SoCs. So it is better if the
necessary peripherals are available in the chip itself and are called on-chip
peripherals. It offers various benefits such as optimal power consumption and
effective data communication compared to external peripherals
Advanced Processing
Along with the core processor, the presence of various co-processors and
specialized processing units can add more value to the processing
performance. The instructions fetched by the core processor are executed by
the co-processors in parallel, thereby reducing the processing load.
Memory Management:
Memory management is the process of keeping track of the free and
allocated blocks of the RAM and assigning the free memory blocks to
processes.
This is the oldest and simplest technique used to put more than one process
in the main memory.
Variable partition:
It is a part of Contiguous allocation technique. It is used to alleviate the
problem faced by Fixed Partitioning. In contrast with fixed partitioning,
partitions are not made before the execution or during system configure.
Various features associated with variable Partitioning-
1. Initially RAM is empty and partitions are made during the run-time
according to process’s need instead of partitioning during system
configure.
2. The size of partition will be equal to incoming process.
3. The partition size varies according to the need of the process so that the
internal fragmentation can be avoided to ensure efficient utilisation of
RAM
4. Number of partitions in RAM is not fixed and depends on the number of
incoming process and Main Memory’s size.
5.
In Circuits Emulator:
An in-circuit emulator (ICE) is a debugging tool that allows you to
access a target MCU for in-depth debugging. A genuine ICE requires
you to remove the microcontroller and insert the ICE in its place,
most commonly using an adapter. In-circuit emulation is rather rare
in these days of high-performance, relatively low-cost processors
because ICE needs to be invisible to the system, which is difficult to
do with extremely fast, memory-intensive chips. Nevertheless, not
every system requires a high-performance MCU, and it’s still possible
to use ICE. ICE is the best tool for finding difficult bugs and can
provide invaluable insight.
Features of 8257
Modes of DMA:
Mode-1
Burst Mode –
In this mode Burst of data (entire data or burst of block containing
data) is transferred before the CPU takes control of the buses back
from DMAC.
This is the quickest mode of DMA Transfer since at once a huge
amount of data is being transferred.
Since at once only a huge amount of data is being transferred so time
will be saved in huge amounts.
Mode-2
Cycle Stealing Mode –
Slow IO device will take some time to prepare data (or words) and
within that time CPU keeps the control of the buses.
Once the data or the word is ready CPU gives back control of system
buses to DMAC for 1-cycle in which the prepared word is transferred
to memory.
As compared to Burst mode this mode is a little bit slowest since it
requires a little bit of time which is actually consumed by the IO
device while preparing the data.
Mode 3
Transparent Mode:
Whenever CPU does not require the system buses then only control of
buses will be given to DMAC.
In this mode, CPU will not be blocked due to DMA at all.
This is the slowest mode of DMA Transfer since DMAC has to wait might
be for so long time to just even get the access of system buses from the
CPU itself.
Hence due to which less amount of data will be transferred.