Unit - 3 Micro Processor
Unit - 3 Micro Processor
Was 4004
predicted that
• Microprocessors are specified by:
• Number of bits it can handle for data processing
The speed of operation: Higher the bits
microprocessor can handle for data processing,
faster is the processing. The speed
of operation is estimated from the clock frequency
of the microprocessor. Also, higher is the clock
frequency, faster is the processing
• Applications of microprocessors include
• Actuator control systems; speed, velocity and acceleration
control of electric motor, fluid power actuators.
• Control system for home appliances; microwave oven,
washing machine, refrigerator, heating system, air
conditioner (AC), and so on.
• Control systems for computer peripherals; Disk drives,
printers, keyboard, modem, and so on.
• Automobile control systems; Engine control, locking system,
monitoring system and so on.
• Traffic control systems; Road, air and ocean traffic,
navigation, spindle machines, etc.
• Machine control systems; Robotics, mobile robotics, crane,
Autonomous Guided Vehicle,(AGV), /Numerical Control (NC)
machine, etc.
• Production lines; Assembly lines, packaging systems, bottling
plant, etc.
• Several companies have already developed many
types of microprocessors and microcontrollers
• for general purpose to dedicated application. New
and advanced versions of microprocessors and
microcontrollers are constantly being developed.
Some of the leading companies that are
developing these devices are Intel Corporation,
Motorola, Toshiba, Fairchild, Phillips, Cyrix,
National Semiconductor, Zilog, DEC, Texas
Instruments, and Rockwell International, among
others.
Microprocessor Based Control of an Automatic Door
• MICROPROCESSOR BASED DIGITAL CONTROL: AN EXAMPLE
• Figure shows a schematic diagram of the control system of an automatic door.
The control system automatically opens the door when a person approaches, and
automatically closes it after five seconds. An electric motor based actuator fitted
with other auxiliary electronics and mechanical components, is responsible for
sliding the door on the rail. In response to sensor signals, respective commands
are generated by the microprocessor to operate the actuator.
• There are three sensors. One is for the detection of the movement of the person
approaching the door. The sensor can be a pyroelectric sensor. The other two
sensors are contact sensors or limit switches. Both feed signals to the
microprocessor when the door is fully opened and fully closed, respectively.
These two limit switches should be interfaced in order to avoid unnecessary
collisions between the two heads of the
door.
When the person approaches the door, the microprocessor should give
command to the actuator (motor) to slide the door over the rail. The command
issued to the actuator by the microprocessor is in response to the signal received
from the pyroelectric sensor.
• The output of the pyroelectric sensor is an analog signal and needs to be converted to its
digital equivalent by the analog to digital converter (A/D). The conversion is essential
since the microprocessor is a digital device.
• The converted digital signal is placed in the input port of the microprocessor and then
transferred to the temporary memory 1 (TM 1), a small memory block. The
microprocessor transfers the input data by means of executing the control code already
stored in the memory.
• The flow chart of the control code of this typical example is given in Fig. The
microprocessor checks the content of the TM 1 if it is full. If yes, it implies that the person
is approaching. Then it provides a command signal to run the motor in such a direction
that it should open the door.
• The microprocessor checks whether the doors have already been opened fully by
comparing the content of the temporary memory 2 (TM 2). Note that the content of the
TM 2 is a signal received from one of the limit switch (limit switch 1). If it is full, it implies
that the door has been opened fully and the motor should be stopped and TM 2 should be
reset for next operation.
• Enough time has to be given to the person to pass the door. The duration may be five
seconds. Once the duration of five second is consumed, the microprocessor should rotate
the motor in reverse direction so that the driving system would be able to close the door.
Limit switch 2 should be there to inform the microprocessor when the doors are fully
closed.
Workspace within the microprocessor is the main unit, where the microprocessor
executes the control code.
Flow chart of the control code of Digital Automatic Door
operation
• BASIC ELEMENTS OF CONTROL SYSTEMS
• The example has been given just to give you some preliminary knowledge on how a
microprocessor based control system works. A sophisticated fully-fledged control system
can only be developed once you gather comprehensive knowledge, which can be acquired
after studying this chapter.
• At this point, it should suffice to say that microprocessor is a logic device. It processes
information or data at the micro level. What does it mean? It means the microprocessor
processes information at the bit level. It relys on very primitive processing to get the work
done. It processes the data in such a speed that even if you do multiplication through
addition process (multiplying 100 with 100 is same as that of adding 100, hundred times), it
would still be faster. A microprocessor generally means a
• Central Processing Unit (CPU) on a single semiconductor chip. However, in the present
scenario it means much more than just saying a CPU. While trends in fabrication
technology are instrumental in making chips faster and smaller, architectural design
improvements also deliver better performance. Many interesting and advanced design
philosophy have progressively been incorporated into the microprocessor chip in order to
facilitate sophistication. The information that has been gathered from the example given
can be summarized.
• It is observed that microprocessor-based automation and control solution to mechanical
system requires five primary components. These are:
• · Transducer or sensor (s)
• · Actuator (s)
• · The processing element (s)
• · Interfacing and signal conditioning circuits
• · The memory
• Transducer senses the signal and actuator activates once it is
commanded to do so. For more details about the transducers and
actuators refer Chapter 5 and Chapter 7. For relatively large control
applications, more than a hundred sensors and comparatively less
number of actuators are necessary.
• This again depends on the type of control systems at hand. In some
cases, equal number of sensors and actuators are integrated. The
number of processors (the short form of microprocessor) required
for a specific application, however, depends on many factors,
including its execution speed, memory addressing capability,
control requirement, etc.
• Analog to Digital Converters, Digital to Analog Converter, isolators,
amplifier etc. are known as signal conditioning circuits. Although
interfaces and signal conditioning circuits are used synonymously,
there is difference between them in the sense that interfaces
includes electrical and mechanical components along with
electronic circuits, whereas signal conditioning circuits refer to only
electronic circuits
• MICROPROCESSOR ARCHITECTURE
• It has already been pointed out that the microprocessor
describes itself as the central processing unit for the
control solution. It has also been indicated that the
microprocessor has some common and optimal internal
infrastructure (basic building blocks) in order to attend to
the automation and control need. The interconnection of
internal infrastructure of the microprocessor is universally
known as microprocessor architecture. In order to
understand how the microprocessor works, you must
study the architecture.
INTEL 8085A MICROPROCESSOR
• INTEL’S 8085A MICROPROCESSOR
• Intel’s 8085A is a general-purpose 8-bit microprocessor that can be employed for many
industrial automation and control applications. 8085A microprocessor has specifically been
developed for learning and operation of microprocessor based control systems. Besides
industrial process control applications, embedded microprocessor technology based control
systems are also found in consumer products such as in stereos, camcorders, locking
systems, VCR etc.
• Figure shows the architecture of 8085A microprocessor. A description on the functional
blocks and some of the important control signals of the 8085A follows.
• Arithmetic and logic operations are carried out in ALU.
• Temporary Register is similar to data register as described in the terminology section.
Accumulator is an 8-bit register that holds the result of any operation.
• Instruction (OPCODE) flows from the memory to the Instruction Register.
• Decoder decodes the OPCODE and activates the Timing and Control Unit to generate
control signals such as Clock out, RD (Read), ALE (Address Latch Enable), RESET OUT, S0, S1,
IO/M, HLDA, etc. for further action to take effect. If the OPCODE is an instruction for
addition operation,
• Timing and Control Unit generates addition related control signals, and if the OPCODE is a
comparison instruction, then comparison related control signals are generated.
• B, C, D, E, H, and L are six general-purpose 8-bit registers. These are used for temporary
storage of 8-bit intermediate-data, results, constants etc. BC, DE registers are used as pairs
to hold 16-bit data. H and L registers, in combination, are used to hold the address locations
temporarily whenever necessary.
• Only these combinations are possible.
• Program Counter (PC) of 8085A holds the address
of the next instruction.
Stack Pointer points the stack-top. Incrementer and Decrementer Unit increments and
decrements any digital data (value), and can be used for counting purpose.
• Within 8085A, data are processed 8-bit wide. In every situation, data transaction between
the external (Memory, I/O devices) and even internal units (Accumulator, Registers, etc.)
takes place8-bit (one byte) wide. However, some external devices input and output data
in serial manner. It is thus required to convert the parallel data into serial form.
• 8085A has a unit called Serial I/O control Unit, which converts 8-bit length parallel data
into a 8-bit serial data. Serial data are outputted from the microprocessor through SOD
(Serial Output Data) pin, and serial data are input into the microprocessor through SID
(Serial In put Data) pin.
• 8085A facilitates interrupt service by providing five numbers of dedicated interrupt lines
(pins). They are called INTR, RST 7.5, RST 6.5, RST 5.5 and TRAP. INTR is one of the
interrupt lines. When this is high (the interruptible device drives it to high) 8085A
suspends its main task and attends the subroutine written for INTR line. The content, or
the present status of the microprocessor, is stored in the stack prior to switching the
control to attend the INTR subroutine. The programmer defines the address of the
interrupt subroutine. On the other hand, the interrupt lines RST 5.5 to 7.7
• have fixed address locations. Whenever these lines are high, the 8085A passes the control to fetch the
instruction from the location corresponding to RST 5.5, RST 6.5 and RST 7.5. TRAP is a special
interrupt pin/line mostly used for attending the service relating to power signal interruption. That is,
if main power supply fails, the microprocessor is informed through this line. The
microprocessor executes the TRAP subroutine. In effect, the VCC is connected to the battery .
• 8085A can address up to 216 = 64K locations. The address and address/data buffers are some sorts
of ports where address and data are placed. These are also 8-bit registers. The 16-bit address is
transferred from the PC to the Memory Address Register (MAR) and placed on both the buffers
(address and address/data) and then transferred to the memory. The lower byte of the address is
placed on the address/data buffers, where as the upper byte is placed on the address buffer. Eight
Least Significant Bit (LSB) of the address are sent to the memory decoder through AD0 – AD7 lines
and other eight Most Significant Bits (MSB) of the address are sent through A8 – A15 lines. Data are
transferred from and into the microprocessor through 8 lines, i.e. through AD0 – AD7 pins. Thus
AD0 – AD7 are used in multiplexed mode, they carry both data and address. Within a fetch cycle the
address is sent during the first state of the cycle. During the second state the content of the specified
memory location is read and during the third state the content is transferred into the microprocessor
through the same AD0 – AD7 lines/pins. The address/data bus, AD0 – AD7, is bi-directional
where as the address bus A8 – A15 is unidirectional.
• IO/M’ – It is a status signal which determines whether the address is for input-output or memory.
When it is high(1) the address on the address bus is for input-output devices. When it is low(0) the
address on the address bus is for the memory.
• SO, S1 – These are status signals. They distinguish the various types of operations such as halt,
reading, instruction fetching or writing.
MULTIPLEXED MODE OF OPERATION OF AD0-AD7 BUS
• CPU
• It is the abbreviation of Central Processing
Unit. The microprocessor itself is called CPU.
Some
• microprocessors and microcontrollers contain
more than one CPU in order to achieve faster
instruction processing.
• Memory and Address
• A memory is a physical device where program, data,
etc. are stored. A memory device contains many
memory locations. Each location is defined in terms
of an address, which is a unique number within a
particular microprocessor-based control
application. The figure illustrates a memory device
whose address space is 0000 to 03FF. The length of
the address space of this memory device or chip is 1
K bytes, i.e. 1024 bytes.
• Microprocessor can store and retrieve data in and from the memory,
respectively. When the processor needs data from a specific location, it
sends the address to the memory over the address path. The decoder
circuit within the memory device decodes the address (which has been
sent by other devices) in order to select a specific location. The data is
read and sent back to the microprocessor. A memory ch ip must have a
data path and address path. Data path is bi-directional and address path
is unidirectional.
• VCC is the DC supply signal, usually 5 volts, and VGG is ground terminal.
RD input signal is essential if the content of the specific location is
needed to be read. RD goes high for data read operation. WR, in similar
context, goes high for data write operation. CE (Chip Enable) signal has
to be given for chip selection. The memory chip must be selected if read
or write operations are to be carried out.
• Memory space is the range of memory locations that a microprocessor
can address. The number of address lines determines the memory
space. Microprocessors with 16 bit and 24 bit address lines have 216 =
64K and 224 = 16M of memory space respectively
• ALU
• It is the abbreviation of Arithmetic and Logic
Unit. Every CPU must have an ALU in it.
• As the name implies, this basic block
contains electronic circuits, using which all
the arithmetic and logic functions are
performed. It contains the logic circuits like
full-adder, AND, OR, and NOT, EX-OR, etc.
• Assembler
• In many situations, the programmer enters the programs into the memory of a
microprocessor-based system in assembly language. Since the microprocessor
only understands machine language, the assembly language has to be converted
to machine language through a language converter.
• The language converter is known as assembler. An assembler may be realized
with hardware or software. Sometimes the conversion is achieved instruction-
wise, i.e. the conversion is carried out one instruction after other or program-
wise, i.e. the entire program (assembly language) is converted to machine
language in one go.
• The instruction-wise conversion is specified as interpreter, another name of
assembler.
• Data
• Data refers to DNS (Digital Number System; refer Chapter 3). A bit is the
smallest unit of data. At the micro-level, data and instructions are
represented using bits.
• However, there is a difference.
• Data usually refers to value, whereas instructions are coded form of
functions, using which the microprocessor executes.
• Instructions are operation codes or OPCODES . The instructions are
unique to the microprocessor architecture.
• Therefore, microprocessor can distinguish between ordinary data and
the unique instructions. Although, data and instructions are just
combinations of bits, the same is difficult for us to distinguish.
• The microprocessor relies solely on the order in which data and
instructions enter into it.
• As a thumb rule, the first program byte entering into the
microprocessor is always instruction
• Registers
• In the example given at the beginning, you have perceived that data flows in and
out of the CPU. The data may come from the A/D converter (which might have
been obtained from the transducer or sensor device) or from some other
locations. Similarly, data may go out from the CPU to the D/A converter or to
some other locations within the microprocessor-based systems. This is called
data
transaction. The CPU require some temporary storage cells so that intermediate
data can be stored temporarily, either for data transaction or for latter use. The
temporary storage cells are called temporary registers. Figure describes some of
the temporary registers within the microprocessor.
• The registers are 8-bit, 16-bit or more. While internal circuit design of all the
registers within the microprocessor remains same, several registers have been
built into it adhering different names. In fact the nomenclature of registers is
based on the type of data they store.
• Some of the name of important registers are Data Register (DR), Instruction
Register (IR), I/O ports, Accumulator (ACC), Program Counter (PC), Memory
Address Register (MAR) and Flags
Data Register
Data Register is a special register, which holds data when they are
fetched from the memory or input devices . As you know, data and
instructions are said to be different.
Data from the outside world comes to the input buffer, then it is
transferred to the Data Register.
• Instruction Registers
• This is a register or group of registers, and only accommodates instructions. The
user written program (OPCODE) flows from the memory into the microprocessor
in sequence.
• After being fetched from the memory the OPCODE is placed in the Instruction
Register (IR) as shown in Fig.
• In this typical example, the OPCODE 59 (‘01011001’) located at memory location
0002H has been fetched and placed in the IR of the microprocessor.
• The OPCODE is then transferred to the instruction decoder.
• I/O Buffers
• Buffers are another kind of registers, which hold data or address those come in
and go out of the microprocessor. The theoretical difference between the buffer
and other registers in the microprocessor is that the data or address is first
entered into the input buffer and subsequently are transferred to a specified
register. Similarly, the data are sent out from any register(s) to the outside world
via output buffer. The buffers are apparently some sorts of I/O (Input/Output)
ports.
• A port is a place where data are loaded and unloaded. Buffers are either only-
input, only-output or both input/ output. Figure illustrates the I/O buffer within
the microprocessor.
• Accumulator
Accumulator (ACC) is a register (8-bit, 16-bit
or 32-bit) that primarily stores the result
of mathematical, logical and other
perations. ALU does the operation, and ACC
stores the result.
• Program Counter
• Program Counter, called PC, is a register that holds the address of the next
instruction. At the end of the execution of the current instruction, the content of
the PC (the next address) is transferred to the memory and decoded in order to
get the next item of the executable code. The next item could be a data or an
instruction. PC is the main functional unit of the microprocessor. If the entire
program (executable code) is 16 bytes long and is stored in a location starting
from 2000H to 200F, then the PC starts addressing 2000H to 200F sequentially in
order to make it possible to fetch program bytes from these locations one-by-
one.
The address of the next location of the memory location is being addressed at
the end of the current cycle. Currently, the microprocessor has just completed
the execution of the program byte located at 200B, while the PC at this instant
holds the address of the next location, which is 200C as shown in Fig via the
output
buffer.
INTEL 8080A INTEL
INTEL
8086
8086