0% found this document useful (0 votes)
48 views16 pages

Compiled By:-Er - Praveen Kumar Karn Lalitpur Engineering College

The document describes an instrumentation system for an ice cream factory that uses an 8255 PPI card interfaced to a microprocessor. It asks to (a) list components, (b) identify signals, (c) draw a minimum mapping circuit, (d) determine addresses, and (e) write a program to measure temperature and control if out of range. The solution (a) lists components, (b) identifies needed signals, (c) draws a circuit mapping the 8255 to addresses 5000H-5003H, (d) gives the control word 98H, and (e) writes a program to read temperature from port A, check if in range, and trigger control if not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views16 pages

Compiled By:-Er - Praveen Kumar Karn Lalitpur Engineering College

The document describes an instrumentation system for an ice cream factory that uses an 8255 PPI card interfaced to a microprocessor. It asks to (a) list components, (b) identify signals, (c) draw a minimum mapping circuit, (d) determine addresses, and (e) write a program to measure temperature and control if out of range. The solution (a) lists components, (b) identifies needed signals, (c) draws a circuit mapping the 8255 to addresses 5000H-5003H, (d) gives the control word 98H, and (e) writes a program to read temperature from port A, check if in range, and trigger control if not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

(Q)Below mentioned figure shows an interfacing circuit using the

8255A in Mode 1. Port A is designated as the input port for a


keyboard with interrupt I/O and port B is designated as the
output port for a printer with status check I/O.
a) Find port addresses by analyzing the decode logic.
b) Determine the control word to set up port A as input and port B
as output in Mode 1.
c) Determine the BSR word to enable INTEA.
d) Determine the masking byte to verify the OBF’ line in status check
I/O.
e) Write subroutine to accept character from keyboard and send
character to printer.

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


Solution
a) The 8255A is connected as I/O mapped I/O. When the address lines A7-A2 are all 1,
the
output of NAND gate goes low and selects 8255A. The port addresses are calculated as
1111 11XX:
Port A = 1111 1100 (FCH)
Port B = 1111 1101 (FDH)
Port C = 1111 1110 (FEH)
Control Register = 1111 1111 (FFH)Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
b) Control word to set up port A as input and port B as output Mode
1 is: D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 1 X
=B4H 1 0 X

c) BSR word to set INTEA


D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 0 0 1
=09H
d) Status word to check OBFB’
D7 D6 D5 D4 D3 D2 D1 D0
X X X X X X OBFB’ X
Masking Byte=02H

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


e) Subroutines to accept character from keyboard and send to printer:
MVI A, B4H ; Initialize control word
OUT FFH ; Using I/O Mode
MVI A, 09H ; Set INTEA (PC4)
OUT FFH ; Using BSR Mode
EI ; Enable Interrupt
CALL READ ; Read Character
CALL PRINT ; Display Character
HLT ; Terminate Program
READ: ; Keyboard Read Subroutine
IN FEH ; Read Port C
ANI 20H ; Check IBFA (PC5)
JZ READ
IN FCH ; Read ASCII code of character
MOV C, A ; Save Character
RET Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
PRINT:
IN FEH ; Read port C
ANI 02H ; Check OBFB’ (D1)
JZ PRINT
MOV A, C ; Get Character
OUT FDH ; Send Character to port B
RET

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
Programming in Mode 2 (Strobe Bidirectional Bus I/O)
• When the 8255 is operated in Mode 2 (by loading the appropriate
control word); Port A can be used as a bidirectional 8-bit I/O
bus using PC3–PC7 for handshaking and Port B can be
programmed only in Mode 0 (PC0–PC2 as Input or Output), or in
Mode 1 (with PC0–PC2 for handshaking).
• Figure below shows the control word that would have to be
loaded into the control port to configure 8255 in Mode 2. Figure
below shows Port A and associated control signals when 8255 is in
Mode 2. Interrupts are generated for both output and input
operations on the same INTRA (PC3) line.

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
The control signal definitions for Mode 2 are:
Output Control Signals
OBF(Output Buffer Full):-This is an active low output which indicates
that the CPU has written data into Port A.
ACK(Acknowledge) :-This is an active low input signal (generated by
the peripheral) which enables the tri-state output buffer or Port A
and makes Port A data available to the peripheral. In Mode 2, Port
A outputs are in tri-state until enabled.
INTE 1 :-This is the flip-flop associated with Output Buffer Full. INTE 1
can be used to enable to disable the interrupt by setting or
resetting PC6 in the BSR Mode.
Input Control Signals
STB(Strobe Input) :-This is an active low input signal which enables
Port A to latch the data available as its input.

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


IBF (Input Buffer Full Flip-Flop):-This is an active high output which
indicates that data has been loaded into the input latch of Port A.
INTE 2 :-This is an Interrupt enable flip-flop associated with Input
Buffer Full. It can be controlled by setting or resetting PC4 in the
BSR Mode.
Status Word in Mode 2
The status word for Mode 2 (accessed by reading Port C) is shown in
above figure. D7–D3 of the status word carry information about
OBFA , INTE1, IBFA, INTE2, and INTRA. The status of the bits D2 –
D0 depend on the mode setting of Group B. If B is programmed in
Mode 0, D2–D0 carry information about the control signals for B,
depending upon whether B is an Input port or Output port
respectively.

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


(Q)Assume that your group has decided to make microprocessor
based instrumentation system for an ice-cream factory using an
8255 PPI card at base address 5000H in memory mapped I/O mode
for controlling purpose. You need to measure pressure and
temperature of a manufacturing plant.
a)List out the collected documents and components.
b) List out different signals you need to derive and/or can be directly
connected to your interfacing circuit.
c) Draw minimum mapping circuit for above system.
d) What are the address captured by your card? Generate control
word for the system.
e) Write a program module for measuring temperature and control if
the temperature is not in the range. Assume suitable data if
necessary.(2073 Shrawan)

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


Solution:a)Components:8255APPI,ADC,MUX,Memory,processor,conn
ecting wires, power supplies, gates etc
Documents :- Data sheet, technical and specification documents of
above components.
b) Signals needed to be derived are:- A0,A1,Chip select(CS’),
Read(RD’), Write (WR’), Reset(reset out),Start of Conversion
(SOC),
End of Conversion (EOC),Data lines(D0-D7),Address lines (A2-A15)
c)

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


d) Address Captured by the card:
Port A =5000H(A1=0,A0=0)
Port B =5001H(A1=0,A0=1)
Port C=5002H(A1=1,A0=0)
Control register=5003H(A1=1,A0=1)
Control word: D7 D6 D5 D4 D3 D2 D1 D0 =98H
1 0 0 1 1 0 0 0
e) LXI H,memory
MVI A,98H ; control word on
STA 5003H ; Control Register
MVI B,00H ;selection pin for MUX
MOV A,B
STA 5001H ; select temp.for MUX
MVI A,01H ;BSR word to set PC0
STA 5003H;enable SOC
READ: LDA 5002H; read port C for EOC
Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College
RLC
JNC READ
LDA 5000H ; read temp.at port A
MOV M,A
CPI MAX_VAL
JNC CONTROL
CPI MIN_VAL
JC CONTROL
INX H
RET

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College


References
• Microprocessor Architecture, Programming, and
Applications with 8085 by Ramesh S.Gaonkar
• Insights on Instrumentation II by Er.Hari Prasad
Aryal,Er.Shyam Dahal.
• Notes by Er.Saban kumar KC notes.

Compiled By :- Er.Praveen Kumar Karn Lalitpur Engineering College

You might also like