0% found this document useful (0 votes)
53 views38 pages

Embedded Systems - 5

Uploaded by

indu.s kavitha.j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views38 pages

Embedded Systems - 5

Uploaded by

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

BM 3551 – EMBEDDED SYSTEMS

AND IoMT

UNIT 1 : INTRODUCTION TO EMBEDDED


SYSTEM DESIGN

Topic : Memory devices, Device drivers

Ms. S. Indu
AP / BME
Memory selection for Embedded Systems:

• Selection of suitable memory is very much essential step in high performance


applications, because the challenges and limitations of the system performance
are often decided upon the type of memory architecture.

• Systems memory requirement depend primarily on the nature of the


application that is planned to run on the system.

• Memory performance and capacity requirement for low cost systems are
small, whereas memory throughput can be the most critical requirement in a
complex, high performance system.
Random Access Memory
• RAM, which stands for Random Access Memory, is the computer's short-
term memory.
• Random Access memory is present on the motherboard.
• It's where data is stored for quick access by the central processing unit
(CPU) as it's working on programs and tasks.
• RAM can help in both Read and write.
• RAM is a volatile memory, which means, it is present as long as the
Computer is in the ON state, as soon as the computer turns OFF, the
memory is erased.
How does it work ?

RAM is constructed of small transistors and capacitors, much like CPUs and
other computer components, which can stored an electric charge that
corresponds to data bits. electrical charge is necessary to regular charge of it.
If not, the data removed from RAM and the capacitors lose their charge.

• Data Loading: When you turn on your computer and open a program, the
required data and instructions are retrieved from your storage device (like a
hard disk drive or solid-state drive) and loaded into RAM. This data
transfer might involve the operating system, application files, and any
documents you're working on.
• Storage and Access: RAM stores this data using memory cells, each
containing a tiny electrical circuit. These cells can be quickly accessed by
the CPU in any order (random access), unlike storage devices where data
retrieval might take longer due to physical mechanics.
• Reading and Writing: The CPU can both read data from RAM (to
understand instructions and process information) and write data to RAM
(for making changes to documents or program states). This constant
reading and writing allows the CPU to work efficiently.
• Refreshing (DRAM only): In the case of the most common type of RAM,
Dynamic RAM (DRAM), these memory cells use capacitors to store data.
However, capacitors gradually lose their charge over time. To prevent data
loss, DRAM employs a refresh process that periodically recharges the
capacitors, ensuring the information remains intact.
• Volatility: Unlike storage devices designed for permanent data retention,
RAM is volatile. This means that when you shut down your computer, the
electrical charge in the memory cells dissipates, and all the data stored in
RAM is erased.
Key characteristics of RAM:

• Volatility: As mentioned earlier, RAM is volatile memory. This means that


the data stored in RAM is lost when the computer is turned off.
• Random access: RAM allows for random access, which means that the
CPU can access any location in memory at any time. This is important for
the CPU to be able to quickly retrieve the data it needs to perform tasks.
• Speed: RAM is much faster than secondary storage devices such as HDDs
and SSDs. This is because RAM uses transistors to store data, while HDDs
and SSDs use magnetic or flash memory. Transistors can be switched on and
off much faster than magnetic or flash memory can be read from or written
to.
• Capacity: RAM has a lower capacity than secondary storage devices.
Typical RAM capacities range from 4GB to 32GB, while HDDs and SSDs
can have capacities of terabytes (TB) or even petabytes (PB).
• Read/write: RAM is read-write memory, which means that the CPU can
both read data from RAM and write data to RAM.
Types of RAM
RAM is further divided into two types, SRAM – Static Random Access
Memory and DRAM- Dynamic Random Access Memory.

1. SRAM (Static Random Access memory)


• SRAM is used for Cache memory, it can hold the data as long as the power
availability is there.
• It is refreshed simultaneously to store the present information. It is made
with CMOS technology.
• It contains 4 to 6 transistors and it also uses clocks. It does not require a
periodic refresh cycle due to the presence of transistors.
• Although SRAM is faster, it requires more power and is more expensive in
nature.
• Since SRAM requires more power, more heat is lost here as well, another
drawback of SRAM is that it can not store more bits per chip, for instance,
for the same amount of memory stored in DRAM SRAM would require one
more chip.
Function of SRAM
The function of SRAM is that it provides a direct interface with the Central
Processing Unit at higher speeds.

