Introduction to Embedded System I : Chapter 2 (2nd portion)
1. Introduction to
EMBEDDED SYSTEM
(2nd Edition)
SHIBU K V
Dr Moe Moe Myint
Department of Computer Engineering & Information Technology
Mandalay Technological University
www.slideshare.net/MoeMoeMyint
moemoemyint@moemyanmar.ml
moe2myint.mdy@gmail.com
drmoemoemyint.blogspot.com
2. Agenda
2.1 Core of the Embedded System 17
2.2 Memory 28
2.3 Sensors and Actuators 35
2.4 Communication Interface 45
2.5 Embedded Firmware 59
2.6 Other System Components 60
2.7 PCB and Passive Components 64
2
Mandalay Technological University
Department of Computer Engineering and Information Technology
3. Learning Objectives
Learn the building blocks of a typical Embedded System
Learn about General Purpose Processors (GPPs), Application
Specific Instruction Set Processors (ASIPs), Microprocessors,
Microcontrollers, Digital Signal Processors, RISC & CISC
processors, Harvad and Von-Neumann Processor Architecture, Big-
endian v/s Little endian processors, Load Store operation and
Instruction pipelining
Learn about different PLDs like Complex Programmable Logic
Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), etc.
3
Mandalay Technological University
Department of Computer Engineering and Information Technology
4. Cont’d
Learn about the different memory technologies and memory types used in
embedded system development
Learn about Masked ROM (MROM), PROM, OTP, EPROM, EEPROM, and
FLASH memory for embedded firmware storage
Learn about Serial Access Memory (SAM), Static Random Access Memory
(SRAM), Dynamic Random Access Memory (DRAM) and Nonvolatile
SRAM (NVRAM)
Understand the different factors to be considered in the selection of memory
for embedded systems
Understand the role of sensors, actuators and their interfacing with the I/O
subsystems of an embedded system
4
Mandalay Technological University
Department of Computer Engineering and Information Technology
5. Cont’d
Learn about the interfacing of LEDs, 7-segment LED Displays, Piezo Buzzer,
Stepper Motor, Relays, Optocouplers, Matrix keyboard, Push button switches,
Programmable Peripheral Interface Device (e.g. 8255 PPI), etc. with the I/O
subsystem of the embedded system
Learn about the different communication interfaces of an embedded system
Understand the various chip level communication interfaces like I2C, SPI,
UART, 1-wire, parallel bus, etc
Understand the different wired and wireless external communication interfaces
like RS-232C, RS-485, Parallel Port, USB, IEEE1394, Infrared (IrDA),
Bluetooth, Wifi, ZigBee, GPRS, etc.
Know what embedded firmware is and its role in embedded systems
5
Mandalay Technological University
Department of Computer Engineering and Information Technology
6. Cont’d
Understand the different system components like Reset Circuit,
Brown-out protection circuit, Oscillator Unit, Real-Time Clock
(RTC) and Watchdog Timer unit
Understand the role of PCB in embedded systems
6
Mandalay Technological University
Department of Computer Engineering and Information Technology
7. 2.2 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.
7
Mandalay Technological University
Department of Computer Engineering and Information Technology
8. Cont’d
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
8
Mandalay Technological University
Department of Computer Engineering and Information Technology
9. 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.
The code memory retains its contents
even after the power to it is turned
off. It is generally known as non-
volatile storage memory.
Depending on the fabrication, erasing
and programming techniques they are
classified into the following types.
9
Figure. Classification of Program Memory (ROM)
Mandalay Technological University
Department of Computer Engineering and Information Technology
Non Volatile
Memory
FLASH
10. 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.
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.
10
Mandalay Technological University
Department of Computer Engineering and Information Technology
11. Cont’d
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.
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.
11
Mandalay Technological University
Department of Computer Engineering and Information Technology
12. How MOS-FET Transistor works?12
Mandalay Technological University
Department of Computer Engineering and Information Technology
13. 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.
13
Mandalay Technological University
Department of Computer Engineering and Information Technology
Cont’d
14. 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).
14
Figure. Classification of Working Memory (RAM)
Mandalay Technological University
Department of Computer Engineering and Information Technology
15. Static RAM (SRAM)
SRAM : SRAM stores data in the
form of voltage. They are made up
of flip-flops. A flip-flop for a
memory cell takes four or six
transistors (or 6 MOSFETs) along
with some wiring, four of the
transistors are used for building the
latch (flip-flop) part of the memory
cell and two for controlling the
access. SRAM is fast in operation
due to its resistive networking and
switching capabilities. In its simplest
representation an SRAM cell can be
visualized as shown in Figure.
15
Figure. SRAM Cell Implementation
Mandalay Technological University
Department of Computer Engineering and Information Technology
16. Cont’d
This implementation in its simpler form can be visualized as two-cross coupled inverters
with read/write control through transistors. The four transistors in the middle form the
cross-coupled inverters. This can be visualized as shown in Figure.
The major limitations of SRAM are low capacity and high cost.
16
Mandalay Technological University
Department of Computer Engineering and Information Technology
Figure. Visualization of SRAM cell
17. Dynamic RAM (DRAM)
DRAM : DRAM stores data in the form of charge. They are made up
of MOS transistor gates.
The advantages of DRAM are its high density and low cost compared
to SRAM.
The disadvantage is that since the information is stored as charge it
gets leaked off with time and to prevent this they need to be
refreshed periodically.
Special circuits called DRAM controllers are used for the refreshing
operation.
The refresh operation is done periodically in milliseconds interval.
The MOSFET acts as the gate for the incoming and outgoing data
whereas the capacitor acts as the bit storage unit.
17
Figure. DRAM Cell Implementation
Mandalay Technological University
Department of Computer Engineering and Information Technology
18. Summary of the relative merits and demerits of
SRAM and DRAM technology
18
SRAM Cell DRAM Cell
Made up of 6 CMOS transistors (MOSFET) Made up of a MOSFET and a capacitor
Doesn’t require refreshing Requires refreshing
Low capacity (Less dense) High capacity (Highly dense)
More expensive Less expensive
Fast in operation.
Typical access time is 10 ns.
Slow in operation due to refresh
requirements.
Typical access time is 60 ns. Write operation
is faster than read operation.
Mandalay Technological University
Department of Computer Engineering and Information Technology
19. 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.
19
Mandalay Technological University
Department of Computer Engineering and Information Technology
20. Understanding Test Questions III
1. Which of the following is one-time programmable memory?
(a) SRAM (b) PROM (c) FLASH (d) NVRAM
2. Which of the following memory type is best suited for development purpose?
(a) EEPROM (b) FLASH (c) UVEPROM (d) OTP
(e) (a) or (b)
3. EEPROM memory is alterable at byte level. State True or False
(a) True (b) False
4. Non-volatile RAM is a Random Access Memory with battery backup. State True or
False
(a) True (b) False
5. Execution of program from ROM is faster than the execution from RAM. Sate True
or False
(a) True (b) False
6. Dynamic RAM stores data in the form of voltage. State True or False
(a) True (b) False
20
Mandalay Technological University
Department of Computer Engineering and Information Technology
21. Reviewed Questions III
1. What is the difference between RAM and ROM?
2. What are the different types of RAM used for Embedded System design?
3. What are the different types of memories used for Program storage in
Embedded System Design?
4. What are the advantages of FLASH over other program storage in
Embedded System Design?
5. Explain the operation of Static RAM (SRAM) cell.
6. Explain the merits and limitations of SRAM and DRAM as Random
Access Memory.
21
Mandalay Technological University
Department of Computer Engineering and Information Technology
22. Assignment III
Write a “C” program to find the endianness of the
processor in which the program is running. If the
processor is big endian, print “The processor architecture
is Big endian”, else print “The processor architecture is
Little endian” on the console window.
Remark: for all groups
Deadline : 2. 1. 18 (Coming Tuesday)
22
Mandalay Technological University
Department of Computer Engineering and Information Technology
23. Only Original Owner has full rights reserved for copied images.
This PPT is only for fair academic use.
Coming soon for chapter 2 (2nd portion)
23
Mandalay Technological University
Department of Computer Engineering and Information Technology
Understand the different types of core i.e. processor
Understand the difference between microprocessor & microcontroller
Understand the classification of processors based on Bus Architecture, Instruction set Architecture, and Endiannes.
Have an overview of processors from most simple and cheap to most expensive and complex, powerful
Understand what are sensors and actuators, communication interfaces
What are the different types of memories used for Program storage in Embedded System Design?
What is the difference between RAM and ROM?
Fabrication : manufacture/invent a product especially from prepared component
The Read Only Memory (ROM) is a non-volatile memory for storing the firmware and embedded OS files. MROM, PROM (OTP), EPROM, EEPROM, FLASH and NVRAM are the commonly used firmware storage memory.
The Random Access Memory (RAM) is a volatile memory for temporary data storage. RAM generally falls into three categories: SRAM, DRAM and NVRAM.
Volatile memory, it means information written to it can be accessed as long as power is on.
As soon as the power is off, it can not be accessed.
Vice versa
RFID : Radio Frequency Identification
RFID tagging is an ID system that uses small radio frequency identification devices for identification and tracking purposes. An RFID tagging system
Includes the tag itself, a read/write device, and a host system application for data collection, processing, and transmission.
An RFID tag (sometimes called an RFID transponder) consists of a chip, some memory and an antenna.
What is the difference between Masked ROM and OTP?
OTPs are not useful and worth for development purpose. Not economical……
EPROM stores the bit information by charging the floating gate of an FET transistors.
(The floating-gate MOSFET (FEMOS) is a field-effect transistor, whose structure is similar to a conventional MOSFET.
Bit information is stored by using an EPROM programmer, which applies high voltage to charge the floating gate.
EPROM contains a quartz crystal window for erasing the stored information.
If the window is exposed to ultraviolet rays for a fixed duration, the entire memory will be erased.
A normal transistor has three connections (wires that control it) called the source, drain, and gate.
Think of a transistor as a pipe through which electricity can flow as through it’s water.
One end of the pipe (where the water flows in) is called the source- think of that as a tap or faucet.
The other end of the pipe is called the drain-where the water drains out and flows away.
In between the source and drain, blocking the pipe, there’s a gate.
When the gate is closed, the pipe is shut off, no electricity can flow and the transistor is off. In this state, the transistor stores a zero.
When the gate is opened, electricity flows, the transistor is on, and it stores a one.
But when the power is turned off, the transistor switches off too. When you switch the power back on, the transistor is still off, and since you can’t know whether it was on or off before the power was removed, you can see why we say it “forgets” any information it stores.
MOS (Metal Oxide Semiconductor) Field Effect transistor
What are the advantages of FLASH over other program storage memory in Embedded System Design?
Latest ROM technology ( Combines the re-programmability of EEPROM and the high capacity of standard ROMs)
So, Flash ROM is much faster than EEPROM.
How flash memory works – the simple explanation
Flash works using an entirely different kind of transistor that stays switched on (or switched off) even when the power is turned off. A normal transistor has three connections (wires that control it) called the source, drain, and gate. Think of a transistor as a pipe through which electricity can flow as through it’s water. One end of the pipe (where the water flows in) is called the source- think of that as a tap or faucet. The other end of the pipe is called the drain-where the water drains out and flows away. In between the source and drain, blocking the pipe, there’s a gate. When the gate is closed, the pipe is shut off, no electricity can flow and the transistor is off. In this state, the transistor stores a zero. When the gate is opened, electricity flows, the transistor is on, and it stores a one. But when the power is turned off, the transistor switches off too. When you switch the power back on, the transistor is still off, and since you can’t know whether it was on or off before the power was removed, you can see why we say it “forgets” any information it stores.
Volatile memory, it means information written to it can be accessed as long as power is on.
As soon as the power is off, it can not be accessed.
So this mean RAM computer memory essentially empty.
RAM holds data and processing instructions temporarily until the CPU needs it.
Explain the operation of Static RAM (SRAM) cell.
A digital computer needs devices which can store information. A flip flop is a binary storage device.
It can store binary bit either 0 or 1. It has two stable states HIGH and LOW i.e. 1 and 0.
It can store binary bit either 0 or 1.
It has two stable states HIGH and LOW i.e. 1 and 0. (Flip Flop NAND / NOR Gate)
SRAM retains stored information only as long as the power supply is on.
SRAMs are costlier and consume more power. They have higher speed than DRAM.
A form of flip-flop holds each bit of memory.
From the SRAM implementation diagram, it is clear that access to the memory cell is controlled by the line Word Line, which controls the access transistors (MOSFETs) Q5 and Q6. The access transistors control the connection to bit lines B & B\. In order to write a value to the memory cell, apply the desired value to the bit control lines (For writing 1, make B=1 and B\=0; For writing 0, make B=0 and B\=1) and assert the Word Line (Make Word line high). This operation latches the bit written in the flip-flop. For reading the content of the memory cell, assert both B and B\ bit lines to 1 and set the Word line to 1.
Current is the rate of flow of charge. In other words a current is caused by the electrons moving around the conductor.
A voltage is defined as the work done per unit charge. This means that voltage is the amount of energy used for each charge.
Capaciftance is reisitance to change in voltage by sacrificing or absorbing current.
Explain the merits and limitations of SRAM and DRAM as Random Access Memory.
SRAM retains stored information only as long as the power supply is on.
SRAMs are costlier and consume more power. They have higher speed than DRAM.
A form of flip-flop holds each bit of memory.