Embedded and Real-Time Operating Systems: Course Code: 70439
Embedded and Real-Time Operating Systems: Course Code: 70439
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
2
Module - II: Typical Embedded System
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.
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
16
RISC vs CISC Processors/Controllers
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
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.
25
Base Address+0 Byte 0 Byte 0 0x20000 (Base Address)
Byte 3
Base Address+3 Byte 3
Address+2) 0x20003
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.)
27
Base Address+0 Byte 3 Byte 3 0x20000 (Base Address)
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
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
34
Gate Array Based ASIC
35
Channeled Gate Array
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)
40
FPGAs (Field Programmable Gate Array)
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
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)
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.
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
60
Memory Selection for Embedded Systems
61
Module - II: Typical Embedded System
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
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).
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