0% found this document useful (0 votes)
17 views13 pages

20Eepw601-Embedded Systems and Iot With Laboratory Assignment - 1

The document discusses the structural units of embedded processors, including internal buses, instruction units, caches, control units, processing units, and memory management. It also covers in-circuit emulators and watchdog timers, explaining their functions and benefits, as well as direct memory access (DMA) operations. Additionally, it addresses the selection of processors and memory devices, memory management methods, and various debugging techniques for embedded systems.

Uploaded by

spamforspams123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

20Eepw601-Embedded Systems and Iot With Laboratory Assignment - 1

The document discusses the structural units of embedded processors, including internal buses, instruction units, caches, control units, processing units, and memory management. It also covers in-circuit emulators and watchdog timers, explaining their functions and benefits, as well as direct memory access (DMA) operations. Additionally, it addresses the selection of processors and memory devices, memory management methods, and various debugging techniques for embedded systems.

Uploaded by

spamforspams123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

NAME : DIWAKAR K

REGISTER NO : 412422105016

20EEPW601-EMBEDDED SYSTEMS AND IOT WITH LABORATORY


ASSIGNMENT -1

1. Discuss the structural units of embedded processor.

Internal Buses
It internally connects all the structural units inside the processor. Its width can be of 8, 16, 32 or
64 bits. The internal buses include address bus, data bus and control bus. All the internal units of
the processor are communicated with the external buses through an interface unit called Bus
Interface Unit(BIU).

 Address bus is an external bus that carries the address from the Memory Address
Register(MAR) to the memory as well as to the IO devices and other units of the system.
 Data bus is an external bus that carries the data from or to the address determined by
Memory Address Register(MAR).
 Control Bus is an external bus that carries, control signals to or between the processor
and memory.

Instruction Units
The processor executes several operations with the help of a piece of code or program called
instructions. All these instruction are arranged in a queue called Instruction Queue(IQ). This
helps the Instruction Register to execute the instructions without the need to wait.

Instruction Register(IR) takes the instruction codes(opcodes) sequentially to the execution unit of the
processor. Instruction decoder(ID) decodes the instruction opcode received at the Instruction
Register and passes it to the processor Control unit for its execution..

Caches
In general, cache is the temporary storage place in the processor, where the data can easily be
retrieved by the CPU for quick operation. Cache is available in your computers, laptop, mobile
phone, browser, app, etc. The embedded processor has three cache memory for fast operation.

Similar to an instruction queue, Instruction Cache(I-Cache) sequentially stores the instructions in


FIFO mode. It lets the processor to execute the instructions at a greater speed.

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.

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
The control unit(CU) is one of the important structural units in an any embedded processor. It is
responsible for all the control of the bus activities and unit functions needed for processing. It
directs all the units of a processor to respond to the instruction that is executed.

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.

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 receives the input data, process it and produces the output. Depending on the
function of the embedded system, the processing is done through different units like ALU,
FLPU, AOU and advanced units.

Arithmetic Logic Unit(ALU) is used for the execution the arithmetic and logic instructions
according to the instruction present at the Instruction Register.

Floating point processing unit(FLPU) is different from ALU, used primarily for floating point
processing. It is essential for fast processing mathematical functions in a microprocessor or
Digital Signal Processor.

Atomic operation unit(AOU) lets a user (compiler) instruction when broken into number of
processor instructions called atomic operations, finish before an interrupt of the processor occurs.

The embedded processor also has Advanced processing units for multistage pipeline processing,
multi-line superscalar processing to obtain processing speeds higher than one instruction per
cycle.

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.

System Register Set(SRS) is a set of registers used while processing the instructions of the
supervisory system program.

Floating point register set(FRS) is dedicated for storing floating point numbers in the standard
format and used by Floating point Processing Units for its data.

Memory Registers
Registers are smallest part of the CPU, where the data and address can be stored and accessed
quickly. There are various registers like accumulator, general purpose registers, flag registers,
memory address register, memory data register, program counter, stack pointer, etc.

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.

Program Counter and Stack Pointer


Program counter is a register that stores the address of the next instruction to be executed from
the memory. It generates the instruction cycle to fetch the address from memory through MAR.
Stack pointer is a register that stores the address of the last program request in a stack. It is a
pointer for an address which corresponds to a stack top in the memory

2. Discuss about (i) In-circuit emulator (ii) Watch dog timer.


(i) In-circuit emulator
In-circuit emulation (ICE) is a specific debugging technique performed using
instruments known as in-circuit emulators. These emulators can augment simulation
capabilities. A logic simulator focuses on hardware verification and less about
running with embedded software . In-circuit emulation models how a chip’s
hardware and software will perform and then runs a series of tests to verify the
accuracy of the (DUT) design under test. Simulators and emulators are also used for
debugging purposes.

