Embedded and Real-Time Operating Systems: Course Code: 70439 | PDF | Random Access Memory | Read Only Memory
0% found this document useful (0 votes)
81 views

Embedded and Real-Time Operating Systems: Course Code: 70439

Byte0, Byte1, Byte2, Byte3  Big-endian is an order in which the “big end”/ the higher-order byte of the data (most significant value in the sequence) is stored in memory at the lowest address. (The big end comes first.)  For example, a 4 byte long integer Byte3, Byte2, Byte1, Byte0 will be stored in the memory as shown below:

Uploaded by

Srikanth
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Embedded and Real-Time Operating Systems: Course Code: 70439

Byte0, Byte1, Byte2, Byte3  Big-endian is an order in which the “big end”/ the higher-order byte of the data (most significant value in the sequence) is stored in memory at the lowest address. (The big end comes first.)  For example, a 4 byte long integer Byte3, Byte2, Byte1, Byte0 will be stored in the memory as shown below:

Uploaded by

Srikanth
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 76

EMBEDDED AND REAL-TIME

OPERATING SYSTEMS
Course Code: 70439
Mr N Srikanth Prasad
Assistant Professor
Department of Electronics and Communication Engineering
Malla Reddy Engineering College(A)
nsp.mrec@gmail.com
+91-93 9104 9134

1
Course Description
• Module – I : Introduction to Embedded Systems
• Module - II : Typical Embedded System
• Module - III : Embedded Firmware
• Module – IV : Operating System Concepts

• Module – V : Real-Time Operating Systems

2
Module - II: Typical Embedded System

• Core of the Embedded System: General Purpose and Domain


Specific Processors, ASICs, PLDs, Commercial Off-The-Shelf
Components (COTS)

• Memory: ROM, RAM, Memory according to the type of Interface,


Memory Shadowing, Memory selection for Embedded Systems

• Sensors and Actuators

• Communication Interface: Onboard and External Communication


Interfaces.  

3
Typical Embedded System
 A typical embedded system contains a single chip controller, which acts as the
master brain of the system.
 The controller can be a Microprocessor or a microcontroller or a Field
Programmable Gate Array (FPGA) device or a Digital Signal Processor
(DSP) or an Application Specific Integrated Circuit (ASIC)/ Application
Specific Standard Product (ASSP).
 Embedded hardware/software systems are basically designed to regulate a
physical variable or to manipulate the state of some devices by sending some
control signals to the Actuators or devices connected to the o/p ports of the
system, in response to the input signals provided by the end users or Sensors
which are connected to the input ports.

4
5
 Keyboards, push button switches, etc. are examples for common user
interface input devices whereas LEDs, liquid crystal displays,
piezoelectric buzzers, etc. are examples for common user interface
output devices for a typical embedded system.

 For example, if the embedded system is designed for any handheld


application, such as a mobile handset application, then the system
should contain user interfaces like a keyboard for performing input
operations and display unit for providing users the status of various
activities in progress.

6
Elements of an Embedded System

7
CORE OF EMBEDDED SYSTEMS
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:
1. General purpose and Domain Specific
Processors
i. Microprocessors
ii. Microcontrollers
iii. Digital Signal Processors
8
2. Application Specific Integrated Circuits.
(ASIC)
3. Programmable logic devices(PLD’s)
4. Commercial off-the-shelf components
(COTs)

9
Merits, Drawbacks and Application Areas
of Microcontrollers and Microprocessors
 Microcontrollers are designed to perform specific tasks.
However, Microprocessors are designed to perform unspecific
tasks like developing software, games, website, photo editing,
creating documents, etc.
 Depending on the input, some processing for microcontroller
needs to be done and output is defined. However, the relationship
between input and output for microprocessor is not defined.
 Since the applications of microcontroller are very specific, they
need small resources like RAM, ROM, I/O ports etc. and hence
can be embedded on a single chip. Microprocessors need high
amount of resources like RAM, ROM, I/O ports etc.
10
 The clock speed of Microprocessor is quite high as compared to
