Docsity

Peripherals and Interfacing, Study notes of Microprocessors

Toggle sidebar
bg1
Dr. V. SATHIESH KUMAR Department of Electronics Engg., MIT
1
Unit II : PERIPHERALS AND INTERFACING
1. Programmable Peripheral Interface (8255)
2. Keyboard Display Controller (8279)
3. ADC0808 and DAC0808 Interface
4. Programmable Timer Controller (8254)
5. Programmable Interrupt Controller (8259)
6. Serial Communication Interface (8251)
TEXT BOOK
K. Udaya Kumar, B. S. Umashankar, โ€œThe 8085 Microprocessors:
Architecture, Programming and Interfacing". Pearson Education.
2008.
Presented By,
Dr. V. Sathiesh Kumar
Department of Electronics Engg.,
MIT-Anna University
EC23C21: MICROPROCESSORS AND
MICROCONTROLLERS
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Peripherals and Interfacing and more Study notes Microprocessors in PDF only on Docsity!

1

Unit II : PERIPHERALS AND INTERFACING

1. Programmable Peripheral Interface (8255)

2. Keyboard Display Controller (8279)

3. ADC0808 and DAC0808 Interface

4. Programmable Timer Controller (8254)

5. Programmable Interrupt Controller (8259)

6. Serial Communication Interface (8251)

TEXT BOOK

K. Udaya Kumar, B. S. Umashankar, โ€œThe 8085 Microprocessors:

Architecture, Programming and Interfacing". Pearson Education.

Presented By,

Dr. V. Sathiesh Kumar

Department of Electronics Engg., MIT-Anna University

EC23C21: MICROPROCESSORS AND

MICROCONTROLLERS

2 Programmable Peripheral Interface (8255): Features

  • The 8255 A is a general purpose programmable I/O device designed to interface the CPU with its outside world such as ADC, DAC, keyboard etc. It can be used with almost any microprocessor.
  • The settings of programmable peripheral chip can be changed by the program , without recourse to change in wiring or hardware.
  • The 8255 is available as a 40 - pin chip in a dual in line package.

4 Programmable Peripheral Interface (8255):

  • It consists of three 8 - bit bidirectional I/O ports ( 24 I/O lines, PORT A, PORT B and PORT C) which can be configured as per the requirement.
  • We can assign different ports as input or output functions.
  • Port A contains one 8 - bit output latch/buffer and one 8 - bit input buffer.
  • Port B contains one 8 - bit output latch/buffer and one 8 - bit input buffer.
  • Port C can be split into two parts, i.e. PORT C lower (PC 0 - PC 3 ) and PORT C upper (PC 7 - PC 4 ) by the control word. They can be independently programmed as input or output lines.
  • These port pins have the ability to source 1 mA of current at 1. 5 V , when programmed to work as output pins.

5 Programmable Peripheral Interface (8255):

  • These three ports are further divided into two groups :
  1. Group A includes PORT A and upper PORT C.
  2. Group B includes PORT B and lower PORT C.
  • These two groups can be programmed in three different modes : 1.The first mode is named as Mode 0 2.The second mode is named as Mode 1 3.The third mode is named as Mode 2.

7 Programmable Peripheral Interface (8255): Bit Set/Reset Mode (BSR Mode)

  • Applicable only to Port C.
  • Any line of Port C, which is programmed as output can be set to logic 1 , or reset to logic 0 using the single bit/reset feature of Port C. CONTROL REGISTER

8 Programmable Peripheral Interface (8255): Input/Output Mode (I/O Mode)

  • The functionality of three ports is decided by the contents of the control port.
  • The control port can only be written by the microprocessor.
  • Intel 8085 cannot read it. Thus, there are three ports which can be used for I/O operations, and a control port to control the function of these ports.

10 **Programmable Peripheral Interface (8255): Operating Modes

  1. Mode 1** โˆ’ It is called as strobed I/O or handshake I/O.
  • It is useful when, an input device supplies data to the microprocessor at irregular intervals.
  • In this mode, Port A and B is used as 8 - bit I/O ports. They can be configured as either input or output ports.
  • If Port A and Port B work in mode 1. Each port uses three lines from Port C as handshake signals. Remaining two lines of Port C can be used for simple I/O in mode 0.
  • If only Port A or Port B is working in mode 1 , then five lines of Port C are free for use in mode 0.
  • Inputs and outputs are latched.

11 **Programmable Peripheral Interface (8255): Operating Modes

  1. Mode 2** โˆ’ It is a bidirectional handshake I/O.
  • Usually in mode 0 or mode 1 , a port is required to work as an input port or as an output port. It depends on whether an input device or an output device is connected to the port.
  • In contrast with this mode 2 , sometimes microprocessor can receive information , and at some other times desires to send information to the I/O device.
  • In this mode, Port A can be configured as the bidirectional port and Port B either in Mode 0 or Mode 1.
  • Port A uses five signals from Port C as handshake signals for data transfer. The remaining three signals from Port C can be used either as simple I/O or as handshake for port B.

13 Programmable Peripheral Interface (8255): Pin Description

14 Programmable Peripheral Interface (8255): Architecture

16 Programmable Peripheral Interface (8255): Functional Description Chip Select (CS): A LOW on this input selects the chip and enables the communication between the 8255 A and the CPU. It is connected to the decoded address, and A 0 & A 1 are connected to the microprocessor address lines. Read (RD): This control signal enables the Read operation. When the signal is low, the microprocessor reads the data from the selected I/O port of the 8255.

CS A 1 A 0 PORT SELECTED

0 0 0 PORTA

0 0 1 PORTB

0 1 0 PORTC

0 1 1 Control Register 1 X X No Selection

17 Programmable Peripheral Interface (8255): Functional Description A 0 and A 1 : These input signals work with RD, WR, and one of the control signal.

  • Following is the table showing their various signals with their result. A1 A0 RD WR CS Result 0 0 0 1 0 Input Operation PORT A โ†’ Data Bus 0 1 0 1 0 PORT B โ†’ Data Bus 1 0 0 1 0 PORT C โ†’ Data Bus 0 0 1 0 0 Output Operation Data Bus โ†’ PORT A 0 1 1 0 0 Data Bus โ†’ PORT B 1 0 1 0 0 Data Bus โ†’ PORT C 1 1 1 0 0 Data Bus โ†’ CONTROL REGISTER

19 Programmable Peripheral Interface (8255):

  • Suppose we want 8255 connected as memory-mapped I/O with addresses of Port A, Port B, Port C , and control part as FFFCH, FFFDH, FFFEH, and FFFFH , respectively.
  • Then one of the possible chip select circuit is shown below,

20 PPI (8255): Interrupt driven data transfer

  • Among the three pins provided by Port C to a port for the purpose of handshake data transfer , one of them called INT is used for interrupting the microprocessor.
  • Actually, Port C provides INTA as interrupt from Port A and INTB as i nterrupt from Port B.
  • These interrupt request outputs of 8255 can be inhibited by resetting to 0 the associated EI flip-flop or enabled by setting to 1 the associated EI flip-flop.
  • This is accomplished by Port C bit set/reset control function.
  • This function allows the user to allow or disallow a specific peripheral to interrupt the 8085 , without altering the general interrupt structure.