






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Unit 7 Input / Output Interfaces Interface is the path for communication between two components. Interfacing is of two types, memory interfacing and I/O interfacing. 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.
Block Diagram of Memory & I/O Interfacing
8085 Interfacing Pins Following is the list of 8085 pins used for interfacing with other devices: A15-A8 (Higher Address Bus) AD7-AD0(Lower Address/Data Bus) ALE RD WR READY
Ways of Communication ā Microprocessor with the Outside World? 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.
Serial Communication ransmitted at a time.
Modes of serial data transfer i) Simplex mode
ii) Half duplex mode
ctions but not at the same time.
iii) Full duplex mode
Types of serial data transfer i) Synchronous
It is also called clock-oriented data transmission.
ii) Asynchronous
-oriented data transmission.
Introduction to 8251A PCI (Programmable Communication Interface) The 8251A is a programmable serial communication interface chip designed for synchronous and asynchronous serial data communication. It supports the serial transmission of data. It is packed in a 28 pin DIP. It is also called USART (Universal Synchronous Asynchronous Receiver Transmitter).
Fig: Pin Description
Transmitter section: The transmitter section accepts parallel data from CPU and converts them into serial data. The transmitter section is double buffered, i.e., it has a buffer register to hold an 8-bit parallel data and another register called output register to convert the parallel data into serial bits. When output register is empty, the data is transferred from buffer to output register. Now the processor can again load another data in buffer register. If buffer register is empty, then TxRDY goes high. If output register is empty then TxEMPTY goes high. The clock signal, TxC controls the rate at which the bits are transmitted by the USART. The clock frequency can be 1, 16 or 64 times the baud rate.
Receiver Section : The receiver section accepts serial data and convert them into parallel data The receiver section is double buffered, i.e., it has an input register to receive serial data and convert to parallel, and a buffer register to hold the parallel data. When the RxD line goes low, the control logic assumes it as a START bit, waits for half a bit time and samples the line again. If the line is still low, then the input register accepts the following bits, forms a character and loads it into the buffer register. The CPU reads the parallel data from the buffer register. When the input register loads a parallel data to buffer register, the RxRDY line goes high. The clock signal RxC controls the rate at which bits are received by the USART. During asynchronous mode, the signal SYNDET/BRKDET will indicate the break in the data transmission. During synchronous mode, the signal SYNDET/BRKDET will indicate the reception of synchronous character.
MODEM Control: The MODEM control unit allows to interface a MODEM to 8251A and to establish data communication through MODEM over telephone lines. This unit takes care of handshake signals for MODEM interface.
Parallel Communication
transferred at a time.
is complex.
Methods of parallel data transfer i) Simple I/O
have to do is connect the switch to an I/O port line and read the port.
connect the input of the LED buffer on an output port pin and output the logical level required to turn on the light.
Fig: Simple I/O
output lines of the port.
forms indicates that this output operation is not directly dependant on any other signal.
ii) Strobe I/O
read in at that time.
E.g. the ASCII-encoded keyboard. When a key is pressed, circuitry on the keyboard sends out the ASCII code for the pressed key on eight parallel data lines, and then sends out a strobe signal on another line to indicate that valid data is present on the eight data lines.
Fig: Strobe I/O
STB signal to let you know that valid data is present.
tells the sending device when it is safe to send the next data byte.
them.
iii) Single handshake I/O
Fig: Single Handshake I/O
STB signal on a polled or interrupts basis and reads in the bytes of data.
read and that the peripheral can send next byte of data.
hod is that the sending device or system is designed so that it does not send the next byte until the receiving device or system indicates with an ACK signal that it is ready to receive the next byte.
iv) Double handshake I/O
Fig: Double Handshake I/O
Read/Write and Control Logic The function of this block is to manage all of the internal and external transfers of both Data and Control or Status words. It accepts inputs from the CPU Address and Control busses and in turn, issues commands to both of the Control Groups. (CS) Chip Select. A "low" on this input pin enables the communication between the 8255 and the CPU. (RD) Read. A "low" on this input pin enables 8255 to send the data or status information to the CPU on the data bus. In essence, it allows the CPU to "read from" the 8255. (WR) Write. A "low" on this input pin enables the CPU to write data or control words into the 8255. (A0 and A1) Port Select 0 and Port Select 1. These input signals, in conjunction with the RD and WR inputs, control the selection of one of the three ports or the control word register. They are normally connected to the least significant bits of the address bus (A0 and A1). (RESET) Reset. A "high" on this input initializes the control register to 9Bh and all ports (A, B, C) are set to the input mode.
A1 A0 SELECTION 0 0 PORT A 0 1 PORT B 1 0 PORT C 1 1 CONTROL REGISTER
Group A and Group B Controls The functional configuration of each port is programmed by the systems software. In essence, the CPU "outputs" a control word to the 8255. The control word contains information such as "mode", "bit set", "bit reset", etc., that initializes the functional configuration of the 8255. Each of the Control blocks (Group A and Group B) accepts "commands" from the Read/Write Control logic, receives "control words" from the internal data bus and issues the proper commands to its associated ports. Ports A, B, and C The 8255 contains three 8-bit ports (A, B, and C). All can be configured to a wide variety of functional characteristics by the system software but each has its own special features or "personality" to further enhance the power and flexibility of the 8255. Port A One 8-bit data output latch/buffer and one 8-bit data input latch. Both "pull-up" and "pull-down" bus-hold devices are present on Port A. Port B One 8-bit data input/output latch/buffer and one 8-bit data input buffer. Port C One 8-bit data output latch/buffer and one 8-bit data input buffer (no latch for input). This port can be divided into two 4-bit ports under the mode control. Each 4-bit port contains a 4-bit latch and it can be used for the control signal output and status signal inputs in conjunction with ports A and B.
Modes of Operation The 8255A is primarily operated in two modes: I/O (input-output) mode and the BSR (Bit-Set-Reset) mode. The I/O mode is further grouped into Mode 0 (Simple I/O interfacing), Mode 1 (Interfacing with handshake signals) and Mode 2 (Bidirectional I/O interfacing). Figure (b) shows all the functions of 8255A, classifying according to two modes: the Bit Set-Reset (BSR) mode and Input Output (I/O) mode. The BSR mode is used to set or reset the bits in port C. The I/O mode is further divided into three modes: mode 0, mode 1 and mode 2. In mode 0, all ports function as simple I/O ports. Mode 1 is a handshake mode whereby ports A and ports B use bits from port C as handshake signals. In the handshake mode, two types of data transfer can be implemented: status check and interrupt. In mode 2, port A can be set up for bidirectional data transfer using handshake signal from port C, and port B can be set up either in mode 0 or mode 1.
25 Pin Connector on a DTE device (PC connection) Male RS232 DB
Pin Number Direction of signal: 1 Protective Ground 2 Transmitted Data (TD) Outgoing Data (from a DTE to a DCE) 3 Received Data (RD) Incoming Data (from a DCE to a DTE) 4 Request To Send (RTS) Outgoing flow control signal controlled by DTE 5 Clear To Send (CTS) Incoming flow control signal controlled by DCE 6 Data Set Ready (DSR) Incoming handshaking signal controlled by DCE 7 Signal Ground Common reference voltage 8 Carrier Detect (CD) Incoming signal from a modem 20 Data Terminal Ready (DTR) Outgoing handshaking signal controlled by DTE 22 Ring Indicator (RI) Incoming signal from a modem
9 Pin Connector on a DTE device (PC connection)
Male RS232 DB
Pin Number Direction of signal: 1 Carrier Detect (CD) (from DCE) Incoming signal from a modem 2 Received Data (RD) Incoming Data from a DCE 3 Transmitted Data (TD) Outgoing Data to a DCE 4 Data Terminal Ready (DTR) Outgoing handshaking signal 5 Signal Ground Common reference voltage 6 Data Set Ready (DSR) Incoming handshaking signal 7 Request To Send (RTS) Outgoing flow control signal 8 Clear To Send (CTS) Incoming flow control signal 9 Ring Indicator (RI) (from DCE) Incoming signal from a modem