the microcontroller. Whereas the microcontrollers operate from a
few MHz (from 30 to 50 MHz), today’s microprocessor operate
above 1 GHz as they perform complex tasks.
 Microprocessor cannot be used stand alone. They need other
peripherals like RAM, ROM, buffer, I/O ports etc and hence a
system designed around a microprocessor is quite costly.
 Application areas of microcontroller: Mobile phones, CD/DVD
players, Washing machines, Cameras, Security alarms, microwave
oven, etc.
 Application areas of microprocessor: Calculators, Accounting
Systems, Games Machine, Complex Industrial Controllers, Data
Acquisition Systems, Military applications, Communication
11
systems, etc.
12
13
Digital Signal Processors

 DSPs are powerful special purpose 8/16/32


bit microprocessors designed specifically to
meet the computational demands and power
constraints of today’s embedded audio, video,
and communications applications.
 Digital Signal Processors are 2 to 3 times
faster than the general purpose
microprocessors in signal processing
applications.
14
• A typical digital signal processor incorporates the following
key units:
i. Program Memory : Memory for storing the program
required by DSP to process the data.
ii. Data Memory : Working memory for storing temporary
variables/information and data/signal to be processed.
iii. Computational Engine : Performs the signal/math
processing , accessing the program from the Program
Memory and the data from the Data Memory.
iv. I/O Unit : Acts as an interface
15
Between the outside world and DSP. It is responsible for
capturing signals to be processed and delivering the processed
signals.
 Application areas : Audio video signal processing,
telecommunication and multimedia applications.
 DSP employs a large amount of real-time calculations, Sum
of products (SOP) calculation, convolution, fast Fourier
transform (FFT), discrete Fourier transform (DFT), etc. are
some of the operations performed by digital signal processors.

16
RISC vs CISC Processors/Controllers

CISC Architecture RISC  Architecture

17
Advantages of CISC Architecture
 Microprogramming is easy to implement and much less
expensive than hard wiring a control unit.
 It is easy to add new commands into the chip without
changing the structure of the instruction set as the architecture
uses general-purpose hardware to carry out commands.
 This architecture makes the efficient use of main memory
since the complexity (or more capability) of instruction allows
to use less number of instructions to achieve a given task.
 The compiler need not be very complicated, as the micro
program instruction sets can be written to match the constructs
of high level languages.
18
Disadvantages of CISC Architecture

 A new or succeeding versions of CISC processors


consists early generation processors in their subsets
(succeeding version). Therefore, chip hardware and
instruction set became complex with each generation
of the processor.
 The overall performance of the machine is reduced
because of slower clock speed.
 The complexity of hardware and on-chip software
included in CISC design to perform many functions.
19
Advantages of RISC Architecture
 The performance of RISC processors is often two to four times
than that of CISC processors because of simplified instruction set.
 This architecture uses less chip space due to reduced instruction
set. This makes to place extra functions like floating point
arithmetic units or memory management units on the same chip.
 The per-chip cost is reduced by this architecture that uses smaller
chips consisting of more components on a single silicon wafer.
 RISC processors can be designed more quickly than CISC
processors due to its simple architecture.
 The execution of instructions in RISC processors is high due to
the use of many registers for holding and passing the instructions
as compared to CISC processors. 20
Disadvantages of RISC Architecture

 The performance of a RISC processor depends on the


code that is being executed. The processor spends much
time waiting for first instruction result before it proceeds
with next subsequent instruction, when a compiler
makes a poor job of scheduling instruction execution.

 RISC processors require very fast memory systems to


feed various instructions. Typically, a large memory
cache is provided on the chip in most RISC based
systems.

21
RISC vs CISC

22
Complex Instruction Set Computing

23
Reduced Instruction Set Computing

24
Big-Endian vs. Little-Endian
Processors/Controllers
 Endianness specifies the order in which a sequence of bytes are
stored in computer memory.

 Little-endian is an order in which the “little end”/ the lower-order


byte of the data (least significant value in the sequence) is stored
in memory at the lowest address. (The little end comes first.)

 For example, a 4 byte long integer Byte3, Byte2, Byte1, Byte0