Characteristics of SRAM
• SRAM is used as the Cache memory inside the computer.
• SRAM is known to be the fastest among all memories.
• SRAM is costlier.
• SRAM has a lower density (number of memory cells per unit area).
• The power consumption of SRAM is less but when it is operated at higher
frequencies, the power consumption of SRAM is compatible with DRAM.
2. DRAM (Dynamic Random Access memory)
• DRAM is used for the Main memory, it has one transistor and one
capacitor (also known as a conductor), which is needed to get recharged in
milliseconds due to the presence of the capacitor.
• Dynamic RAM was the first sold memory integrated circuit.
• DRAM is the second most compact technology in production (First is Flash
Memory).
• DRAM has one transistor and one capacitor in 1 memory bit.
• Although DRAM is slower, it can store more bits per chip, for instance, for
the same amount of memory stored in SRAM, DRAM requires one less
chip. DRAM requires less power and hence, less heat is produced.
Function of DRAM
The function of DRAM is that it is used for programming code by a computer
processor in order to function. It is used in our PCs (Personal Computers).

Characteristics of DRAM
• DRAM is used as the Main Memory inside the computer.
• DRAM is known to be a fast memory but not as fast as SRAM.
• DRAM is cheaper as compared to SRAM.
• DRAM has a higher density (number of memory cells per unit area)
• The power consumption by DRAM is more.

Types of DRAM
• SDRAM: Synchronous DRAM, increases performance through its pins,
which sync up with the data connection between the main memory and the
microprocessor.
• DDR SDRAM: (Double Data Rate) It has features of SDRAM also but with
double speed.
• ECC DRAM: (Error Correcting Code) This RAM can find corrupted data
easily and sometimes can fix it.
• RDRAM: It stands for Rambus DRAM. It used to be popular in the late
1990s and early 2000s. It has been developed by the company named
Rambus Inc. at that time it competed with SDRAM. It’s latency was higher
at the beginning but it was more stable than SDRAM, consoles like
Nintendo 64 and Sony Play Station 2 used that.
• DDR2, DDR3, AND DDR4: These are successor versions of DDR
SDRAM with upgrades in performance.
Advantages of Using RAM
• Speed: RAM is faster than other types of storage like ROM, hard drives or SSDs,
allowing for quick access to data and smooth performance of applications.
• Multitasking: More RAM allows a computer to handle multiple applications
simultaneously without slowing down.
• Flexibility: RAM can be easily upgraded, enhancing a computer’s performance and
extending its usability.
• Volatile Storage: RAM automatically clears its data when the computer is turned off,
reducing the risk of unwanted data accumulation.

Disadvantages of Using RAM


• Volatility: Data stored in RAM is lost when the computer is turned off, which means
important data must be saved to permanent storage.
• Cost: RAM can be more expensive per gigabyte compared to other storage options
like hard drives or SSDs.
• Limited Storage: RAM has a limited capacity, so it cannot store large amounts of data
permanently.
• Power Consumption: RAM requires continuous power to retain data, contributing to
overall power consumption of the device.
• Physical Space: Increasing RAM requires physical space in the computer, which
might be limited in smaller devices like laptops and tablets.
Read-only Memory
• Read-only memory (ROM) is a type of non-volatile memory used
in computers and other electronic devices.
• Data stored in ROM cannot be electronically modified after the manufacture
of the memory device.
• Read-only memory is useful for storing software that is rarely changed
during the life of the system, also known as firmware.
Key Characteristics of ROM :

• Non-volatile: The most defining feature of ROM is its non-volatile nature.


This means that the data stored in ROM is permanent and remains intact
even when the power is turned off or the device is restarted.
• Read-Only Access: The data stored in ROM can be read by the device's
processor, but it cannot be easily modified or erased by the user during
normal operation. This safeguards critical system functions from accidental
changes.
• Permanent Storage: The information written into ROM during the
manufacturing process (MROM) or through specific programming methods
(PROM, EPROM) is permanent. This ensures the continued operation of
essential functionalities that rely on this data.
• Pre-programmed Instructions: ROM typically comes pre-programmed
with essential instructions and data that the device needs to function from
the start.
• Durability and Reliability: ROM offers reliable data storage due to its non-
volatile nature and resistance to wear and tear. The data is stored
electronically, not magnetically like in hard drives, making it less
susceptible to degradation or corruption.
• Security: The read-only characteristic of ROM provides inherent data
security. Since accidental or unauthorized modifications are restricted, it
safeguards critical system functions and program integrity.
• Faster Read Speeds: Compared to some storage devices like hard disk
drives (HDDs), ROM offers faster read speeds because data can be accessed
electronically without any mechanical movement involved.
• Lower Cost : Manufacturing ROM is generally less expensive compared to
RAM. This is because ROM relies on simpler circuitry and doesn't require
the complex data refresh mechanisms needed in RAM.
Types of ROM:
 Masked ROM (MROM)
 Programmable ROM (PROM)
 Erasable Programmable ROM (EPROM)
 Electrically Erasable Programmable ROM (EEPROM)
 Flash ROM