While simulators are undoubtedly integral to the chip development process, simulation
is slow, in single digit Hz range, while the DUT is getting bigger (e.g., few billion-gate
designs) every generation. Conversely, in-circuit emulators can verify the DUT (few
billion gate designs) typically in the KHz to MHz range.
Modern in-circuit emulators look similar to a rack of servers. Engineering teams
interface with in-circuit emulation equipment using their computers.
Whereas simulation software creates a digitized representation of a chip's attributes, the
in-circuit emulator provides a physical manifestation of the design. As a result, the in-
circuit emulator facilitates faster testing, performance verification, and
hardware/software co-debugging. Furthermore, in-circuit emulators allow designers to
go beyond this initial testing phase. Engineers can actually connect the chip in the
emulator to the real-world environment they intend to use it.
Benefits of In-Circuit Emulation

In-circuit emulation offers a multitude of benefits to software engineering teams.

(ii) Watch dog timer.

Watchdog timer is a hardware or software component that is designed to detect and


recoverfrom system malfunctions. It works by monitoring the system and triggering
a reset if a failureis detected. The goal is to ensure that the system always operates
within a certain set ofparameters and doesn’t drift off course due to unexpected
events or bugs.

A watchdog timer works by periodically monitoring the system and resetting it if a


certain condition is met.

The exact implementation can vary depending on the specific system and
application, but here’s a

high-level overview of how it typically works:

1. The watchdog timer is initialized with a timeout value. This value determines how
long the watchdog

timer will wait before triggering a reset.

2. The system or application being monitored regularly resets the watchdog timer.
This can be done in a

variety of ways, such as writing to a specific memory location or sending a signal.

3. If the watchdog timer is not reset within the specified timeout period, it assumes
that a failure has
occurred and triggers a reset of the system or application.

4. The reset caused by the watchdog timer will typically be a “hard” reset, which
means that the system or

application will be completely restarted from scratch.

Automatic recovery: By using a watchdog timer, it’s possible to automatically


recover from software or

hardware failures without requiring human intervention. This can help to improve the
overall reliability

and availability of a system or application.

Preventative maintenance: By regularly resetting the watchdog timer, the system can
proactively identify

and correct potential issues before they become major problems.

Real-time monitoring: A watchdog timer can provide real-time monitoring of a


system or application,

giving engineers insight into its performance and behavior.

Compliance: For some industries, such as aerospace and defense, watchdog timers are
a mandatory

requirement to ensure that systems operate within certain safety-critical parameters.

Applications of Watchdog Timers

Watchdog timers are commonly used in safety-critical applications such as


aerospace, automotive, and

medical devices. They are also used in industrial control systems, embedded
systems, and other

applications where system uptime and reliability are critical.


3. With a neat diagram, explain the working of Direct Memory Access (DMA).

Definition: A direct memory access (DMA) is an operation in which data is copied from one
resource to another resource in a computer system without the involvement of the CPU. The task
of a DMA controller (DMAC) is to execute the copy operation of data from one resource
location to another. The copy of data can be performed from: I/O device memory , Memory to
I/O device, Memory to Memory
I/O device to I/O device DMAC is an independent resource of a computer added for the
concurrent execution of DMA operations. The first two operation modes are “read from” and
“write to” transfers of an I/O device to the main memory, which are the common operation of a
DMA controller
The DMAC replaces the CPU for the transfer task of data from I/O device to the main memory,
otherwise it is executed by the CPU using the programmed input output mode (PIO). The
‘memcopy’ is used for
PIO operation. The DMAC is a master/slave resource on the system bus, because it supply the
address for the resources involved in a DMA transfer. It requests the bus whenever a data is
available for transport, which is signalled from the device by “REQ” signal.
DMA Operation: There are many modes of operation such as, Single block transfer at a time and
then release IO Bus after each transfer Burst Transfer (few kilobytes) at a time and release IO
bus after transfer
Bulk transfer and then release IO bus after transfer completes. DMA is programmed as (i) Read
or Write (ii)Mode(Byte, Burst or Bulk) (iii)Total no of byte to be transferred (iv) Starting
memory address For read operation DMA interrupts CPU only during start of DMAC
Programming and at a end.

4. Write a short notes on(i) system Clock(ii) Real time Clock

A real-time clock (RTC) is a computer clock, usually in the form of an integrated circuit
that is solely built for keeping time. Naturally, it counts hours, minutes, seconds, months,
days and even years. RTCs can be found running in personal computers, embedded
systems and servers, and are present in any electronic device that
may require accurate time keeping. Being able to still function even when the computer is
powered down through a battery or independently from the system’s main power is
fundamental.
RTCs must accurately keep time, even when the device is powered off because, it is often
used as a trigger for turning the device on or triggering events such as alarm clocks. RTC
ICs run on an alternate power source, which allows it to continually operate under low
power or even when the computer is turned off. ICs on older systems utilize lithium
batteries, whereas newer systems make use of auxiliary batteries or supercapacitors. RTC
ICs that use supercapacitors are rechargeable and can be soldered. But in most consumer-
grade motherboards, the RTC is powered by a single battery that, when removed, resets
the RTC to its starting point.
RTC ICs regulate time with the use of a crystal oscillator and do not rely on clock signals
like most hardware clocks. Aside from being responsible for the timing function of the
system and its clock, RTC ICs ensure that all processes occurring in the system are
appropriately synchronized. Although some may argue that this is a job for the system
clock, the system clock is actually dependent on the RTC, making the RTC indirectly
responsible for synchronization
An RTC battery should last for three to five years or more. RTCs are essential; if the
battery fails, it must be replaced to ensure continued operation. A dead battery can be
diagnosed with an error message at startup or if the user finds that the clock or the setup
configuration has become corrupted, flaky or odd.

