0% found this document useful (0 votes)
17 views

Microcontroller and Embeddes System - ARM Program Optimization 3

The document discusses different types of memory used in embedded systems including ROM, RAM, SRAM, DRAM and flash memory. It describes each type of memory in terms of their characteristics, applications and advantages/limitations.

Uploaded by

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

Microcontroller and Embeddes System - ARM Program Optimization 3

The document discusses different types of memory used in embedded systems including ROM, RAM, SRAM, DRAM and flash memory. It describes each type of memory in terms of their characteristics, applications and advantages/limitations.

Uploaded by

Remya Bharathy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

21CS43:

MICROCONTROLLER AND
EMBEDDED SYSTEMS
MODULE 4
Syllabus- Module 4 2

➢ Embedded System Components: ➢ Core of an Embedded System


o Embedded Vs General computing system o Types of processor/controller,

o Memory
o History of embedded systems
o Sensors,
o Classification of Embedded systems
o Actuators
o Major applications areas of embedded
o LED, 7 segment LED display
systems
o Stepper motor, Keyboard, Push button switch,
o Purpose of embedded systems. o Communication Interface (onboard and external types),

o Embedded firmware,

o Other system components.


Memory 3

➢ 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.
➢ Also some working memory is required for holding data temporarily
during certain operations.
Program Storage Memory (ROM) 4

➢ The program memory or code storage memory of an embedded system stores the program
instructions.

➢ The code memory retains its contents even after the power is turned off. It is generally
known as non-volatile storage memory.

➢ It can be classified into different types as shown:


Program Storage Memory ( ROM)- Masked ROM ( MROM)
5

➢ Masked ROM is a one-time programmable device.


➢ Masked ROM makes use of the hardwired technology for storing data.
➢ The device is factory programmed by masking and metallization process at the
time of production itself, according to the data provided by the end user.
➢ Advantage – low cost for high volume production.
➢ Limitation - inability to modify the device firmware against firmware upgrades.
➢ Since the MROM is permanent in bit storage, it is not possible to alter the bit
information.
Program Storage Memory ( ROM)- Masked ROM ( MROM)
6

➢ Different mechanisms are used for the masking process of the ROM, like
Creation of an enhancement or depletion mode transistor through channel
implant.
o By creating the memory cell either using a standard transistor or a high
threshold transistor.

➢ In the high threshold mode, the supply voltage required to turn ON the
transistor is above the normal ROM IC operating voltage.
➢ This ensures that the transistor is always off and the memory cell stores
always logic 0.
Program Storage Memory ( ROM)- Programmable Read Only
7
Memory (PROM) / (OTP)
➢ One Time Programmable Memory (OTP) or PROM is not pre-programmed by the manufacturer.
o The end user is responsible for programming these devices.

➢ This memory has nichrome or polysilicon wires arranged in a matrix. These wires functionally
viewed as fuses.
o It is programmed by a PROM programmer which selectively burns the fuses according to the bit
pattern to be stored.

➢ OTP is widely used for commercial production of embedded systems whose prototyped versions
are proven and the code is finalised.
o It is a low cost solution for commercial production.

o OTPs cannot be reprogrammed.


Program Storage Memory ( ROM)- Erasable Programmable
8
Read Only Memory (EPROM)
➢ EPROM gives the flexibility to re-program the same chip.

➢ EPROM stores the bit information by charging the floating gate of an FET(Field Effect
Transistor).

➢ EPROM contains a quartz crystal window for erasing the stored information.
o If the window is exposed to ultraviolet rays for a fixed duration, the entire memory will be erased.

➢ 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.
o It is a tedious and time-consuming process.
Program Storage Memory ( ROM)- Electrically Erasable
9
Programmable Read only Memory (EEPROM)

➢ The information contained in the EEPROM memory can be altered by


using electrical signals 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 (a few kilobytes) when
compared with the standard ROM.
Program Storage Memory ( ROM)- FLASH memory
10

➢ FLASH memory is a variation of EEPROM technology – It combines the re- programmability of


EEPROM and the high capacity of standard ROMs.

➢ FLASH is the latest ROM technology.


o Most popular ROM technology used in today's embedded designs.

➢ FLASH memory is organised as sectors (blocks) or pages.

➢ FLASH memory stores information in an array of floating gate MOSFET transistors.


o The erasing of memory can be done at sector level or page level without affecting the other sectors or pages.

o Each sector/page should be erased before re-programming.

➢ The typical erasable capacity of FLASH is 1000 cycles.