Applications of ROM:
• System Startup (BIOS): Stores instructions for hardware initialization and
system startup.
• Device Firmware: Contains permanent software code for controlling
specific devices like printers or graphics cards.
• Program Loaders: Holds instructions for loading the operating system
from storage devices.
• Data Tables: May store pre-defined data like language characters or
mathematical constants.
Advantages of ROM:

• Non-volatile storage: Data stored in ROM is permanent and persists even when
the power is off. This is crucial for storing essential system instructions and data
that the device needs to function from the start, like the BIOS.
• Reliability: Due to its non-volatile storage and lack of moving parts, ROM offers
reliable data storage. The data is less susceptible to degradation or corruption
compared to storage devices that rely on magnetic or flash memory.
• Security: The read-only characteristic of ROM provides inherent data security.
Since accidental or unauthorized modifications are restricted, it safeguards critical
system functions and program integrity.
• Durability: ROM is generally considered more durable than other storage options
like HDDs because it has no moving parts. This makes it ideal for use in devices
that may experience wear and tear.
• Faster Read Speeds: ROM offers faster read speeds compared to some storage
devices like HDDs. Data access is electronic, eliminating the mechanical delays
associated with spinning disks in HDDs.
• Lower Cost : Manufacturing ROM is generally less expensive compared to RAM.
This is because ROM relies on simpler circuitry and doesn't require the complex
data refresh mechanisms needed in RAM.
• Versatility: Different ROM types cater to various needs.
Disadvantages of ROM:

• Limited Flexibility: A major drawback of ROM is its limited flexibility.


MROM and PROM data cannot be modified after the manufacturing
process or programming. This can be inconvenient if updates or bug fixes
are needed.
• Slower Write Speeds: While ROM offers fast read speeds, writing data to
programmable ROM types (PROM, EEEPROM, Flash ROM) is generally
slower compared to RAM. This is because the write process often involves
additional steps like erasing existing data before new information can be
written.
• Limited Capacity: Typically, ROM has a lower capacity compared to
storage devices like hard drives or solid-state drives (SSDs). This limits the
amount of data that can be stored in ROM.
• Environmental Concerns: EPROMs require UV light for erasure, which
can pose environmental hazards if not disposed of properly.
Electrically Erasable Programmable Read-
only Memory
EEPROM, which stands for Electrically Erasable Programmable Read-Only
Memory, is a type of non-volatile memory that bridges the gap between
traditional ROM (Read-Only Memory) and RAM (Random Access Memory).
Here's a deep dive into the world of EEPROMs:

Functionality:
• Non-volatile Storage: Like ROM, EEPROMs retain data even when the
power is off. This ensures critical information and settings are preserved
between restarts.
• Read-Write Capability: Unlike traditional ROM, EEPROMs allow you to
erase and rewrite specific data bytes electronically. This provides more
flexibility than fixed ROM variants.
• In-Circuit Programming: EEPROMs can be programmed and erased
while they are still installed in a device (in-circuit). This eliminates the
need for removal and reprogramming, simplifying the update process.
How it Works:
EEPROMs utilize floating-gate transistors to store data. These transistors have
a floating gate that traps or releases electrons, representing a 1 or 0 binary
value. By applying specific electrical charges, individual bytes of data can be
erased and reprogrammed.

Data Storage:
EEPROMs rely on a special type of transistor called a floating-gate transistor.
This transistor has three terminals: gate, source, and drain.

• Storing a 1: During programming, a high voltage is applied to the gate,


causing electrons to tunnel through the oxide layer and become trapped
around the floating gate. This trapped charge creates an electric field that
interferes with the normal operation of the transistor, essentially
representing a binary 1.
• Storing a 0: In the absence of a programming voltage, no electrons are
trapped around the floating gate. The transistor operates normally,
signifying a binary 0.
• Erasing: A high voltage pulse is applied to the drain terminal while the source terminal
is grounded. This creates a strong electric field that pulls the trapped electrons out from
under the floating gate, effectively erasing the stored data and resetting the transistor to
represent a 0.
• Rewriting: Once erased, the EEPROM is ready to be programmed again. By applying
a voltage to the gate, new electrons can be tunneled back under the floating gate,
restoring a binary 1 state.

