SlideShare a Scribd company logo
PROGRAMMABLE
PROGRAMMABLE
PERIPHERAL INTERFACE
PERIPHERAL INTERFACE
-8255
-8255
• It is an I/O port chip used for interfacing
It is an I/O port chip used for interfacing
I/O devices with microprocessor
I/O devices with microprocessor
system.
system.
• It is device used to implement parallel
It is device used to implement parallel
data transfer between processor and
data transfer between processor and
slow peripheral devices like ADC, DAC,
slow peripheral devices like ADC, DAC,
keyboard, 7-segment display, lCD etc.
keyboard, 7-segment display, lCD etc.
Features:
Features:
• It is a programmable device.
It is a programmable device.
• It has 24 I/O programmable pins like
It has 24 I/O programmable pins like
PA,PB,PC (3-8 pins).
PA,PB,PC (3-8 pins).
 T T L compatible.
T T L compatible.
• 8255A has three ports
• PORT A
• PORT B
• PORT C
• Port A and Port B are 8 bit parallel
ports.
• Port C can be split into two parts, i.e.
PORT C lower (PC0-PC3) and PORT C
upper (PC7-PC4) by the control word
• These three ports are further divided
into two groups,
– i.e. Group A includes PORT A and upper
PORT C.
– Group B includes PORT B and lower PORT C
• These two groups can be programmed
in three different modes.
• Three operating modes :
Three operating modes :
– Mode-0(simple I/O port)
Mode-0(simple I/O port)
– Mode-1(Handshake I/O port)
Mode-1(Handshake I/O port)
– Mode-2(Bidirectional I/O port)
Mode-2(Bidirectional I/O port)
Mode 0
Mode 0
• In this mode, Port A and B is used as two 8-bit ports
and Port C as two 4-bit ports.
• Each port can be programmed in either input mode
or output mode where outputs are latched and
inputs are not latched.
• Ports do not have interrupt capability.
• Ports in mode 0 is used to interfaces LEDs, Hexa
keypad and 7 segment LEDS to the processor.
Mode 1
Mode 1
• 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.
• Each port uses three lines from port C
as handshake signals.
• Inputs and outputs are latched
• MODE 1 :(Input/output with Hand shake)
MODE 1 :(Input/output with Hand shake)
• In this mode, input or output is transferred
In this mode, input or output is transferred
by hand shaking Signals.
by hand shaking Signals.
• Handshaking signals is used to transfer
Handshaking signals is used to transfer
data between whose data transfer is not
data between whose data transfer is not
same.
same.
Computer Printer
DATA BUS
STB
ACK
Busy
• Example:
Example:
• The computer send the data to the printer
The computer send the data to the printer
large speed compared to the printer.
large speed compared to the printer.
• When computer send the data according to
When computer send the data according to
the printer speed at the time only, printer
the printer speed at the time only, printer
can accept.
can accept.
• If printer is not ready to accept the data then
If printer is not ready to accept the data then
after sending the data bus , computer uses
after sending the data bus , computer uses
another handshaking signal to tell printer
another handshaking signal to tell printer
that valid data is available on the data bus.
that valid data is available on the data bus.
• Each port uses three lines from port C as
Each port uses three lines from port C as
handshake signals
handshake signals
Mode 2
Mode 2
• 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.
MODE 2:bi-directional I/O data transfer:
MODE 2:bi-directional I/O data transfer:
• This mode allows bidirectional data transfer
This mode allows bidirectional data transfer
over a single 8-bit data bus using
over a single 8-bit data bus using
handshake signals.
handshake signals.
• This feature is possible only Group A
This feature is possible only Group A
• Port A is working as 8-bit bidirectional.
Port A is working as 8-bit bidirectional.
• PC
PC3
3-PC
-PC7
7 is used for handshaking purpose.
is used for handshaking purpose.
• The data is sent by CPU through this port ,
The data is sent by CPU through this port ,
when the peripheral request it.
when the peripheral request it.
• CONTROL WORD FORMATS:
CONTROL WORD FORMATS:
• In the INPUT mode , When RESET is High all
In the INPUT mode , When RESET is High all
24 pins (3-ports) be a input mode.
24 pins (3-ports) be a input mode.
• i.e all flip flops are cleared and the
i.e all flip flops are cleared and the
interrupts are rest.
interrupts are rest.
• This condition is maintained even after
This condition is maintained even after
RESET goes low.
RESET goes low.
• This can be avoid by writing single control
This can be avoid by writing single control
word to the control registers , when
word to the control registers , when
required.
required.
Pin Diagram
Pin Diagram
Function of pins:
Function of pins:
• Data bus(D
Data bus(D0
0-D
-D7
7)
):These are 8-bit bi-directional buses,
:These are 8-bit bi-directional buses,
connected to 8086 data bus for transferring data.
connected to 8086 data bus for transferring data.
• CS: This is Active Low signal.
CS: This is Active Low signal. It stands for Chip Select.
A LOW on this input selects the chip and enables the
communication between the 8255 and the CPU.
• Read: This is Active Low signal, when it is Low the
Read: This is Active Low signal, when it is Low the
microprocessor reads data from a selected I/O port
microprocessor reads data from a selected I/O port
of 8255A.
of 8255A.
• Write: This is Active Low signal, when it is Low the
Write: This is Active Low signal, when it is Low the
microprocessor writes data into a selected I/O port .
microprocessor writes data into a selected I/O port .
• Address (A
Address (A0
0-A
-A1
1):This is used to select the
):This is used to select the
ports.
ports.
A1
A1 A0
A0 Select
Select
0
0 0
0 PA
PA
0
0 1
1 PB
PB
1
1 0
0 PC
PC
1
1 1
1
Control
Control
reg.
reg.
• RESET: This is used to reset the device. That
RESET: This is used to reset the device. That
means clear control registers.
means clear control registers.
• PA
PA0
0-PA
-PA7
7:It is the 8-bit bi-directional I/O pins
:It is the 8-bit bi-directional I/O pins
used to send the data to peripheral or to
used to send the data to peripheral or to
receive the data from peripheral.
receive the data from peripheral.
• PB
PB0
0-PB
-PB7
7:Similar to PA
:Similar to PA
• PC
PC0
0-PC
-PC7
7:This is also 8-bit bidirectional I/O pins.
:This is also 8-bit bidirectional I/O pins.
These lines are divided into two groups.
These lines are divided into two groups.
1.
1. PC
PC0
0 to PC
to PC3
3(Lower Groups)
(Lower Groups)
2.
2. PC
PC4
4 to PC
to PC7
7 (Higher groups)
(Higher groups)
These two groups working in separately using 4
These two groups working in separately using 4
data’s.
data’s.
Block Diagram-8255
Block Diagram-8255
Data Bus buffer
Data Bus buffer:
:
• It is a 8-bit bidirectional Data bus.
It is a 8-bit bidirectional Data bus.
• Used to interface between 8255 data bus
Used to interface between 8255 data bus
with system bus.
with system bus.
• The internal data bus and Outer pins D
The internal data bus and Outer pins D0
0-D
-D7
7
pins are connected in internally.
pins are connected in internally.
• The direction of data buffer is decided by
The direction of data buffer is decided by
Read/Control Logic.
Read/Control Logic.
Read/Write Control Logic:
Read/Write Control Logic:
• This is getting the input signals from
This is getting the input signals from
control bus and Address bus
control bus and Address bus
• Control signal are RD and WR.
Control signal are RD and WR.
• Address signals are A0,A1,and CS.
Address signals are A0,A1,and CS.
• 8255 operation is enabled or disabled
8255 operation is enabled or disabled
by CS.
by CS.
Group A and Group B control:
Group A and Group B control:
• Group A and B get the Control Signal from CPU and
Group A and B get the Control Signal from CPU and
send the command to the individual control blocks.
send the command to the individual control blocks.
• Group A send the control signal to port A and Port C
Group A send the control signal to port A and Port C
(Upper) PC
(Upper) PC7
7-PC
-PC4
4.
.
• Group B send the control signal to port B and Port C
Group B send the control signal to port B and Port C
(Lower) PC
(Lower) PC3
3-PC
-PC0
0.
.
• PORT A
PORT A:
:
• This is a 8-bit buffered I/O latch.
This is a 8-bit buffered I/O latch.
• It can be programmed by mode 0 , mode 1, mode
It can be programmed by mode 0 , mode 1, mode
2 .
2 .
PORT B:
PORT B:
• This is a 8-bit buffer I/O latch.
This is a 8-bit buffer I/O latch.
• It can be programmed by mode 0 and
It can be programmed by mode 0 and
mode 1.
mode 1.
• PORT C
PORT C:
:
• This is a 8-bit Unlatched buffer Input and
This is a 8-bit Unlatched buffer Input and
an Output latch.
an Output latch.
• It is splitted into two parts.
It is splitted into two parts.
• It can be programmed by bit set/reset
It can be programmed by bit set/reset
operation.
operation.
Operation modes in 8255
Operation modes in 8255
• Two operating modes:
Two operating modes:
– I/O mode( mode 0, mode 1, mode2)
I/O mode( mode 0, mode 1, mode2)
– Bit set/Reset mode
Bit set/Reset mode
Operation modes:
Operation modes:
BIT SET/RESET MODE:
BIT SET/RESET MODE:
• The PORT C can be Set or Reset by sending OUT
The PORT C can be Set or Reset by sending OUT
instruction to the CONTROL registers.
instruction to the CONTROL registers.
I/O MODES:
I/O MODES:
• MODE 0(Simple input / Output):
MODE 0(Simple input / Output):
• In this mode , port A, port B and port C is used as
In this mode , port A, port B and port C is used as
individually (Simply).
individually (Simply).
• Features:
Features:
• Outputs are latched , Inputs are buffered not
Outputs are latched , Inputs are buffered not
latched.
latched.
• Ports do not have Handshake or interrupt capability.
Ports do not have Handshake or interrupt capability.
Control words
Control words
• Two control words:
Two control words:
– I/O mode set control word(MSW)
I/O mode set control word(MSW)
– Bit set/reset control word(BSR)
Bit set/reset control word(BSR)
• MSW is used to specify I/O functions.
MSW is used to specify I/O functions.
• BSR is used to set/reset individual pins of
BSR is used to set/reset individual pins of
Port C.
Port C.
• Both the control words are written in the
Both the control words are written in the
same control register.
same control register.
• 8255 ports are programmed by writing control word
8255 ports are programmed by writing control word
in the control word in the control register.
in the control word in the control register.
• For setting I/O functions and mode of operation the
For setting I/O functions and mode of operation the
I/O mode set control word is send to control register.
I/O mode set control word is send to control register.
• For setting/ resetting pins of port C, the bit set/reset
For setting/ resetting pins of port C, the bit set/reset
control word is send to control register.
control word is send to control register.
FOR BIT SET/RESET MODE:
FOR BIT SET/RESET MODE:
• This is bit set/reset control word format.
This is bit set/reset control word format.
X X X
X X X
Don’t care
Don’t care
Bit select
Bit select
B
B0
0
B
B1
1
B
B2
2
D7 D6 D5 D4 D3 D2 D1 D0
0 1 2 3 4 5 6 7
0 1 0 1 0 1 0 1
0 0 1 1 0 0 1 1
0 0 0 0 1 1 1 1
BIT SET/RESET
1=SET
0=RESET
BIT SET/RESET FLAG
=0 Active
• PC
PC0
0-PC
-PC7
7 is set or reset as per the status of
is set or reset as per the status of
D
D0.
0.
• A BSR word is written for each bit
A BSR word is written for each bit
• Example:
Example:
– PC
PC3
3 is Set then control register will be
is Set then control register will be
0XXX0111.
0XXX0111.
– PC
PC4
4 is Reset then control register will be
is Reset then control register will be
0XXX01000.
0XXX01000.
• X is a don’t care.
X is a don’t care.
FORMAT OF I/O MODE:
FORMAT OF I/O MODE:
The mode format for I/O as shown in figure
The mode format for I/O as shown in figure
D7 D6 D5 D4 D3 D2 D1 D0
Group A
Port C Upper
1=Input
0=Output
Port B
1=Input
0=Output
Mode
selection
00=mode 0
01=mode 1
1x=mode 2
Group B
Port C Lower
1=Input
0=Output
Port B
1=Input
0=Output
Mode selection
0=mode 0
1=mode 1
Mode set
1-I/O mode
0-BSR mode
• The control word for both mode is
same.
• Bit D7 is used for specifying whether
word loaded in to Bit set/reset mode or
Mode definition word.
• D7=1=Mode definition mode.
• D7=0=Bit set/Reset mode.