Benefits of RTCs include:

RTC ICs have proved to be more precise than other methods — like programming the
timer of the controller.
It frees the main system from time-critical tasks.
It has low power consumption and improved frequency stability.

5. Explain about the selection of processor and memory device in detail

The selection of a processor for embedded systems depends on various criteria such as
application requirements, power consumption, cost, and compatibility. Processors must
match the specific needs of the system, whether it's high-speed computation or energy-
efficient operations. For example, ARM-based processors are popular for their low power
consumption and high performance, making them ideal for portable and battery-operated
devices. On the other hand, DSP (Digital Signal Processors) are chosen for applications
requiring real-time data processing like audio and video processing. The architecture,
clock speed, and number of cores also play a role in determining a processor's suitability.
Memory device selection is equally critical as it impacts the system's efficiency and
reliability. Embedded systems use a mix of volatile and non-volatile memories. Volatile
memory (RAM) is used for temporary data storage during operation, while non-volatile
memory (such as Flash or EEPROM) stores the program code and configuration data that
persist even after the power is turned off. The choice of memory depends on the
application's data storage needs, access speed, and budget. High-performance
applications may demand faster and larger memory capacities, while simpler systems
might work with minimal storage to reduce costs. Integrating the processor and memory
efficiently ensures seamless communication and system performance.

6. write a short note on memory management methods

When a process is created, the memory manager allocates the memory addresses to it by
mapping the process address space. Threads of a process share the memory space of the
process. Memory Leak: A memory allocation that does not have a corresponding de-
allocation A memory leak is a gradual loss of available computer memory, when a
program repeatedly fails to return memory that it has obtained for temporaryuse. Due to
memory leak, run out of memory problem will occur.

A memory leak is a gradual loss of available computer memory, when a

program repeatedly fails to return memory that it has obtained for temporary

use. Due to memory leak, run out of memory problem will occur.

Stack overflow means that the stack exceeds the allocated memory block
when there is no provision for additional stack space. Memory manager controls

the memory leaks and stack overflows.

7. Discuss about In circuit-emulator and Target Hardware


Debugging In Circuit Emulators
● Most of these debugging techniques can be applied to any microcontroller since they
do not use any
specific tools.
● There are many ways to debug hardware, they are,
● 1. ICE (In Circuit Emulator)
● 2. ICD (In Circuit Debug)
● 3. Simulation
● 4. Serial RS-232
● 5. LCD
● 6. LED
● 7. Hardware pins
● 8. Logic Analys
ICE (In Circuit Emulator): In Circuit Emulator is the most expensive way to debug your
hardware. It takes a special processor that physically takes place of the normal processor.
This special processor allows software access to the internal operation of the processor.
ICD (In Circuit Debug): The next best thing to ICE is ICD (In
Circuit Debug). This is for PIC microcontroller. BDM
(Background Debug Mode) is for non PIC microcontroller. For
ICD the processor has a small amount of built-in hardware that
can halt the processor when the program reaches a specific
address. The software can then read back all the registers and
processor state.
● Simulation: With a source code simulator you can step through the high level
language code and
see its effect on memory and variables without having to look at the assembler code
directly.
This let you focus on high level language operation and let you concentrate on the
problem you
are trying to solve. One great advantage of simulator is that you do not have to wait to
download
and program the target processor. So you can cut out the time consuming programming
just by
using the simulator.
● Serial RS232: New microcontrollers have a built-in UART which gives virtually free
debug tool
that uses minimum resources and need very little software coding. For debug output you
need to
connect the UART output in TX to a suitable level translator circuit a MAX 232 chip.
You may
even get away with direct connection to the input of your PC serial port – using a
translator chip
will always work.
● Advantages: Minimal coding, simple to use, minimal extra hardware.
● Disadvantage: a) Takes long time to output a character (~1ms) b) Takes even longer
for blocks of characters c) Need extra H/W

8. Outline a short note on memory management methods

● Simulation: With a source code simulator you can step through the high level
language code and
see its effect on memory and variables without having to look at the assembler code
directly.
This let you focus on high level language operation and let you concentrate on the
problem you
are trying to solve. One great advantage of simulator is that you do not have to wait to
download
and program the target processor. So you can cut out the time consuming programming
just by
using the simulator.
● Serial RS232: New microcontrollers have a built-in UART which gives virtually free
debug tool
that uses minimum resources and need very little software coding. For debug output you
need to
connect the UART output in TX to a suitable level translator circuit a MAX 232 chip.
You may
even get away with direct connection to the input of your PC serial port – using a
translator chip
will always work.
● Advantages: Minimal coding, simple to use, minimal extra hardware.
● Disadvantage: a) Takes long time to output a character (~1ms) b) Takes even longer
for blocks of characters c) Need extra H/W

You might also like