Microprocessor
Microprocessor
Microprocessor
The two address lines, along with CS signal, determine the selection of a particular port or control
register. This is explained below:
Control Word Register (CWR): The control word format, when 8255 is operated in I/O mode, is shown
below: For 8255 PPI to be operated in I/O mode, D7 bit must be 1. The three ports are clubbed into two
groups A and B. Group A consists of Port A and CU. Port A can be operated in any of the modes 0, 1 or
2. Group B consists of Port B and CL. Here Port B can be operated in either mode 0 or 1.
Operational Modes: PPI 8255 can operate in three modes. (a) Mode 0 (b) Mode 1 and (c) Mode 2. Apart
from the three, there is another mode called BSR mode (Bit Set / Reset mode). These are I/O operations
and selected only if D7 bit of the control word register is put at 1. The three operating modes of 8255 are
distinguished in the following manner:
Mode 0: This is a basic or simple input/output mode, whose features are:
• Outputs are latched.
• Inputs are not latched.
• All ports (A, B, CU, CL) can be programmed in either input or output mode.
• Ports don’t have handshake or interrupt capability.
• Sixteen possible input/output configurations are possible.
• When unconditional or non-handshaking I/O is required, mode 0 is chosen.
Mode 1: In this mode, input or outputting of data is carried out by taking the help of handshaking signals,
also known as strobe signals. The basic features of this mode are:
• Ports A and B can function as 8-bit I/O ports, taking the help of pins of Port C.
• I/Ps and I/Ps are latched.
• Interrupt logic is supported.
Handshake signals are exchanged between CPU and peripheral prior to data transfer.
• In this mode, Port C is called status port.
• There are two groups in this mode group A and group B. They can be configured separately. Each
group consists of an 8-bit port and a 4-bit port. This 4-bit port is used for handshaking in each group.
Mode 2: In this mode, Port A can be set up for bidirectional data transfer using handshake signals from
Port C. Port B can be set up either in mode 0 or mode 1.
Example: Interface ADC 0808 with 8086 using 8255 ports. Use Port A of 8255 for transferring digital
data output of ADC to the CPU & Port C for control signals. Assume that an analog input is present at
I/P2 of the ADC and a clock input of suitable frequency is available for ADC. Draw the schematic &
timing diagram of different signals of ADC0808.
Solution:
• The analog input I/P2 is used & therefore address pins A, B, C should be 0,1,0 respectively to select
I/P2.
• The OE (Out put latch Enable) & ALE pins are already kept at +5v to select the ADC and enable the
outputs.
• Port C upper acts as the input port to receive the EOC signal while Port C lower acts as the output port
to send SOC to ADC.
• Port A acts as a 8-bit input data port to receive the digital data output from the ADC.
8255 Control Word:
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 1 0 0 0 = 98H
Program:
MOV AL,98H ; Initialize 8255, send AL to control word (CWR)
OUT CWR, AL
MOV AL, 02H ;Select I/P2 as analog I/P
OUT Port B, AL ;Port B as output
MOV AL, 00H ; Give start of conversion pulse to the ADC
OUT Port C, AL
MOV AL, 01H
OUT Port C, AL
MOV AL, 00H
OUT Port C, AL
WAIT: IN AL, Port C ; check for EOC by reading Port C upper & rotating
RCL ; through carry.
JNC WAIT
IN AL, Port A ; if EOC, read digital equivalent in AC
HLT ; stop.
5. Explain the concept of methods of serial communication with
example
• Serial data communication uses two methods, asynchronous and synchronous. The synchronous method
transfers a block of data (characters) at a time, while the asynchronous method transfers a single byte at a time.
• In data transmission if the data can be transmitted and received, it is a duplex transmission. This is in contrast
to simplex transmissions such as with printers, in which the computer only sends data. Duplex transmissions can
be half or full duplex, depending on whether or not the data transfer can be simultaneous. If data is transmitted
one way at a time, it is referred to as half duplex. If the data