Embedded Microprocessors and Its Applications
Embedded Microprocessors and Its Applications
Applications
An embedded microprocessor is a computer chip used inside several devices and equipments
to provide added functionality. A microprocessor is a digital-electronic component with
transistors integrated on a single semiconductor IC that is small and consumes less power.
Due to flexibility, cost, programmability and adaptability microcontrollers are
popular to implement various types of controllers that we know from the electronics
history. The functions of the microprocessor include fetching, decoding and processing the
data.
embedded microprocessor
Embedded microprocessor systems are nothing but computer chips that
are integral part of lighting system, home appliances, industrial
equipments, etc. Generally, microprocessors are used in signal processing,
general computing and real-time computing data. As a signal processor,
microprocessors’ uses in digital televisions include decoding of the digital
and radio signals. In real-time systems, microprocessors are embedded in
security devices like anti-lock breaking system; these systems are widely
used in automobiles. Its importance includes:
Control Unit
Registers
System Bus
Memory Unit
Cache memory is a small amount of memory located on the chip of a
microprocessor. A microprocessor stores a copy of data and instructions in
its cache memory while executing the program. Types of microprocessor
memory include ROM and RAM.
Control Unit
Control Unit is the brain of a microprocessor as it manages complete
operations. It performs the operations like managing input, output
devices, storing data and fetching instructions.
Registers
Registers are small, fast memories built into the central processing unit
(CPU) to speed up its operation. General purpose registers store arbitrary
data and special purpose registers control the processor.
System Bus
System bus is a single wire used to attach different components to
communicate with the internal and external parts of the microprocessor.
The bus receives data and instructions from the main memory, and then
sends them to instruction cache and data cache. Finally these are
processed and the results are again sent to the main memory through this
bus.
Types of Microprocessors
The classification of embedded-microprocessor depends on several factors
like computing performance, availability of memory, type of application,
etc., and some of these microprocessors include:
Superscalar microprocessors
Applications of Microprocessor
Applications of Microprocessor
These microprocessors can be used for general purpose applications or
special purpose applications. The applications of microprocessors include
the following:
Communication
In telephone industry, microprocessors are used in modems, telephone
exchanges, digital telephone sets, and also in air reservation systems and
railway reservation systems both at international and national levels.
Mobile phones and televisions also use microprocessors.
Instrumentation
In various instruments, microprocessors are implemented as main
controllers and also used in medical instruments to measure
temperature and blood pressure.
Control
Microprocessors are now available in home appliances like washing
machines and microwave ovens; and, in industrial-
automation sectors, microcontrollers are used to control various
parameters like temperature, speed, moisture and pressure.
MICROPROSESSOR
Initially, the instructions are stored in the memory in a sequential order. The microprocessor fetches
those instructions from the memory, then decodes it and executes those instructions till STOP
instruction is reached. Later, it sends the result in binary to the output port. Between these processes,
the register stores the temporarily data and ALU performs the computing functions.
Instruction Set − It is the set of instructions that the microprocessor can understand.
Bandwidth − It is the number of bits processed in a single instruction.
Clock Speed − It determines the number of operations per second the processor can perform. It
is expressed in megahertz (MHz) or gigahertz (GHz).It is also known as Clock Rate.
Word Length − It depends upon the width of internal data bus, registers, ALU, etc. An 8-bit
microprocessor can process 8-bit data at a time. The word length ranges from 4 bits to 64 bits
depending upon the type of the microcomputer.
Data Types − The microprocessor has multiple data type formats like binary, BCD, ASCII, signed
and unsigned numbers.
Features of a Microprocessor
Cost-effective − The microprocessor chips are available at low prices and results its low cost.
Size − The microprocessor is of small size chip, hence is portable.
Low Power Consumption − Microprocessors are manufactured by using metaloxide
semiconductor technology, which has low power consumption.
Versatility − The microprocessors are versatile as we can use the same chip in a number of
applications by configuring the software program.
Reliability − The failure rate of an IC in microprocessors is very low, hence it is reliable.
RISC stands for Reduced Instruction Set Computer. It is designed to reduce the execution time by
simplifying the instruction set of the computer. Using RISC processors, each instruction requires only
one clock cycle to execute results in uniform execution time. This reduces the efficiency as there are
more lines of code, hence more RAM is needed to store the instructions. The compiler also has to work
more to convert high-level language instructions into machine code.
CISC Processor
CISC stands for Complex Instruction Set Computer. It is designed to minimize the number of
instructions per program, ignoring the number of cycles per instruction. The emphasis is on building
complex instructions directly into the hardware.
The compiler has to do very little work to translate a high-level language into assembly level
language/machine code because the length of the code is relatively short, so very little RAM is required
to store the instructions.
IBM 370/168
VAX 11/780
Intel 80486
Architecture of CISC
Its architecture is designed to decrease the memory cost because more storage is needed in larger
programs resulting in higher memory cost. To resolve this, the number of instructions per program can
be reduced by embedding the number of operations in a single instruction.
Characteristics of CISC
Variety of addressing modes.
Larger number of instructions.
Variable length of instruction formats.
Several cycles may be required to execute one instruction.
Instruction-decoding logic is complex.
One instruction is required to support multiple addressing modes.
Special Processors
These are the processors which are designed for some special purposes. Few of the special
processors are briefly discussed −
Coprocessor
A coprocessor is a specially designed microprocessor, which can handle its particular function many
times faster than the ordinary microprocessor.
It is a specially designed microprocessor having a local memory of its own, which is used to control I/O
devices with minimum CPU involvement.
For example −
A transputer is a specially designed microprocessor with its own local memory and having links to
connect one transputer to another transputer for inter-processor communications. It was first designed
in 1980 by Inmos and is targeted to the utilization of VLSI technology.
A transputer can be used as a single processor system or can be connected to external links, which
reduces the construction cost and increases the performance.
For example − 16-bit T212, 32-bit T425, the floating point (T800, T805 & T9000) processors.
Program Memory − It stores the programs that DSP will use to process data.
Data Memory − It stores the information to be processed.
Compute Engine − It performs the mathematical processing, accessing the program from the
program memory and the data from the data memory.
Input/Output − It connects to the outside world.
Accumulator
It is an 8-bit register used to perform arithmetic, logical, I/O & LOAD/STORE operations. It is connected
to internal data bus & ALU.
As the name suggests, it performs arithmetic and logical operations like Addition, Subtraction, AND,
OR, etc. on 8-bit data.
There are 6 general purpose registers in 8085 processor, i.e. B, C, D, E, H & L. Each register can hold
8-bit data.
These registers can work in pair to hold 16-bit data and their pairing combination is like B-C, D-E & H-L.
Program counter
It is a 16-bit register used to store the memory address location of the next instruction to be executed.
Microprocessor increments the program whenever an instruction is being executed, so that the program
counter points to the memory address of the next instruction that is going to be executed.
Stack pointer
It is also a 16-bit register works like stack, which is always incremented/decremented by 2 during push
& pop operations.
Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic and logical operations.
Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending upon the result
stored in the accumulator.
Sign (S)
Zero (Z)
Auxiliary Carry (AC)
Parity (P)
Carry (C)
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
It is an 8-bit register. When an instruction is fetched from memory then it is stored in the Instruction
register. Instruction decoder decodes the information present in the Instruction register.
It provides timing and control signal to the microprocessor to perform operations. Following are the
timing and control signals, which control external and internal circuits −
As the name suggests it controls the interrupts during a process. When a microprocessor is executing a
main program and whenever an interrupt occurs, the microprocessor shifts the control from the main
program to process the incoming request. After the request is completed, the control goes back to the
main program.
There are 5 interrupt signals in 8085 microprocessor: INTR, RST 7.5, RST 6.5, RST 5.5, TRAP.
It controls the serial data communication by using these two instructions: SID (Serial input data) and
SOD (Serial output data).
The content stored in the stack pointer and program counter is loaded into the address buffer and
address-data buffer to communicate with the CPU. The memory and I/O chips are connected to these
buses; the CPU can exchange the desired data with the memory and I/O chips.
Data bus carries the data to be stored. It is bidirectional, whereas address bus carries the location to
where it should be stored and it is unidirectional. It is used to transfer the data & Address I/O devices.
Architecture
We have tried to depict the architecture of 8085 with this following image −
Address bus
Data bus
AD7-AD0, it carries the least significant 8-bit address and data bus.
These signals are used to identify the nature of operation. There are 3 control signal and 3 status
signals.
RD − This signal indicates that the selected IO or memory device is to be read and is ready for
accepting data available on the data bus.
WR − This signal indicates that the data on the data bus is to be written into a selected memory
or IO location.
ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes down it
indicates data.
IO/M
This signal is used to differentiate between IO and Memory operations, i.e. when it is high indicates IO
operation and when it is low then it indicates memory operation.
S1 & S0
Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v power supply and VSS indicates
ground signal.
Clock signals
X1, X2 − A crystal (RC, LC N/W) is connected at these two pins and is used to set frequency of
the internal clock generator. This frequency is internally divided by 2.
CLK OUT − This signal is used as the system clock for devices connected with the
microprocessor.
Interrupts are the signals generated by external devices to request the microprocessor to perform a
task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR. We will discuss
interrupts in detail in interrupts section.
Addressing Modes
These are the instructions used to transfer the data from one register to another register, from the
memory to the register, and from the register to the memory without any alteration in the content.
Addressing modes in 8085 is classified into 5 groups −
In this mode, the 8/16-bit data is specified in the instruction itself as one of its operand. For
example: MVI K, 20F: means 20F is copied into register K.
In this mode, the data is copied from one register to another. For example: MOV K, B: means data in
register B is copied to register K.
In this mode, the data is directly copied from the given address to the register. For example: LDB
5000K: means the data at address 5000K is copied to register B.
In this mode, the data is transferred from one register to another by using the address pointed by the
register. For example: MOV K, B: means data is transferred from the memory address pointed by the
register to the register K.
This mode doesn’t require any operand; the data is specified by the opcode itself. For example: CMP.
Interrupts in 8085
Interrupts are the signals generated by the external devices to request the microprocessor to perform a
task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
Vector interrupt − In this type of interrupt, the interrupt address is known to the processor. For
example: RST7.5, RST6.5, RST5.5, TRAP.
Non-Vector interrupt − In this type of interrupt, the interrupt address is not known to the
processor so, the interrupt address needs to be sent externally by the device to perform
interrupts. For example: INTR.
Maskable interrupt − In this type of interrupt, we can disable the interrupt by writing some
instructions into the program. For example: RST7.5, RST6.5, RST5.5.
Non-Maskable interrupt − In this type of interrupt, we cannot disable the interrupt by writing
some instructions into the program. For example: TRAP.
Software interrupt − In this type of interrupt, the programmer has to add the instructions into the
program to execute the interrupt. There are 8 software interrupts in 8085, i.e. RST0, RST1,
RST2, RST3, RST4, RST5, RST6, and RST7.
Hardware interrupt − There are 5 interrupt pins in 8085 used as hardware interrupts, i.e. TRAP,
RST7.5, RST6.5, RST5.5, INTA.
Features of 8086
It has an instruction queue, which is capable of storing six instruction bytes from the memory
resulting in faster processing.
It was the first 16-bit processor having 16-bit ALU, 16-bit registers, internal data bus, and 16-bit
external data bus resulting in faster processing.
It is available in 3 versions based on the frequency of operation −
o 8086 → 5MHz
o 8086-2 → 8MHz
o (c)8086-1 → 10 MHz
It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage, which improves
performance.
Fetch stage can prefetch up to 6 bytes of instructions and stores them in the queue.
Execute stage executes these instructions.
It has 256 vectored interrupts.
It consists of 29,000 transistors.
These instructions are used to transfer the data from the source operand to the destination operand.
Following are the list of instructions under this group −
Arithmetic Instructions
These instructions are used to perform arithmetic operations like addition, subtraction, multiplication,
division, etc.
These instructions are used to perform operations where data bits are involved, i.e. operations like
logical, shift, etc.
String Instructions
String is a group of bytes/words and their memory is always allocated in a sequential order.
These instructions are used to control the processor action by setting/resetting the flag values.
These instructions are used to execute the given instructions for number of times. Following is the list of
instructions under this group −
LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0
LOOPE/LOOPZ − Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0
LOOPNE/LOOPNZ − Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0
JCXZ − Used to jump to the provided address if CX = 0
Interrupt Instructions
These instructions are used to call the interrupt during program execution.
INT − Used to interrupt the program during execution and calling service specified.
INTO − Used to interrupt the program during execution if OF = 1
IRET − Used to return from interrupt service to the main program
Interrupt is the method of creating a temporary halt during program execution and allows peripheral
devices to access the microprocessor. The microprocessor responds to that interrupt with
an ISR (Interrupt Service Routine), which is a short program to instruct the microprocessor on how to
handle the interrupt.
The following image shows the types of interrupts we have in a 8086 microprocessor −
Hardware Interrupts
Hardware interrupt is caused by any peripheral device by sending a signal through a specified pin to the
microprocessor.
The 8086 has two hardware interrupt pins, i.e. NMI and INTR. NMI is a non-maskable interrupt and
INTR is a maskable interrupt having lower priority. One more interrupt pin associated is INTA called
interrupt acknowledge.
NMI
It is a single non-maskable interrupt pin (NMI) having higher priority than the maskable interrupt request
pin (INTR)and it is of type 2 interrupt.
The INTR is a maskable interrupt because the microprocessor will be interrupted only if interrupts are
enabled using set interrupt flag instruction. It should not be enabled using clear interrupt Flag
instruction.
The INTR interrupt is activated by an I/O port. If the interrupt is enabled and NMI is disabled, then the
microprocessor first completes the current execution and sends ‘0’ on INTA pin twice. The first ‘0’
means INTA informs the external device to get ready and during the second ‘0’ the microprocessor
receives the 8 bit, say X, from the programmable interrupt controller.
Software Interrupts
Some instructions are inserted at the desired position into the program to create interrupts. These
interrupt instructions can be used to test the working of various interrupt handlers. It includes −
It is 2-byte instruction. First byte provides the op-code and the second byte provides the interrupt type
number. There are 256 interrupt types under this group.
Its execution includes the following steps −
Coprocessor Configuration
A Coprocessor is a specially designed circuit on microprocessor chip which can perform the same task
very quickly, which the microprocessor performs. It reduces the work load of the main processor. The
coprocessor shares the same memory, IO system, bus, control logic and clock generator. The
coprocessor handles specialized tasks like mathematical calculations, graphical display on screen, etc.
The 8086 and 8088 can perform most of the operations but their instruction set is not able to perform
complex mathematical operations, so in these cases the microprocessor requires the math coprocessor
like Intel 8087 math coprocessor, which can easily perform these operations very quickly.
Loosely coupled configuration consists of the number of modules of the microprocessor based systems,
which are connected through a common system bus. Each module consists of their own clock
generator, memory, I/O devices and are connected through a local bus.
Advantages
Having more than one processor results in increased efficiency.
Each of the processors have their own local bus to access the local memory/I/O devices. This
makes it easy to achieve parallel processing.
The system structure is flexible, i.e. the failure of one module doesn’t affect the whole system
failure; faulty module can be replaced later.
8087 numeric data processor is also known as Math co-processor, Numeric processor
extension and Floating point unit. It was the first math coprocessor designed by Intel to pair with
8086/8088 resulting in easier and faster calculation.
Once the instructions are identified by the 8086/8088 processor, then it is allotted to the 8087 co-
processor for further execution.
Binary Integers
Packed decimal numbers
Real numbers
Temporary real format
The most prominent features of 8087 numeric data processor are as follows −
It supports data of type integer, float, and real types ranging from 2-10 bytes.
The processing speed is so high that it can calculate multiplication of two 64-bits real numbers in
~27 µs and can also calculate square-root in ~35 µs.
It follows IEEE floating point standards.
Disadvantages of a microprocessor
The main disadvantages are it's overheating physically.
It is only based on machine language.
The overall cost is high.
The large size of PCB is required for assembling all components.
The physical size of the product is big.
Overall product design requires more time.
Memory Interfacing
When we are executing any instruction, we need the microprocessor to access the memory for reading
instruction codes and the data stored in the memory. For this, both the memory and the microprocessor
requires some signals to read from and write to registers.
The interfacing process includes some key factors to match with the memory requirements and
microprocessor signals. The interfacing circuit therefore should be designed in such a way that it
matches the memory signal requirements with the signals of the microprocessor.
IO Interfacing
There are various communication devices like the keyboard, mouse, printer, etc. So, we need to
interface the keyboard and other devices with the microprocessor by using latches and buffers. This
type of interfacing is known as I/O interfacing.
Interfacing Pins
Following is the list of 8085 pins used for interfacing with other devices −
There are two ways of communication in which the microprocessor can connect with the outside world.
Serial Communication Interface − In this type of communication, the interface gets a single byte of
data from the microprocessor and sends it bit by bit to the other system serially and vice-a-versa.
Parallel Communication Interface − In this type of communication, the interface gets a byte of data
from the microprocessor and sends it bit by bit to the other systems in simultaneous (or) parallel fashion
and vice-a-versa.
The following table highlights the differences between a microprocessor and a microcontroller −
Microcontroller Microprocessor
Microcontrollers are used to execute a single task within an application. Microprocessors are used for big
applications.
Its designing and hardware cost is low. Its designing and hardware cost is
high.
It is built with CMOS technology, which requires less power to operate. Its power consumption is high
because it has to control the entire
system.
It consists of CPU, RAM, ROM, I/O ports. It doesn’t consist of RAM, ROM,
I/O ports. It uses its pins to
interface to peripheral devices.
Types of Microcontrollers
Microcontrollers are divided into various categories based on memory, architecture, bits and instruction
sets. Following is the list of their types −
Bit
Based on bit configuration, the microcontroller is further divided into three categories.
8-bit microcontroller − This type of microcontroller is used to execute arithmetic and logical
operations like addition, subtraction, multiplication division, etc. For example, Intel 8031 and 8051
are 8 bits microcontroller.
16-bit microcontroller − This type of microcontroller is used to perform arithmetic and logical
operations where higher accuracy and performance is required. For example, Intel 8096 is a 16-
bit microcontroller.
32-bit microcontroller − This type of microcontroller is generally used in automatically controlled
appliances like automatic operational machines, medical appliances, etc.
Memory
Based on the memory configuration, the microcontroller is further divided into two categories.
External memory microcontroller − This type of microcontroller is designed in such a way that
they do not have a program memory on the chip. Hence, it is named as external memory
microcontroller. For example: Intel 8031 microcontroller.
Embedded memory microcontroller − This type of microcontroller is designed in such a way
that the microcontroller has all programs and data memory, counters and timers, interrupts, I/O
ports are embedded on the chip. For example: Intel 8051 microcontroller.
Instruction Set
Based on the instruction set configuration, the microcontroller is further divided into two categories.
CISC − CISC stands for complex instruction set computer. It allows the user to insert a single
instruction as an alternative to many simple instructions.
RISC − RISC stands for Reduced Instruction Set Computers. It reduces the operational time by
shortening the clock cycle per instruction.
Applications of Microcontrollers
If any pin of this port is configured as an input, then it acts as if it “floats”, i.e. the input has unlimited
input resistance and in-determined potential.
Output Configuration
When the pin is configured as an output, then it acts as an “open drain”. By applying logic 0 to a port bit,
the appropriate pin will be connected to ground (0V), and applying logic 1, the external output will keep
on “floating”.
In order to apply logic 1 (5V) on this output pin, it is necessary to build an external pullup resistor.
Port 1
P1 is a true I/O port as it doesn’t have any alternative functions as in P0, but this port can be configured
as general I/O only. It has a built-in pull-up resistor and is completely compatible with TTL circuits.
Port 2
P2 is similar to P0 when the external memory is used. Pins of this port occupy addresses intended for
the external memory chip. This port can be used for higher address byte with addresses A8-A15. When
no memory is added then this port can be used as a general input/output port similar to Port 1.
Port 3
In this port, functions are similar to other ports except that the logic 1 must be applied to appropriate bit
of the P3 register.
When pins are configured as an output (i.e. logic 0), then the single port pins can receive a
current of 10mA.
When these pins are configured as inputs (i.e. logic 1), then built-in pull-up resistors provide very
weak current, but can activate up to 4 TTL inputs of LS series.
If all 8 bits of a port are active, then the total current must be limited to 15mA (port P0: 26mA).
If all ports (32 bits) are active, then the total maximum current must be limited to 71mA.
Operating Modes
Mode 0 − In this mode, Port A and B is used as two 8-bit ports and Port C as two 4-bit ports.
Each port can be programmed in either input mode or output mode where outputs are latched
and inputs are not latched. Ports do not have interrupt capability.
Mode 1 − In this mode, Port A and B is used as 8-bit I/O ports. They can be configured as either
input or output ports. Each port uses three lines from port C as handshake signals. Inputs and
outputs are latched.
Mode 2 − In this mode, Port A can be configured as the bidirectional port and Port B either in
Mode 0 or Mode 1. Port A uses five signals from Port C as handshake signals for data transfer.
The remaining three signals from Port C can be used either as simple I/O or as handshake for
port B.
Features of 8255A
This block is responsible for controlling the internal/external transfer of data/control/status word. It
accepts the input from the CPU address and control buses, and in turn issues command to both the
control groups.
CS
It stands for Chip Select. A LOW on this input selects the chip and enables the communication between
the 8255A and the CPU. It is connected to the decoded address, and A 0 & A1 are connected to the
microprocessor address lines.
This mode is similar to Mode 2 except the output remains low for half of the timer period and high
for the other half of the period.
In this mode, the output will remain high until the timer has counted to zero, at which point the
output will pulse low and then go high again.
The count is latched when the GATE signal goes LOW.
On the terminal count, the output goes low for one clock cycle then goes HIGH. This low pulse
can be used as a strobe.