Advantages of EEPROM:
• Rewritable: EEPROM offers the ability to rewrite data electronically, providing more
flexibility than fixed ROM. This is useful for storing settings that may need occasional
adjustments.
• Non-volatile: Data stored in EEPROM is permanent and survives power outages,
ensuring critical information and settings are preserved.
• In-Circuit Programming: The ability to program and erase EEPROMs while they are
still installed simplifies the update process, eliminating the need for removal and
reprogramming.
• Durability: EEPROMs offer reliable data storage due to their non-volatile nature and
lack of moving parts.
• Faster Write Speeds: Writing data to EEPROMs is generally faster than programmable
ROM types like PROM or EPROM that require UV light for erasure.
Disadvantages of EEPROM:
• Limited Write Cycles: While rewritable, EEPROMs have a limited number
of erase/write cycles before they wear out. This lifespan needs to be
considered when choosing EEPROM for frequent data changes.
• Slower Write Speeds: Although faster than some ROM types, writing data to
EEPROM is still slower compared to RAM due to the electrical erasing
process involved.
• Higher Cost: EEPROMs are generally more expensive to manufacture
compared to traditional ROM due to their more complex circuitry.
• Lower Capacity: EEPROMs typically have a lower data storage capacity
compared to hard drives or solid-state drives (SSDs).

Applications of EEPROM:
• Storing BIOS Settings: EEPROMs are commonly used to store BIOS (Basic
Input/Output System) settings in computers. These settings control hardware
configuration and can be occasionally updated.
• Configuration Data: EEPROMs are useful for storing configuration data in
various devices like printers, routers, and embedded systems. This data
allows for customization and can be adjusted without replacing the device.
• Programmable Logic Controllers (PLCs): EEPROMs are used in PLCs to
store control programs for industrial automation systems. These programs
can be updated as needed.
• Smart Cards: EEPROMs are used in smart cards to store data like financial
information or identification details securely.
Flash Memory
Flash memory, ubiquitous in our daily lives, plays a crucial role in storing and
transporting data. It bridges the gap between the speed and volatility of RAM and the
permanence and capacity of hard drives. Let's delve into the fascinating world of flash
memory:

How it Works:
Flash memory utilizes a technology called NAND flash, which relies on floating-gate
transistors similar to EEPROMs. Here's a breakdown of the storage mechanism:
• Data Representation: Each floating-gate transistor stores multiple bits (typically 1 to
4) of data. The number of electrons trapped in the floating gate determines the voltage
level, representing different binary values (0s and 1s).
• Programming: To write data, a voltage is applied to the control gate, forcing electrons
through the oxide layer to accumulate around the floating gate. The number of
electrons trapped determines the programmed voltage level.
• Erasing: Unlike EEPROMs that erase individual bytes, flash memory erases entire
blocks of transistors at once. A high voltage is applied across the cell, causing
electrons to tunnel away from the floating gate, effectively erasing the data in that
block.
Types of Flash Memory:
• Single-Level Cell (SLC): Stores only one bit per cell, offering the highest
performance, endurance (write cycles), and reliability. However, it's also the
most expensive and has the lowest capacity.
• Multi-Level Cell (MLC): Stores two or three bits per cell, providing a
balance between cost and capacity but with lower endurance and
performance compared to SLC.
• Triple-Level Cell (TLC): Stores three bits per cell, offering the highest
capacity and affordability but with the lowest endurance and performance
among the three types.
Advantages of Flash Memory:
• Non-volatile storage: Data persists even when the power is off, similar to
hard drives.
• Faster access times: Compared to hard drives with spinning platters, flash
memory offers much faster read and write speeds.
• Solid-state design: No moving parts, leading to higher durability, shock
resistance, and lower power consumption compared to HDDs.
• Scalability: Flash memory cells can be miniaturized, allowing for high-
density storage in compact devices like smartphones and USB drives.
• Rewritable: Flash memory can be erased and reprogrammed multiple times.

Disadvantages of Flash Memory:


• Limited write cycles: Flash memory can wear out after a certain number of
erase/write cycles, especially with MLC and TLC types.
• Slower than RAM: While faster than HDDs, flash memory still falls short
of RAM's speed, which is crucial for real-time applications.
• Price: Flash memory can be more expensive than HDDs per gigabyte,
though the price gap is narrowing.
• Data fragmentation: Frequent erasing and rewriting can lead to data
fragmentation, impacting performance. Techniques like wear leveling are
used to mitigate this.

Applications of Flash Memory:


• Solid-state drives (SSDs): Replacing traditional HDDs in computers for
faster boot times, application loading, and overall system responsiveness.
• USB flash drives: Portable storage devices offering high capacity and
portability for data transfer.
• Memory cards: Used in cameras, smartphones, and other devices for storing
photos, videos, and other files.
• Embedded systems: Flash memory is prevalent in various devices due to its
compact size, low power consumption, and durability.
Cache Memory
Cache memory, often simply called cache, plays a crucial role in improving the
performance of computer systems, including embedded systems.
• It acts as a high-speed buffer that stores frequently accessed data and
instructions close to the processor (CPU).
• This significantly reduces the time it takes for the CPU to access the data it
needs, leading to faster overall system performance.

Understanding the Bottleneck:


• Main memory (RAM), while essential for storing data, has limitations in
terms of access speed compared to the CPU.
• Accessing data from RAM takes longer than accessing data from the CPU's
internal registers.
• This difference in speed can create a bottleneck, slowing down the entire
system.
Cache to the Rescue:
• Cache memory bridges this gap by acting as a smaller, extremely fast
memory located between the CPU and main memory.
• It stores copies of the most recently used data and instructions from RAM.
• When the CPU needs a piece of data, it first checks the cache. If the data is
present (a cache hit), it can be retrieved much faster than accessing it from
main memory.
• This significantly reduces the average time it takes for the CPU to access
data, leading to a performance boost.

Benefits:
 Faster Data Access
 Reduced Memory Traffic
 Improved Instruction Processing
Device Drivers
• Device Driver in computing refers to a special kind of software program or a
specific type of software application that controls a specific hardware device
that enables different hardware devices to communicate with the computer’s
Operating System.
• A device driver communicates with the computer hardware by computer
subsystem or computer bus connected to the hardware.
• Device Drivers are essential for a computer system to work properly because
without a device driver the particular hardware fails to work accordingly,
which means it fails in doing the function/action it was created to do.
How it works ?

• Application Requests: Imagine you're using a program to print a document.


The program initiates the process by sending a request to the operating
system (OS). This request specifies what needs to be printed (data) and the
destination (printer).
• OS Delegates the Task: The OS recognizes it needs the help of a device
driver to interact with the printer. It locates the appropriate device driver
based on the type of printer you have.
• Device Driver Takes Control: The device driver springs into action. It
translates the high-level request from the application (e.g., print this
document) into a series of specific commands that the printer can
understand.
• Communication with Hardware: The device driver communicates with the
printer hardware through well-defined channels like buses (data pathways
within the computer) or device control ports. It sends the translated
commands, which might involve controlling print settings, formatting data
for printing, and transmitting the data itself.
• Hardware Responds: The printer receives the instructions from the device
driver and performs the requested actions. It interprets the commands,
prepares the ink cartridges, positions the paper, and prints the document.
Key Functionalities of Device Drivers:

• Translation: Device drivers act as translators, converting generic software


requests into hardware-specific instructions. They bridge the gap between the
high-level programming languages used in applications and the low-level
machine code that hardware devices understand.
• Data Formatting: Data might need to be formatted differently depending on
the device. Device drivers handle any necessary data conversion to ensure
smooth communication.
• Error Handling: Device drivers can detect and manage errors that may
occur during communication with the hardware. They can implement retry
mechanisms, report errors to the OS or application, and help isolate the
problem.
• Optimization: Well-written device drivers can optimize data transfer and
communication protocols, leading to faster performance and efficient use of
system resources.
Types of Device Driver:

• Kernel-mode Device Driver – This Kernel-mode device driver includes


some generic hardware that loads with the operating system as part of the OS
these are BIOS, motherboard, processor, and some other hardware that are
part of kernel software. These include the minimum system requirement
device drivers for each operating system.
• User-mode Device Driver – Other than the devices which are brought by
the kernel for working the system the user also brings some devices for use
during the using of a system that devices need device drivers to function
those drivers fall under User mode device driver. For example, the user
needs any plug-and-play action that comes under this.
Benefits of Device Drivers:

• Smooth Hardware Integration: Device drivers enable seamless interaction


between various hardware components and the software, ensuring your
computer functions as a cohesive unit.
• Improved Performance: Optimized device drivers can enhance data
transfer speeds and communication efficiency, leading to a more responsive
system.
• Hardware Abstraction: Device drivers provide a layer of abstraction for
the hardware. Applications don't need to worry about the specifics of each
device model; they simply interact with the standard interface provided by
the driver.
• Device Management: Device drivers can handle device-specific tasks like
power management, initialization, and configuration.

You might also like