o E.g.: W27C512 from WINBOND is an example of 64KB FLASH memory.
Program Storage Memory ( ROM)- Non-Volatile RAM (NVRAM)
11

➢ Non-volatile RAM is a random access memory with battery backup.


o 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.

➢ The life span of NVRAM is expected to be around 10 years.


o E.g.: DS1644 from Maxim/Dallas is an example of 32KB NVRAM.
Read-Write Memory/Random Access Memory (RAM) 12

➢ 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 – when the power is turned off, all the contents are destroyed.

➢ RAM is a direct access memory – we can access the desired memory location directly
without the need for traversing through the entire memory locations to reach the desired
memory position (i.e. random access of memory location).

➢ This is in contrast to the Sequential Access Memory (SAM), where the desired memory
location is accessed by either traversing through the entire memory or through a 'seek'
method. Magnetic tapes, CD ROMs, etc. are examples of sequential access memories.
Read-Write Memory/Random Access Memory (RAM)
13

➢ RAM generally falls into three categories: Static RAM (SRAM), Dynamic RAM
(DRAM) and Non-Volatile RAM (NVRAM).
Random Access Memory (RAM) - Static RAM (SRAM)
14

➢ Static RAM stores data in the form of voltage.


➢ They are made up of flip-flops.
➢ Static RAM is the fastest form of RAM available.
o Fast due to its resistive networking and switching capabilities.

➢ In typical implementation, an SRAM cell (bit) is realised using six transistors (or
6 MOSFETs).
o Four of the transistors are used for building the latch (flip-flop) part of the memory cell
and two for controlling the access.

➢ The major limitations of SRAM are low capacity and high cost.
Random Access Memory (RAM) - Static RAM (SRAM)
15

➢ In its simplest representation an SRAM cell can be visualised as

shown in the figure below:


Random Access Memory (RAM) - Static RAM (SRAM)
16

➢ This implementation in its simpler form can be visualised 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 visualised as shown in the figure below:


Random Access Memory (RAM) - Dynamic RAM (DRAM)
17

➢ Dynamic RAM stores data in the form of charge.

➢ They are made up of MOS transistor gates.

➢ Advantages – high density and low cost compared to SRAM.

➢ Disadvantage – 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.


Random Access Memory (RAM) - Dynamic RAM (DRAM)
18

➢ Figure below illustrates the typical implementation of a DRAM cell.


➢ The MOSFET acts as the gate for the incoming and outgoing data whereas
the capacitor acts as the bit storage unit.
Random Access Memory (RAM) – SRAM vs DRAM
19

SRAM Cell DRAM Cell


Made up of 6 CMOS transistors Made up of a MOSFET and a capacitor
(MOSFET)
Doesn't require refreshing Requires refreshing
Low capacity (Less dense) High capacity (Highly dense)
More expensive Less expensive
Fast in operation. Typical access time Slow in operation due to refresh
is 10ns requirements. Typical access time is
60ns. Write operation is faster than
read operation.
Memory According to the Typeof Interface 20

➢ The interface (connection) of memory with the processor/controller can be of various types.
o Parallel interface

o Serial interface like I2C

o SPI (Serial peripheral interface)

o Single wire interconnection (like Dallas 1-Wire interface)

➢ Serial interface is commonly used for data storage memory like EEPROM.
o The memory density of a serial memory is usually expressed in terms of kilobits, whereas that of a parallel
interface memory is expressed in terms of kilobytes.

o Atmel Corporations AT24C512 is an example for serial memory with capacity 512 kilobits and 2-wire
interface.
Memory Shadowing 21

➢ Generally the execution of a program or a configuration from a ROM is very slow


o RAM access is about three times as fast as ROM access.

➢ Memory Shadowing is a technique adopted to solve the execution speed problem


in processor-based systems.
➢ In computer systems and video systems there will be a configuration holding
ROM called Basic Input Output Configuration ROM or simply BIOS.
o BIOS stores the hardware configuration information like the address assigned for various
serial ports and other non-plug 'n' play devices, etc.

o Usually it is read and the system is configured according to it during system boot up and
it is time consuming.
Memory Shadowing (continued) 22

➢ In memory shadowing, a RAM is included behind the logical layer of BIOS at its
same address as a shadow to the BIOS.
➢ The first step that happens during the boot up is copying the BIOS to the
shadowed RAM and write protecting the RAM then disabling the BIOS reading.
o RAM is volatile and it cannot hold the configuration data which is copied from the BIOS
when the power supply is switched off. Only a ROM can hold it permanently.