will be stored in the memory as shown below:

25
Base Address+0 Byte 0 Byte 0 0x20000 (Base Address)

Base Address+1 Byte 1 Byte 1


0x20001 (Base Address+1)

Base Address+2 Byte 2 Byte 2


0x20002 (Base

Byte 3
Base Address+3 Byte 3
Address+2) 0x20003

Example : 90AB12CD (Hexadecimal) (Base Address+3)

26
 Big-endian is an order in which the “big end” / the
higher-order byte of the data (most significant value in
sequence) is stored in memory at the lowest address.
(The big end comes first.)

 For example, a 4 byte long integer Byte3, Byte2, Byte1,


Byte0 will be stored in the memory as shown below:

27
Base Address+0 Byte 3 Byte 3 0x20000 (Base Address)

Base Address+1 Byte 2 Byte 2


0x20001 (Base Address+1)

Base Address+2 Byte 1 Byte 1


0x20002 (Base

Byte 0
Base Address+3 Byte 0
Address+2) 0x20003

(Base Address+3)
Example : 90AB12CD (Hexadecimal)

28
Von-Neuman Architecture

29
Harvard Architecture

30
Application Specific Integrated Circuits

• ASICs are categorized based on the amount of


customization a programmer is allowed to do
on a chip

31
Full Custom
• In this type of design all the logic cells are
tailored made for specific application .i.e.
designer has to specially make the logic cells for
the circuits.
• All the mask layers for interconnection are
customized.
• So programmer can’t change interconnections of
the chip and while programming he has to be
aware of the circuit layout.
32
Semi-Custom
• In this type of design logic cells are taken from
standard libraries .i.e. they are not handcrafted
as in Full custom design. Some masks are
customized while some are taken from the
predesigned library.
• ASICs are divided into two types-
Standard cell-based ASIC
Gate Array-based ASIC.

33
Standard cell-based ASIC

• To know these IC first let us understand what a


standard cell library stands for. Some of the logic cells
such as AND gates, OR gates, multiplexers, flip-
flops are predesigned by designers using different
configurations, standardized and stored in the form of a
library.

34
Gate Array Based ASIC

• This type of semi-custom ASIC have


predefined transistors on the silicon wafer
.i.e. the designer cannot change the placement
of the transistors present on the die.
• Gate Array Based ASIC are of three types.
 Channeled Gate Array,
 Channel less gate array
 Structured gate array.

35
Channeled Gate Array

• In this type of gate array, wiring space is left between


rows of transistors.
• These are similar to CBIC as space is left for
interconnection between blocks but in channeled gate
array cell rows are fixed in height whereas in CBIC
this space can be adjusted.

36
Channel Less Gate Array
• There is no free space left for routing between rows
of cells as seen in the channeled gate array.
• Here routing is done from above the gate array cells
as we can customize the connection between the
metal 1 and transistors.
• For routing, we leave the transistors lying in the path
of routing unused.
• The manufacturing lead time is about two weeks.

37
Structured Gate Array
• This type of gate array has an embedded block along
with gate array rows as seen above.
• Structured gate array has a higher area efficiency of
CBIC.
• Like Masked gate array these have lower cost and faster
turnaround.
• Here the fixed size of the embedded function poses a
limitation on the structured gate array.

38
Programmable ASIC
• There are two types of programmable ASICs. They are PLD
and FPGA
• PLDs (Programmable Logic Devices)
• These are the standard cells readily available. We can program
a PLD to customized a part of the application, so they are
considered as ASIC.
• We can use different methods and software to program a PLD.
• These contain a regular matrix of logic cells usually
programmable array logic along with flip-flops or latches.
• Here interconnects are present as a single large block.

39
PLDs (Programmable Logic Devices)

• PROM is a common example of this IC. EPROM


uses MOS transistors as interconnect so by
applying high voltage we can program it.
• PLDs have no customized logic cells or
interconnect. These have a fast design
turnaround.

40
FPGAs (Field Programmable Gate Array)

