Module 3 (1)
Module 3 (1)
Programmable peripheral
interface 8255
• PPI 8255 is a general purpose programmable I/O device
designed to interface the CPU with its outside world
such as ADC, DAC, keyboard etc. We can program it
according to the given condition. It can be used with
almost any microprocessor. It consists of three 8-bit
bidirectional I/O ports i.e. PORT A, PORT B and PORT C.
We can assign different ports as input or output
functions.
Pin Diagram
•PA0 – PA7 – Pins of port A
•PB0 – PB7 – Pins of port B
•PC0 – PC7 – Pins of port C
•D0 – D7 – Data pins for the transfer of data
•RESET – Reset input
•RD’ – Read input
•WR’ – Write input
•CS’ – Chip select
•A1 and A0 – Address pins
• It consists of 40 pins and operates in +5V regulated power supply.
• Port C is further divided into two 4-bit ports i.e. port C lower and
port C upper and port C can work in either BSR (bit set rest) mode
or in mode 0 of input-output mode of 8255.
• Port B can work in either mode 0 or in mode 1 of input-output mode.
• Port A can work either in mode 0, mode 1 or mode 2 of input-output
mode.
• It has two control groups,
control group A and control
group B. CS’ A1 A0 Selection Address
• Step-1: First of all the floppy drive will send a DMA request (DREQ)
to the DMAC, it means the floppy drive wants its DMA service.
• Step-2: Now the DMAC will send a HOLD signal to the CPU.
• Step-3: After accepting the DMA service request from the DMAC, the
CPU will send hold acknowledgment (HLDA) to the DMAC, it means
the microprocessor has released control of the address bus the data bus
to DMAC and the microprocessor/computer is bypassed during DMA
service.
• Step-4: Now the DMAC will send one acknowledgement (DACL) to
the floppy drive which is connected at the input-output port. It means
the DMAC tells the floppy drive be ready for its DMA service.
• Step-5: Now with the help of input-output read and memory write
signal the data is transferred from the floppy drive to the memory.
Modes of DMAC:
1. Single Mode – In this only one channel is used, means only a single
DMAC is connected to the bus system.
2. Cascade Mode – In this multiple channels are used, we can further
cascade more number of DMACs.
Advantages:
Reduced CPU overhead: With DMA, the CPU is not required to be involved in
data transfer, which reduces the CPU overhead and allows it to focus on other
tasks. This is particularly useful in real-time systems where low latency and fast
response times are important.
2.Read/Write logic – This block works only when the value of pin CS is
low (as this pin is active low). This block is responsible for the flow of
data depending upon the inputs of RD and WR. These two pins are
active low pins used for read and write operations.
1.Control logic – It is the center of the PIC and controls the functioning of
every block. It has pin INTR which is connected with other
microprocessor for taking interrupt request and pin INT for giving the
output.
If 8259 is enabled, and the other microprocessor Interrupt flag is high then
this causes the value of the output INT pin high and in this way 8259
responds to the request made by other microprocessor.
2.Interrupt request register (IRR) – It stores all the interrupt level which
are requesting for Interrupt services.
3.Interrupt service register (ISR) – It stores the interrupt level which are
currently being executed.
4.Interrupt mask register (IMR) – It stores the interrupt level which
have to be masked by storing the masking bits of the interrupt level.
1.Priority resolver – It examines all the three registers
and set the priority of interrupts and according to the
priority of the interrupts, interrupt with highest priority
is set in ISR register. Also, it reset the interrupt level
which is already been serviced in IRR.