More Related Content

PPTX
8255 ppi students material for ppi mpmc study
PPT
Programmableperipheralinterface 8255 ppt
PPT
8255 PPI (programmable Peripheral Interface) mode 0
PPT
PPI-MECHATRONICS
PDF
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
PPT
8255 presentaion.ppt
PPT
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
PPT
8255 class
8255 ppi students material for ppi mpmc study
Programmableperipheralinterface 8255 ppt
8255 PPI (programmable Peripheral Interface) mode 0
PPI-MECHATRONICS
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
8255 presentaion.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
8255 class

Similar to KTU_8255_Programmable Peripheral Interface (20)

PPTX
UNIT 3 Peripheral Interfacing.pptx
PPTX
UNIT- 3.pptx
PDF
Unit 3 mpmc
PPT
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
PPT
Lecture_8255_MODIfggggggggggggFIED_BY_ME_24-11-2020.ppt
PPTX
8255 PPI
PDF
Interfacing of Microprocessor with various devices
PDF
Programmable Peripheral Devices
PPT
20ME702– MECHATRONICS -UNIT-3.ppt
PPT
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
PPTX
PPTX
Unit-3 IO Interfacing-1.pptximportant questions to be noted
PPTX
Interfacing of 8255 IC By Er. Swapnil Kaware.
PPTX
Unit-IV.pptx
PPTX
8255_Ppi new
PPTX
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
PPTX
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
PPT
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PPT
8255-PPI MPMC text book for engineering.ppt
PPTX
8086 microprocessor -Input/Output INTERFACING
UNIT 3 Peripheral Interfacing.pptx
UNIT- 3.pptx
Unit 3 mpmc
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
Lecture_8255_MODIfggggggggggggFIED_BY_ME_24-11-2020.ppt
8255 PPI
Interfacing of Microprocessor with various devices
Programmable Peripheral Devices
20ME702– MECHATRONICS -UNIT-3.ppt
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Unit-3 IO Interfacing-1.pptximportant questions to be noted
Interfacing of 8255 IC By Er. Swapnil Kaware.
Unit-IV.pptx
8255_Ppi new
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
8255-PPI MPMC text book for engineering.ppt
8086 microprocessor -Input/Output INTERFACING
Ad