• Where PLDs have programmable array logic as logic


cells FPGA has gate array-like arrangement.
• PLDs are smaller and less complex than FPGAs.
• Due to its flexibility and characteristics, FPGA is
replacing TTL in microelectronic systems.
• The core consists of programmable basic logic cells
which can perform both combinational
and sequential logic.
• We can program logic cells and interconnect using
some methods.
41
• Basic logic cells are surrounded by the matrix of
programmable interconnects and the core is
surrounded by programmable I/O cells.
• FPGA usually comprises of configurable logic
blocks, configurable I/O blocks, programmable
interconnects, clock circuitry, ALU, memory,
decoders.
• We have seen the different types of ASIC available.
Now let’s understand when all these customizations
and interconnects are done during manufacturing.
42
43
ASIC FPGA
Not reprogrammable Reprogrammable
Preferred for High volume productions Preferred for low volume productions
These are Application Specific Used as prototypes of a system
Energy Efficient requires less power Less energy efficient requires more power
These are permanent circuitry that can’t Highly suitable for applications where the
be upgraded from time to time. circuit has to be upgraded time to time
such as cell phone chips, Base stations etc

44
Commercial off-the-shelf
components(COTs)
• The COTS components itself may be develop around a
general purpose or domain specific processor or an ASICs
or a PLDs.
• 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
• 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.
45
• Advantages of COTS:
– Ready to use
– Easy to integrate
– Reduces development time
• Disadvantages of COTS:
– No operational or manufacturing standard (all
proprietary)
– Vendor or manufacturer may discontinue
production of a particular COTS product
46
Module - II: Typical Embedded System

• Core of the Embedded System: General Purpose and Domain


Specific Processors, ASICs, PLDs, Commercial Off-The-Shelf
Components (COTS)

• Memory: ROM, RAM, Memory according to the type of Interface,


Memory Shadowing, Memory selection for Embedded Systems

• Sensors and Actuators

• Communication Interface: Onboard and External Communication


Interfaces.  

47
Memory
 Memory is an important part of a processor/controller based
embedded systems.
 Some of the processors/controllers contain built in memory
and this memory is referred as on-chip memory.
 Others do not contain any memory inside the chip and requires
external memory to be connected with the
controller/processor to store the control algorithm. It is called
off-chip memory.

48
 There are different types of memory used in embedded system applications:
i. Program Storage Memory (ROM)
 Masked ROM (MROM)
 Programmable Read Only Memory (PROM)/ (OTP)
 Erasable Programmable Read Only Memory (EPROM)
 Electrically Erasable Programmable Read Only Memory (EEPROM)
 FLASH
ii. Read-Write Memory/Random Access Memory (RAM)
 Static RAM (SRAM)
 Dynamic RAM (DRAM)
 NVRAM

49
Program Storage Memory (ROM)

• The program memory or code storage


memory of an embedded system stores the
program instructions and it can be classified
into different types as per the block diagram
representation given in Figure.

50
Classification of ROM
 Mask ROM : Masked ROM is a static ROM which comes
programmed into an integrated circuit by its manufacturer.
Masked ROM makes use of the hardwired technology for
storing data. It is a good candidate for storing the embedded
firmware for low cost embedded devices. The primary
advantage of this is low cost for high volume production.
The limitation with MROM based firmware storage is the
inability to modify the device firmware against firmware
upgrades. They are used in network operating systems, server
operating systems, storing of fonts for laser printers, sound
data in electronic musical instruments.

51
• PROM/ OTP : Unlike MROM, One Time Programmable
Memory (OTP) or PROM is not pre-programmed by the
manufacturer. The end user is responsible for programming
these devices. They have several different applications,
including cell phones, video game consoles, RFID tags, medical
devices, and other electronics.

• EPROM : EPROM gives the flexibility to re-program the same


chip. EPROM stores the bit information by charging the
floating gate of an FET and contains a quartz crystal window
for erasing the stored information. Even though the EPROM chip
is flexible in terms of re- programmability, it needs to be taken
out of the circuit board and put in a UV eraser device for 20 to
30 minutes. So it is a tedious and time-consuming process.