o But for high system performance it should be accessed from a RAM instead of accessing
from a ROM.
Memory Selection for Embedded Systems 23

➢ 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

➢ Memory for holding non-volatile data (like configuration data, look up table etc) 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.

➢ Lot of factors need to be considered when selecting the type and size of memory for
embedded system.
Memory Selection for Embedded Systems 24

➢ There are two parameters for representing a memory:

1. Size of the memory chip – Memory density expressed in terms of number of memory bytes
per chip.
o Memory chips come in standard sizes
• like 512 bytes, 1024 bytes (1 kilobyte), 2048 bytes (2 kilobytes), 4KB, 8KB, 16KB, 32KB, 64KB, 128KB, 256KB, 512KB, 1024KB(1
megabytes), etc.

o While selecting a memory size, the address range supported by the processor must also be considered.
o The entire memory range supported by the processor/controller may not be available to the memory chip
alone. It may be shared between I/O, other ICs and memory.

2. Word size of the memory – The number of memory bits that can be read/written together at
a time.
o Word size can be 4, 8, 12, 16, 24, 32, etc.
o The word size supported by the memory chip must match with the data bus width of the
processor/controller.
Sensors and Actuators 25

➢ An embedded system is in constant interaction with the real world and the
controlling/monitoring functions executed by the embedded system is
achieved in accordance with the changes happening to the real world.
➢ The changes in system environment or variables are detected by the
sensors connected to the input port of the embedded system.
➢ If the embedded system is designed for any controlling purpose, the
system will produce some changes in the controlling variable to bring the
controlled variable to the desired value. It is achieved through an actuator
connected to the output port of the embedded system.
Sensors and Actuators 26

➢ A sensor is a transducer device that converts energy from one form


to another for any measurement or control purpose.
o E.g.: Temperature sensor, magnetic hall effect sensor, humidity sensor, etc.

➢ An actuator is a form of transducer device (mechanical or


electrical) which converts signals to corresponding physical action
(motion).
o Actuator acts as an output device.
o E.g.: Stepper motor
The I/O Subsystem 27

➢ The I/O subsystem of the embedded system facilitates the


interaction of the embedded system with the external world.
➢ The interaction happens through the sensors and actuators
connected to the input and output ports respectively of the
embedded system.
➢ The sensors may not be directly interfaced to the input ports,
instead they may be interfaced through signal conditioning and
translating systems like ADC, optocouplers, etc.
Light Emitting Diode (LED) 28

➢ Light Emitting Diode (LED) is an important output device for visual indication in any
embedded system.
o LED can be used as an indicator for the status of various signals or situations.

o E.g.: 'Device ON', 'Battery low' or 'Charging of battery’ conditions

➢ Light Emitting Diode is a p-n junction diode and it contains an anode and a cathode.
o For proper functioning of the LED, the anode is connected to +ve terminal of the supply voltage and
cathode to the -ve terminal of supply voltage.

➢ The current flowing through the LED must be limited to a value below the maximum current
that it can conduct.

➢ A resister is used in series to limit the current through the LED.

➢ The ideal LED interfacing circuit is shown in the figure.


Light Emitting Diode (LED) (continued) 29

➢ LEDs can be interfaced to the port pin of a processor/controller in two


ways:
o In the first method, the anode is directly connected to the port pin and the port
pin drives the LED.
• The port pin 'sources' current to the LED when the port pin is at logic High (Logic ‘1’).

