Interfacing With Peripherals
Interfacing With Peripherals
INTRODUCTION
Microprocessor based system design involves interfacing of the processor with
one or more peripheral devices for the purpose of communication with various input and
output devices connected to it. During the early days of the microprocessor revolution,
these techniques required complex hardware consisting of Medium scale integration
devices making the design highly complex and time consuming. So, the manufacturers
(INTEL) have developed a large number of general and special purpose peripheral
devices most of them being single chip circuits. They are also programmable devices.
Hence these peripheral devices are found to be of tremendous use to a system designer.
General purpose peripheral devices that perform a task but may be used for
interfacing a variety of I/O devices to microprocessor. The general purpose devices are
given below:
Special function peripherals are devices that may be used for interfacing a
microprocessor to a specific type of I/O device. These peripherals are more complex and
therefore, relatively more expensive than general purpose peripherals. The special
function peripherals (Dedicated function peripherals) are
ii. It provides 24 I/O pins which may be individually programmed in two groups.
Iv .It is available in 40 pin DIP and 44 pin plastic leaded chip carrier (PLCC)
packages.
v. It has three 8 bit ports. Port A, Port B and Port C. Port C is treated as two 4 bit
ports also.
There is also another 8 bit port called control port, which decides the configuration
of 8255 ports. This port is written by the microprocessor only.
Modes of Operation:
1. BSRmode
2. I/O mode
Mode 0: SimpleI/Omode
Mode 1 : I/OwithHandshakingmode
Mode 2: Bidirectionaldatatransfermode
1. BSR (Bit Set/Reset) Mode:
Individual bits of Port C can be set or reset by sending out a single OUT instruction to
the control register. When Port C is used for control/status operation, this feature can be
used to set or reset individual bits. For BSR mode control word is given below.
Priority Resolver
This logic unit determines the priorities of the bits set in the IRR. The highest
priority is selected and strobed in to the corresponding bit of the ISR during pulse.
Control Logic
This unit has two pins. INT (Interrupt) as an output pin and (interrupt
acknowledge) as an input pin. The INT is connected to the interrupt pin of the
microprocessor unit. Whenever an interrupt is noticed by the CPU, it generates signal
. Cascade Buffer
This function block stores the IDs of all 8259A are used in the system. The
associated three I/O pins (CAS0-2) are outputs when the 8259A is used as a master and
are inputs when the 8259A is used as a slave. As a master, the 8259A sends the ID of the
interrupting slave device onto the CAS0 –2 lines. The slave thus selected will send its
preprogrammed subroutine address onto the Data Bus during the next one or two
consecutive INTA pulses. (See section ‘‘Cascading the 8259A’’.
Introduction
It is always possible to generate accurate time delays using the microprocessor
system by using software loop programs. But that will waste the precious time of CPU.
Hence INTEL introduced the chips 8253/8254 which is a hardware solution for the
problem of generating accurate time delays. These chips can be used for applications
such as a real-time clock, event counter, a digit alone shot, a square wave generator and
also as a complex wave form generator.
Salient Features
8254 is an upgraded version of 8253 and they are pin-compatible.
8254 can operate with higher clock frequency ranging from DC to
8 MHz and 10 MHz, whereas the 8253 can operate with clock frequency from DC
to 2 MHz.
8254 includes a status read-back command that can latch the count and the status
of the counters. This command is not available in 8253.
8253 uses N-MOS technology where as 8254 uses H-MOS technology.
The chips are packaged in 24 pin DIP and requires a single +5V DC power supply.
Three identical 16 bit counters that can operate independently in any of the six
modes are available. The counters are down counters.
These chips are compatible with all INTEL and most of the other microprocessors.
To operate a counter, a 16 bit count is loaded in its register and on command
beings to decrement the count until it reaches 0. At the end of the count, it
generates a pulse that can be used to interrupt the microprocessor.
The counters can be programmed for either binary or BCD count.
The read-back command of 8254 allows the user to check the count value and
current status of the counter.
The bits D1, D2 and D3 decide the mode operation 8253/54 can be
configured in six modes. This mode selection is done by these bits as
shown below.