52
 EEPROM : The information contained in the EEPROM
memory can be altered by using electrical signal at the
register/Byte level. They can be erased and reprogrammed
in-circuit. These chips include a chip erase mode and in this
mode they can be erased in a few milliseconds. It provides
greater flexibility for system design. The only limitation is
their capacity is limited when compared with the standard
ROM (a few kilobytes). It is used for storing the computer
system BIOS.

53
• FLASH : It is an enhanced version of EEPROM. It
combines the re-programmability of EEPROM and the high
capacity of standard ROMs. FLASH memory is organized as
sectors (blocks) or pages. FLASH memory stores information
in an array of floating gate MOS-FET transistors. The erasing
of memory can be done at sector level or page level without
affecting the other sectors or pages. Each sector/ page should
be erased before re-programming. The typical erasable
capacity of FLASH is 1000 cycles. Many modern PCs have
their BIOS stored on a flash memory chip, called as flash
BIOS and they are also used in memory cards, USB flash
drives, modems as well.

54
Read-Write Memory/
Random Access Memory (RAM)
 The Random Access Memory (RAM) is the data memory
or working memory of the controller/processor.
 Controller/processor can read from it and write to it.
 RAM is volatile, meaning when the power is turned off, all
the contents are destroyed.
• RAM generally falls into three categories: Static RAM
(SRAM), dynamic RAM (DRAM) and non- volatile RAM
(NVRAM).

55
SRAM vs DRAM

56
57
NVRAM
• NVRAM: Non-volatile RAM is a random access memory
with battery backup.
• It contains static RAM based memory and a minute battery
for providing supply to the
memory in the absence of external power supply.
• The memory and battery are packed together in a single
package.
• NVRAM is used for the non-volatile storage of results of
operations.
• The life span of NVRAM is expected to be around 10 years.
• DS1744 from Maxim/Dallas is an example for 32 KB
NVRAM.
58
Memory According to the Type of
Interface
• The interface (connection) of memory with the
processor/controller can be of various types.
• It may be a parallel interface or the interface
may be a serial interface like I2C or it may be
an SPI

59
Memory Shadowing

• The execution of a program or a confi guration


from a Read Only Memory (ROM) is very slow
(120 to 200 ns) compared to the execution from
a random access memory (40 to 70 ns) .
• In computer systems and video systems there
will be a confi guration holding ROM called Basic
Input Output Confi guration ROM or simply BIOS

60
Memory Selection for Embedded Systems

• Embedded systems require a program memory for holding the


control algorithm or embedded OS and the applications designed
to run on top of it ,data memory for holding variables and
temporary data during task execution, and memory for holding
non-volatile data which are modifiable by the application
• The memory requirement for an embedded system in terms of
RAM and ROM (EEPROM/FLASH/NVRAM) is solely
dependent on the type of the embedded system and the
applications for which it is designed.
• There is no hard and fast rule for calculating the memory
requirements

61
Module - II: Typical Embedded System

• Core of the Embedded System: General Purpose and Domain


Specific Processors, ASICs, PLDs, Commercial Off-The-Shelf
Components (COTS)

• Memory: ROM, RAM, Memory according to the type of Interface,


Memory Shadowing, Memory selection for Embedded Systems

• Sensors and Actuators

• Communication Interface: Onboard and External Communication


Interfaces.  

62
What is a Sensor
• A sensor is a device that can detect the changes in a
physical environment.
• It can convert physical parameters such as temperature,
heat, motion, humidity, pressure, etc. into electrical signals.
• We can transform this signal into a human readable display
and send them through a network for further processing.
• There are mainly two types of sensors as active sensors and
passive sensors.
• Active sensors require power supply while passive sensors
do not require a power supply.

63
• Biosensors – These sensors use electrochemical
technology. Medical devices, food and water
testing devices use these sensors. These sensors
help to analyze cells, proteins, nucleic acid, etc.
• Image Sensors – These sensors use
Complementary Metal Oxide Sensor (CMOS)
technology. They detect and transfer information
used to make an image. Consumer electronics
and surveillance systems use these sensors.