o In the second method, the cathode of the LED is connected to the port pin of the
processor/controller and the anode to the supply voltage through a current
limiting resistor.
• The LED is turned on when the port pin is at logic Low (Logic '0’).

• Here the port pin 'sinks' current.


7-Segment LED Display 30

➢ The 7-segment LED display is an output device for displaying


alpha numeric characters.
o It contains 7 LED segments arranged in a special form used for
displaying alpha numeric characters and 1 LED used for
representing 'decimal point' in decimal number display.

➢ The LED segments are named A to G and the decimal point


LED segment is named as DP.
o The LED segments A to G and DP should be lit accordingly to
display numbers and characters.
7-Segment LED Display (continued) 31

➢ The 7-segment LED displays are available in two different configurations, namely; Common Anode
and Common Cathode.

➢ In the common anode configuration, the anodes of the 8 segments are connected commonly whereas
in the common cathode configuration, the cathodes of 8 LED segments are connected commonly.

➢ Figure illustrates the Common Anode and Cathode configurations.


7-Segment LED Display (continued) 32

➢ Based on the configuration of the 7-segment LED unit, the LED segment's anode or cathode
is connected to the port of the processor/controller in the order 'A' segment to the least
significant port pin and DP segment to the most significant port pin.

➢ The current flow through each of the LED segments should be limited to the maximum
value supported by the LED display unit.
o The typical value is 20mA.

o The current can be limited by connecting a current limiting resistor to the anode or cathode of
each segment.

➢ 7-segment LED display is used in low cost embedded applications like Public telephone call
monitoring devices, point of sale terminals, etc.
Stepper Motor 33

➢ A stepper motor is an electro-mechanical device which generates discrete


displacement (motion) in response to dc electrical signals.
➢ It differs from the normal dc motor in its operation.
➢ The dc motor produces continuous rotation on applying dc voltage whereas a
stepper motor produces discrete rotation in response to the dc voltage applied to
it.
➢ Stepper motors are widely used in industrial embedded applications, consumer
electronic products and robotics control systems.
➢ The paper feed mechanism of a printer/fax makes use of stepper motors for its
functioning.
Stepper Motor- Unipolar 34

➢ A unipolar stepper motor contains two windings per phase.

➢ The direction of rotation (clockwise or anticlockwise) of a stepper motor is


controlled by changing the direction of current flow.

➢ Current in one direction flows through one coil and in the opposite direction
flows through the other coil.

➢ It is easy to shift the direction of rotation by just switching the terminals to


which the coils are connected.

➢ The coils are represented as A, B, C and D.


➢ Coils A and C carry current in opposite directions for phase 1 (only one of them will
be carrying current at a time).

➢ Similarly, B and D carry current in opposite directions for phase 2 (only one of them
will be carrying current at a time).
Stepper Motor -Bipolar 35

➢ A bipolar stepper motor contains single winding per phase.

➢ For reversing the motor rotation, the current flow through the

windings is reversed dynamically.


o The stepping of stepper motor can be implemented in different ways by
changing the sequence of activation of the stator windings.
Stepper Motor 36

➢ Full Step: both the phases are


energised simultaneously.
➢ Wave Step: only one phase is
energised at a time and each coils
of the phase is energised
alternatively.
➢ Half Step: uses the combination
of wave and full step. It has the
highest torque and stability.
Stepper Motor 37
Keyboard 38

➢ Keyboard is an input device for user


interfacing.
➢ If the number of keys required is very
limited, push button switches can be
used and they can be directly
interfaced to the port pins for
reading.
➢ Matrix keyboard is an optimum
solution for handling large key
requirements.
Keyboard 39

➢ In a matrix keyboard, the keys are arranged in matrix fashion

➢ For detecting a key press, the keyboard uses the scanning technique, where
each row of the matrix is pulled low and the columns are read.
o After reading the status of each columns corresponding to a row, the row is
pulled high and the next row is pulled low and the status of the columns are read.

o This process is repeated until the scanning for all rows are completed.

➢ When a row is pulled low and if a key connected to the row is pressed,
reading the column to which the key is connected will give logic 0.
Keyboard 40

➢ Since keys are mechanical devices, there is a possibility for de-bounce issues, which may
give multiple key press effect for a single key press.
o To prevent this, a proper key de-bouncing technique should be applied.

o Hardware key de-bouncer circuits and software key de-bounce techniques are the key de-
bouncing techniques available.

➢ In the software de-bouncing technique, on detecting a key-press, the key is read again after a
de-bounce delay.
o If the key press is a genuine one, the state of the key will remain as ‘pressed’ on the second read
also.

➢ Pull-up resistors are connected to the column lines to limit the current that flows to the Row
line on a key press.
Push Button Switch 41

➢ It is an input device.

➢ Push button switch comes in 2 configurations,

1. 'Push to Make' configuration, the switch is normally in the open state


and it makes a circuit contact when it is pushed or pressed.

2. 'Push to Break' configuration, the switch is normally in the closed


state and it breaks the circuit contact when it is pushed or pressed.
• The push button stays in the 'closed' (For Push to Make type) or 'open' (For
Push to Break type) state as long as it is kept in the pushed state and it
breaks/makes the circuit connection when it is released.
Push Button Switch (continued) 42

➢ Push button is used for generating a momentary


pulse.
➢ In embedded applications, push button is generally
used as reset and start switch and pulse generator.
➢ The Push button is normally connected to the port pin
of the host processor/controller.
➢ Depending on the way in which the push button
interfaced to the controller, it can generate either a
'HIGH' pulse or a 'LOW' pulse.

You might also like