Recently uploaded (20)

PPTX
Geodesy 1.pptx...............................................
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
PPT on Performance Review to get promotions
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
737-MAX_SRG.pdf student reference guides
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT
Project quality management in manufacturing
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Current and future trends in Computer Vision.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Geodesy 1.pptx...............................................
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT on Performance Review to get promotions
Embodied AI: Ushering in the Next Era of Intelligent Systems
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
737-MAX_SRG.pdf student reference guides
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Project quality management in manufacturing
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Mechanical Engineering MATERIALS Selection
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Current and future trends in Computer Vision.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Ad

KTU_8255_Programmable Peripheral Interface

  • 2. • It is an I/O port chip used for interfacing It is an I/O port chip used for interfacing I/O devices with microprocessor I/O devices with microprocessor system. system. • It is device used to implement parallel It is device used to implement parallel data transfer between processor and data transfer between processor and slow peripheral devices like ADC, DAC, slow peripheral devices like ADC, DAC, keyboard, 7-segment display, lCD etc. keyboard, 7-segment display, lCD etc.
  • 3. Features: Features: • It is a programmable device. It is a programmable device. • It has 24 I/O programmable pins like It has 24 I/O programmable pins like PA,PB,PC (3-8 pins). PA,PB,PC (3-8 pins).  T T L compatible. T T L compatible.
  • 4. • 8255A has three ports • PORT A • PORT B • PORT C • Port A and Port B are 8 bit parallel ports. • Port C can be split into two parts, i.e. PORT C lower (PC0-PC3) and PORT C upper (PC7-PC4) by the control word
  • 5. • These three ports are further divided into two groups, – i.e. Group A includes PORT A and upper PORT C. – Group B includes PORT B and lower PORT C • These two groups can be programmed in three different modes.
  • 6. • Three operating modes : Three operating modes : – Mode-0(simple I/O port) Mode-0(simple I/O port) – Mode-1(Handshake I/O port) Mode-1(Handshake I/O port) – Mode-2(Bidirectional I/O port) Mode-2(Bidirectional I/O port)
  • 7. Mode 0 Mode 0 • In this mode, Port A and B is used as two 8-bit ports and Port C as two 4-bit ports. • Each port can be programmed in either input mode or output mode where outputs are latched and inputs are not latched. • Ports do not have interrupt capability. • Ports in mode 0 is used to interfaces LEDs, Hexa keypad and 7 segment LEDS to the processor.
  • 8. Mode 1 Mode 1 • 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. • Each port uses three lines from port C as handshake signals. • Inputs and outputs are latched
  • 9. • MODE 1 :(Input/output with Hand shake) MODE 1 :(Input/output with Hand shake) • In this mode, input or output is transferred In this mode, input or output is transferred by hand shaking Signals. by hand shaking Signals. • Handshaking signals is used to transfer Handshaking signals is used to transfer data between whose data transfer is not data between whose data transfer is not same. same. Computer Printer DATA BUS STB ACK Busy
  • 10. • Example: Example: • The computer send the data to the printer The computer send the data to the printer large speed compared to the printer. large speed compared to the printer. • When computer send the data according to When computer send the data according to the printer speed at the time only, printer the printer speed at the time only, printer can accept. can accept. • If printer is not ready to accept the data then If printer is not ready to accept the data then after sending the data bus , computer uses after sending the data bus , computer uses another handshaking signal to tell printer another handshaking signal to tell printer that valid data is available on the data bus. that valid data is available on the data bus. • Each port uses three lines from port C as Each port uses three lines from port C as handshake signals handshake signals
  • 11. Mode 2 Mode 2 • 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.
  • 12. MODE 2:bi-directional I/O data transfer: MODE 2:bi-directional I/O data transfer: • This mode allows bidirectional data transfer This mode allows bidirectional data transfer over a single 8-bit data bus using over a single 8-bit data bus using handshake signals. handshake signals. • This feature is possible only Group A This feature is possible only Group A • Port A is working as 8-bit bidirectional. Port A is working as 8-bit bidirectional. • PC PC3 3-PC -PC7 7 is used for handshaking purpose. is used for handshaking purpose. • The data is sent by CPU through this port , The data is sent by CPU through this port , when the peripheral request it. when the peripheral request it. • CONTROL WORD FORMATS: CONTROL WORD FORMATS: • In the INPUT mode , When RESET is High all In the INPUT mode , When RESET is High all 24 pins (3-ports) be a input mode. 24 pins (3-ports) be a input mode.
  • 13. • i.e all flip flops are cleared and the i.e all flip flops are cleared and the interrupts are rest. interrupts are rest. • This condition is maintained even after This condition is maintained even after RESET goes low. RESET goes low. • This can be avoid by writing single control This can be avoid by writing single control word to the control registers , when word to the control registers , when required. required.
  • 15. Function of pins: Function of pins: • Data bus(D Data bus(D0 0-D -D7 7) ):These are 8-bit bi-directional buses, :These are 8-bit bi-directional buses, connected to 8086 data bus for transferring data. connected to 8086 data bus for transferring data. • CS: This is Active Low signal. CS: This is Active Low signal. It stands for Chip Select. A LOW on this input selects the chip and enables the communication between the 8255 and the CPU. • Read: This is Active Low signal, when it is Low the Read: This is Active Low signal, when it is Low the microprocessor reads data from a selected I/O port microprocessor reads data from a selected I/O port of 8255A. of 8255A. • Write: This is Active Low signal, when it is Low the Write: This is Active Low signal, when it is Low the microprocessor writes data into a selected I/O port . microprocessor writes data into a selected I/O port .
  • 16. • Address (A Address (A0 0-A -A1 1):This is used to select the ):This is used to select the ports. ports. A1 A1 A0 A0 Select Select 0 0 0 0 PA PA 0 0 1 1 PB PB 1 1 0 0 PC PC 1 1 1 1 Control Control reg. reg.
  • 17. • RESET: This is used to reset the device. That RESET: This is used to reset the device. That means clear control registers. means clear control registers. • PA PA0 0-PA -PA7 7:It is the 8-bit bi-directional I/O pins :It is the 8-bit bi-directional I/O pins used to send the data to peripheral or to used to send the data to peripheral or to receive the data from peripheral. receive the data from peripheral. • PB PB0 0-PB -PB7 7:Similar to PA :Similar to PA • PC PC0 0-PC -PC7 7:This is also 8-bit bidirectional I/O pins. :This is also 8-bit bidirectional I/O pins. These lines are divided into two groups. These lines are divided into two groups. 1. 1. PC PC0 0 to PC to PC3 3(Lower Groups) (Lower Groups) 2. 2. PC PC4 4 to PC to PC7 7 (Higher groups) (Higher groups) These two groups working in separately using 4 These two groups working in separately using 4 data’s. data’s.
  • 19. Data Bus buffer Data Bus buffer: : • It is a 8-bit bidirectional Data bus. It is a 8-bit bidirectional Data bus. • Used to interface between 8255 data bus Used to interface between 8255 data bus with system bus. with system bus. • The internal data bus and Outer pins D The internal data bus and Outer pins D0 0-D -D7 7 pins are connected in internally. pins are connected in internally. • The direction of data buffer is decided by The direction of data buffer is decided by Read/Control Logic. Read/Control Logic.
  • 20. Read/Write Control Logic: Read/Write Control Logic: • This is getting the input signals from This is getting the input signals from control bus and Address bus control bus and Address bus • Control signal are RD and WR. Control signal are RD and WR. • Address signals are A0,A1,and CS. Address signals are A0,A1,and CS. • 8255 operation is enabled or disabled 8255 operation is enabled or disabled by CS. by CS.
  • 21. Group A and Group B control: Group A and Group B control: • Group A and B get the Control Signal from CPU and Group A and B get the Control Signal from CPU and send the command to the individual control blocks. send the command to the individual control blocks. • Group A send the control signal to port A and Port C Group A send the control signal to port A and Port C (Upper) PC (Upper) PC7 7-PC -PC4 4. . • Group B send the control signal to port B and Port C Group B send the control signal to port B and Port C (Lower) PC (Lower) PC3 3-PC -PC0 0. . • PORT A PORT A: : • This is a 8-bit buffered I/O latch. This is a 8-bit buffered I/O latch. • It can be programmed by mode 0 , mode 1, mode It can be programmed by mode 0 , mode 1, mode 2 . 2 .
  • 22. PORT B: PORT B: • This is a 8-bit buffer I/O latch. This is a 8-bit buffer I/O latch. • It can be programmed by mode 0 and It can be programmed by mode 0 and mode 1. mode 1. • PORT C PORT C: : • This is a 8-bit Unlatched buffer Input and This is a 8-bit Unlatched buffer Input and an Output latch. an Output latch. • It is splitted into two parts. It is splitted into two parts. • It can be programmed by bit set/reset It can be programmed by bit set/reset operation. operation.
  • 23. Operation modes in 8255 Operation modes in 8255 • Two operating modes: Two operating modes: – I/O mode( mode 0, mode 1, mode2) I/O mode( mode 0, mode 1, mode2) – Bit set/Reset mode Bit set/Reset mode
  • 24. Operation modes: Operation modes: BIT SET/RESET MODE: BIT SET/RESET MODE: • The PORT C can be Set or Reset by sending OUT The PORT C can be Set or Reset by sending OUT instruction to the CONTROL registers. instruction to the CONTROL registers. I/O MODES: I/O MODES: • MODE 0(Simple input / Output): MODE 0(Simple input / Output): • In this mode , port A, port B and port C is used as In this mode , port A, port B and port C is used as individually (Simply). individually (Simply). • Features: Features: • Outputs are latched , Inputs are buffered not Outputs are latched , Inputs are buffered not latched. latched. • Ports do not have Handshake or interrupt capability. Ports do not have Handshake or interrupt capability.
  • 25. Control words Control words • Two control words: Two control words: – I/O mode set control word(MSW) I/O mode set control word(MSW) – Bit set/reset control word(BSR) Bit set/reset control word(BSR) • MSW is used to specify I/O functions. MSW is used to specify I/O functions. • BSR is used to set/reset individual pins of BSR is used to set/reset individual pins of Port C. Port C. • Both the control words are written in the Both the control words are written in the same control register. same control register.
  • 26. • 8255 ports are programmed by writing control word 8255 ports are programmed by writing control word in the control word in the control register. in the control word in the control register. • For setting I/O functions and mode of operation the For setting I/O functions and mode of operation the I/O mode set control word is send to control register. I/O mode set control word is send to control register. • For setting/ resetting pins of port C, the bit set/reset For setting/ resetting pins of port C, the bit set/reset control word is send to control register. control word is send to control register.
  • 27. FOR BIT SET/RESET MODE: FOR BIT SET/RESET MODE: • This is bit set/reset control word format. This is bit set/reset control word format. X X X X X X Don’t care Don’t care Bit select Bit select B B0 0 B B1 1 B B2 2 D7 D6 D5 D4 D3 D2 D1 D0 0 1 2 3 4 5 6 7 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 BIT SET/RESET 1=SET 0=RESET BIT SET/RESET FLAG =0 Active
  • 28. • PC PC0 0-PC -PC7 7 is set or reset as per the status of is set or reset as per the status of D D0. 0. • A BSR word is written for each bit A BSR word is written for each bit • Example: Example: – PC PC3 3 is Set then control register will be is Set then control register will be 0XXX0111. 0XXX0111. – PC PC4 4 is Reset then control register will be is Reset then control register will be 0XXX01000. 0XXX01000. • X is a don’t care. X is a don’t care.
  • 29. FORMAT OF I/O MODE: FORMAT OF I/O MODE: The mode format for I/O as shown in figure The mode format for I/O as shown in figure D7 D6 D5 D4 D3 D2 D1 D0 Group A Port C Upper 1=Input 0=Output Port B 1=Input 0=Output Mode selection 00=mode 0 01=mode 1 1x=mode 2 Group B Port C Lower 1=Input 0=Output Port B 1=Input 0=Output Mode selection 0=mode 0 1=mode 1 Mode set 1-I/O mode 0-BSR mode
  • 30. • The control word for both mode is same. • Bit D7 is used for specifying whether word loaded in to Bit set/reset mode or Mode definition word. • D7=1=Mode definition mode. • D7=0=Bit set/Reset mode.