Instrumentation-II: - Er. Suresh Timilsina Assistant Professor IOE, Paschimanchal Campus
Instrumentation-II: - Er. Suresh Timilsina Assistant Professor IOE, Paschimanchal Campus
2. K.R Fowler, “Electronic Instrument Design- Architecting for the life cycle”, Oford
University Press
2 8 Title Marks
3 10 Assignment 5
4 8 Assessment 10
5 8 Attendance 5
6 6
7 6
Practical Marks-25 mark
8 6
9 8 Title Marks
10 12 LAB Report 5
Total 80 Case Study Report 15
Attendance 5
Chapter-1
Microprocessor-A Microprocessor is a multipurpose programmable, clock driven, register based
electronic device that accepts binary data as input, process them and provide
result as output according to the instruction stored.
Instrumentation System- The system which is defined as the assembly of various instruments and
other components interconnected to measure, analyze and control physical quantities such as
electrical, thermal and mechanical etc.
Microcontroller Microprocessor
• Complete Automation
• Added Intelligence
• Less Manpower
• Low Operating Cost
• Fast
• Uniform Products
• Can be Modified Accordingly
Here, the system is closed loop system. The temperature sensor senses the temperature
of a system which is compared by the microprocessor with the sampled saved in it. If the
temperature exceeds the limit then the heater control system is activated which controls
the temperature automatically. This closed loop system is more accurate and no human
operators is required.
Address Decoding
• The processor communicates with all the parts interconnected in the system through a common address and data
bus. As a result of this, only one device can transmit data at a time and others can only receive that data. If more
than one device attempt to send data through the bus at the same time, the proper communication among the
devices does not become possible because the data sent by them gets garbled. To avoid this situation, ensuring
that the proper device gets addressed at proper time, the technique called "address decoding" is used. They are:
I/O Mapped I/O
It can address 2^8=256 bytes if mapped in I/O mode. They are used to read 8-bit data from or write 8-bit data to
selected device. In this, the I/O device is addressed with 8-bit address.
Memory Mapped I/O
In this mode, the I/O devices are addressed with 16-bit address. The total addressing capability of the processor 8085
in this mode is 2^16 = 65536 bytes = 64 KB.
In both modes described above, depending on the addresses that are allocated to the device, the address decoding
are categorized in the following two groups:
• Unique Address Decoding
If all of the address lines available on that mapping mode are used for address decoding, then that decoding is called
unique address decoding.
• Non-unique Address Decoding
If all of the address lines available on that mapping mode are not used for address decoding, then that decoding is
called unique address decoding.
Address Decoding
RD RD
• Data pins: Since each memory location stores eight bits, there are eight data lines D0-D7 connected to the
memory chip.
• Address pins: The number of address pins depends on the size of the memory. In this case, a memory of size 1 kB
x 8 will have 210 different memory locations. Hence, it will have ten address lines A0 to A9. Similarly, the 2 kB
RAM will have 211 different memory locations. So, there are 11 address lines A0-A10.
• CS pin: When this pin is enabled, the memory chip knows that the microprocessor is talking to it and responds to
it accordingly. We need to generate this signal for each of the chips according to the range of addresses assigned
to them. Basically, we select a chip only when it is needed. The Chip Select (CS) pin is used for this.
• OE pin: When this active-low output enable pin is enabled, the memory chip can output the data in data bus.
• WR pin: Upon activation of this active-low memory write pin, data on the data bus is written on the memory chip
at the location specified by the address bus.
• RD pin :Upon activation of this active-low memory read pin, data on the memory is read.
• VCC and GND pins: These pins serve the purpose of powering the ICs. For simplicity, we will not show these pins
in the diagram.
Address Decoding
Address bit
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
number
Q1. Draw an interfacing circuit to interface 2 ROM chip each of 8K size and 1 RAM of 1K size.
No. of address lines required for ROM register select is 8*1024=23 ∗ 210 = 213
Therefore 13 address lines are used in register select and 3 for chip select.
No. of address lines required for RAM register select is 1*1024=20 ∗ 210 = 210
Therefore 10 address lines are used in register select and 6 for chip select.
Now for RAM 1
Address bit
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
number
No. of address lines required for 4K ROM register select is 4*1024=22 ∗ 210 = 212
Therefore 12 address lines are used in register select and 4 for chip select.
No. of address lines required for 2K RAM register select is 2*1024=21 ∗ 210 = 211
Therefore 11 address lines are used in register select and 5 for chip select.
No. of address lines required for 2K EPROM register select is 1*1024=20 ∗ 210 = 210
Therefore 10 address lines are used in register select and 6 for chip select.
Address bit
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
number
RAM 2
Address bit
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
number
Starting
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 02000H
address
Ending
0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 03FFFH
Address
Chapter-2 Parallel Interfacing with Microprocessor Based System
• Parallel transmission of data is used for short distance where the speed of information transfer is
considered.
• The information exchanged between I/O peripherals may be at different speed considering the device.
• In this case microprocessor can be used to select a particular speed of operation.
• This process is known as synchronizing.
• The various ways of synchronizing techniques are as follows-
a) Simple I/O- When we need to get digital data from a simple switch into a microprocessor (such that a
temperature sensor) then we just connect the switch to an input port and read the port. The
data is always ready and present so, we can read it at any time. Like wise when we want to
output data to a LED. We just connect the LED to output port. The LED is always ready. So,
we can send data to it at any time.
b) Simple Strobe I/O- In many applications valid data is present on an external device only at a certain time.
To indicate valid data is present we must send out strobe signal. STB low is for low rate
of Data transfer. For high speed data transfer this method doesn’t work as there is no
signal which tells the sending device when it is safe to send the next data. To prevent
this problem handshaking is introduced.
Methods Of Parallel Data Transfer
ACK
STB Low
• 8255 is a programmable I/O device that acts as interface between peripheral devices and the
microprocessor for parallel data transfer. 8255 PPI (programmable peripheral interface) is programmed
in a way so as to have transfer of data in different conditions according to the need of the system.
• In 8255, 24 pins are assigned to the I/O ports. Basically it has three, 8-bit ports that are used for simple
or interrupt I/O operations.
• The three ports are Port A, Port B and Port C and as each port has 8 lines, but the 8 bits of port C is
divided into 2 groups of 4-bit each. These are given as port C lower i.e., PC3 – PC0 and port C upper
i.e., PC7 – PC4. And are arranged in group of 12 pins each thus designated as Group A and Group B.
• The two modes in which 8255 can be programmed are as follows: i) Bit set/reset mode ii) I/O mode
• The bits of port C gets set or reset in the BSR mode.
• The other mode of 8255 i.e., I/O mode is further classified into: a) Mode 0: Simple input/output
b) Mode 1: Input output with handshaking c) Mode 2: Bidirectional I/O handshaking
Mode 1 and Mode 2 both are same but the only difference is mode 1 does not support bidirectional
handshaking.
• Data bus buffer: It is used to connect the internal
Block Diagram of 8255 PPI bus of 8255 with the system bus so as to establish
proper interfacing between the two. The data bus
buffer allows the read/write operation to be
performed from/to the CPU.
The buffer allows the passing of data from ports or
control register to CPU in case of write operation
and from CPU to ports or status register in case of
read operation.
• Read/ Write control logic: This unit manages
the internal operations of the system. This unit
holds the ability to control the transfer of data
and control or status words both internally and
externally.
Whenever there exists a need for data fetch then it
accepts the address provided by the processor
through the bus and immediately generates
command to the 2 control groups for the particular
operation.
Group A and Group B control: These two groups are
Block Diagram of 8255 PPI handled by the CPU and functions according to the command
generated by the CPU. The CPU sends control words to the
group A and group B control and they in turn sends the
appropriate command to their respective port.
Group A has the access of the port A and higher order bits of
port C. While group B controls port B with the lower order
bits of port C.
CS: It stands for chip select. A low signal at this pin shows
the enabling of communication between the 8255 and the
processor.
RD – It is the signal used for read operation. A low signal at
this pin shows that CPU is performing read operation at the
ports or status word.
WR –A low signal at this pin allows the CPU to perform
write operation over the ports or control register of 8255
using the data bus buffer.
A0 and A1: These are basically used to select the desired port
among all the ports of the 8255 and it do so by forming
conjunction with RD and WR. It forms connection with the
LSB of the address bus.
The table below shows the operation of the control signals:
Reset: It is an active high signal that shows the resetting of the PPI. A high signal at this pin
clears the control registers and the ports are set in the input mode.