64
• Chemical Sensors – These sensors helps to get
information about the chemical composition of the
environment such as liquid, gas phase, etc.
• Motion Detectors – These sensors are based on
Ultrasonic, Microwave, radar technologies. Security
systems, video games etc. use them.
• Accelerometers – These sensors use Micro Electro
Mechanical Sensor Technology. Patient monitoring,
vehicle systems etc. use these sensors.

65
What is an Actuator
• An actuator is a device that converts a control signal into
some kind of movement.
• It obtains a control signal in the form of electric voltage,
current, hydraulic fluid, pneumatic or hydraulic pressure.
• The actuator converts the received control signal into
mechanical motion.
• Furthermore, speed, force, operating conditions and
durability are some important facts to consider when
determining the performance of an actuator.
• Electric motors, stepper motors, comb drives, hydraulic
cylinders, etc. are some common actuators.

66
• A simple example of a system that uses both
sensors and actuators is a temperature
controlling system. A temperature sensor can
convert the temperature in the environment to
an electrical signal. An electric motor operates
as an actuator converts that signal into
movement. It can result in rotating a fan.
Therefore, if the temperature is high, the fan
starts rotating.
67
68
Module - II: Typical Embedded System

• Core of the Embedded System: General Purpose and Domain


Specific Processors, ASICs, PLDs, Commercial Off-The-Shelf
Components (COTS)

• Memory: ROM, RAM, Memory according to the type of Interface,


Memory Shadowing, Memory selection for Embedded Systems

• Sensors and Actuators

• Communication Interface: Onboard and External Communication


Interfaces.  

69
Communication Interface
• For an embedded product, the communication interface can be
viewed in two different perspectives; namely; Device/board
level communication interface (Onboard Communication
Interface) and Product level communication interface
(External Communication Interface).

• Embedded product is a combination of different types of


components (chips/devices) arranged on a printed circuit board
(PCB). Serial interfaces like I2C, SPI, UA RT, 1-Wire, etc
and parallel bus interface are examples of ‘Onboard
Communication Interface’.
70
Inter Integrated Circuit (I2C) Bus
• The Inter Integrated Circuit Bus is a synchronous bi-
directional half duplex two wire serial interface bus. The I2C
bus comprise of two bus lines, namely; Serial Clock-SCL and
Serial Data-SDA.
• SCL line is responsible for generating synchronization
clock pulses and SDA is responsible for transmitting the serial
data across devices.

• Devices connected to the I2C bus can act as either ‘Master’


device or ‘Slave’ device.
71
• The ‘Master’ device is responsible for controlling
the communication by initiating/ terminating data
transfer, sending data and generating necessary
synchronization clock pulses.

• ‘Slave’ devices wait for the commands from the


master and respond upon receiving the commands.
‘Master’ and ‘Slave’ devices can act as either
transmitter or receiver. I2C supports multi masters
on the same bus.
72
I2C Bus Interfacing

73
Serial Peripheral Interface (SPI) Bus
• The Serial Peripheral Interface Bus (SPI) is a
synchronous bi-directional full duplex four-wire serial
interface bus.
•SPI is a single master multi-slave system.
•SPI requires four signal lines for communication. They are
Master Out Slave In (MOSI), Master In Slave Out (MISO),
Serial Clock (SCLK) and Slave Select (SS).
•When compared to I2C, SPI bus is most suitable for
applications requiring transfer of data in ‘streams’.

74
SPI bus interfacing

75
External Communication Interfaces
• The External Communication Interface refers to the different
communication channels/buses used by the embedded system to
communicate with the external world. The various interfaces for
external communication are as follows
i. RS-232 C & RS-485
ii. Universal Serial Bus (USB)
iii. IEEE 1394 (Firewire)
iv. Infrared (IrDA)
v. Bluetooth (BT)
vi. Wi-Fi
vii.ZigBee
viii.General Packet Radio Service (GPRS)

76

You might also like