SlideShare una empresa de Scribd logo
1 de 36
Dr A Sahu
Dept of Computer Science &
Engineering
IIT Guwahati
Hierarchy of I/O Control Devices
8155
I/O + Timer
8255
I/O
8253/54
Timer
2 Port (A,B),
No
Bidirectional
HS mode (C)
4 mode timer
2 Port (A,B)
A is Bidirectional
HS mode (C)
Extra controls
6 mode timer
8259
Interrupt controller
8237
DMA controller
8251
Serial I/O USART
controller
• 8255 Architecture and its block diagram
• 8255 Ports and mode of operations
• BSR Mode
• Mode 0
– Interfacing A/D Converter using Handshake mode
using 8255
• Mode 1
– Interfacing DIP keyboard using Handshake mode using
8255
• Mode 2
– Interfacing keyboard (with bounce) using Handshake
mode using 8255
• Introduction to interrupt controller (8259A)
Group A
Control
Group B
Control
Read
Write
Control
Logic
Data
Bus
Buffer
Gr A
Port A
(8)
Gr A
Port C
(H 4)
Gr B
Port C
(L 4)
Gr B
Port B
(8)
I/O
PA7-PA0
I/O
PC7-PC4
I/O
PC3-PC0
I/O
PB7-PB0
8 bit Internal
Data Bus
Bi directional
Data Bus
D7-D0
RDb
WRb
A1
A0
RESET
CSb
CSb A1 A0 Sel
0 0 0 Port A
0 0 1 Port B
0 1 0 Port C
0 1 1 CRW
Port C
D7 D6 D5 D4 D3 D2 D1 D
BSR Mode
Bit Set/Reset
8255
Port B
CU
CL
Port A
I/O Mode
Mode 0
Simple I/O
for Ports
A, B & C
Mode 1
HS mode
for Ports
A and/or B
Port C bits
are used for
HS
Mode 2
Bidirectional
Data mode for Port
A
B can in mode 0/1
Port C bits are used
for HS
BSR Mode
Bit Set/Reset
For Port C
No Effect on
I/O Mode
0/1
D7 D6 D5 D4 D3 D2 D1 D0
7 6 5 4 3 2 1 0
Port A – 1 Input 0 output
Mode select: 00 mode 0;
01 mode 1; 1x mode 2
1 – mode select
0 – bit set/reset
Port C(U) – 1 Input 0 output
Mode select: 0 mode 0; 1 mode 1
Port B – 1 Input 0 output
Port C(L) – 1 Input
0 output
Group A
Group B
8255
CSb
A1
A0
RDb
WRb
A7
A6
A5
A4
A3
A2 A1
A0
IORb
IOWb Reset
Reset
Port A=80H
Port C=82H
Port B=81H
CSb A1 A0 HEX Address Port
A7 A6 A5 A4 A3 A2
1 0 0 0 0 0
A1 A0
0 0 = 80H A
0 1 =81H B
1 0 =82H C
1 1 =83H Control Register
CRW
83H
• Control register controls the overall operation of
8255
• All three ports A, B and C are grouped into two
Group BGroup A
Port A Upper C Port BLower C
• 8255 has three modes:
- Mode 0: basic input-output
- Mode 1: Strobbed input-output
- Mode 2: Strobbed bi-directinal bus I/O
• In mode 0
- Two 8-bit ports and two 4-bit ports
- Any port can be input or output
- Outputs are latched, inputs are not latched
• In mode 1:
-Three ports are divided into two groups
-Each group contains one 8-bit port and one 4-bit
control/data port
- 8-bit port can be either input or output and both
latched
- 4-bit port used for control and status of 8-bit data port
• In mode 2
- Only port A is used
- Port A becomes an 8-bit bidiectional bus
- Port C acts as control port (only pins PC3-PC7 are used)
• Set/Reset bit of Port C
• Heavily used for HS and Interrupt mode
• BSR Control word
• BSR Control word
– To set PC7= 0 000 111 1 (0FH)
– To reset PC7= 0 000 111 0 (0EH)
– To set PC3 = 0 000 011 1 (07H)
D7 D6 D5 D4 D3 D2 D1 D0
0
BSR
Mode
Not used, So (000) Bit Select S/R (1/0)
• BSR Control word
– To set PC7= 0 000 111 1 (0FH)
– To reset PC7= 0 000 111 0 (0EH)
– To set PC3 = 0 000 011 1 (07H)
Generate Activation pulse of Delay D on PC7&PC3
D7 D6 D5 D4 D3 D2 D1 D0
0
BSR Mode
Not used, So (000) Bit Select S/R (1/0)
MVI A,0FH ; Load ACC to set PC7
OUT 83H ; set PC7=1
MVI A,07H ; Load ACC to set PC3
OUT 83H ; set PC3=1
CALL DELAYD;
MVI A,06H ; Load ACC to Reset PC3
OUT 83H ; set PC3=1
MVI A,0EH ; Load ACC to Reset PC7
OUT 83H ; set PC7=1
• Simple I/O for port A,B,C
• Output are latched
• Input are not latched
• Port don’t have HS or interrupt capability
• Configure
– Port A and port CU as out port
– Port B and port CL as in port
• Interface to Read from I/P DIPs and Display at
O/P LEDs
• Control word
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 1 1
I/O
function
Port A in
Mode 0
Port A
as O/P
Port CU
As O/P
Port B in
Mode 0
Port B
As I/P
Port CL
As I/P
83H
8255
CSb
A1
A0
RDb
WRb
A7
A6
A5
A4
A3
A2
A1
A0
IORb
IOWb
Reset
Reset
Buffer
Buffer
+5V
+5V
PA7
PA0
PC7
PC4
PC3
PC0
PB7
PB0
80H
82H
82H
81H
CRW
83H
MVI A,83H ; Load acc with Control word
OUT 83H ; Load control register with 83
at port address 83
IN81H ; Read DIP from port B
OUT 80H ; Write to LEDs
IN 82H ; Read DIP from port C
ANI 0FH ; Mask upper part of
port C are not i/p
RLC RLC RLC RLC; Rotate 4 time
OUT 82H ; Display data at port CU
HLT
• Air Conditioning Room (Temperature Control)
– Heater and Cooler
– Temperature Sensor
– A/D converter
– Driver Switch to drive Heater/Cooler
• Design an A/C controller using 8255 and 8085
based interfacing circuit
• Read temperature and control the
temperature between 20-30 degree Celciuous
• Air Conditioning Room (Temperature Control)
– Heater and Cooler
– Temperature Sensor
– A/D converter
– Driver Switch to drive Heater/Cooler
• Design an A/C controller using 8255 and 8085
based interfacing circuit
• Read temperature and control the
temperature between 20-30 degree Celsius
• Use port A in mode 0 and Port C in BSR mode
8255
CSb
A1
A0
RDb
WRb
A7
A6
A5
A4
A3
A2
A1
A0
IORb
IOWb
Reset
Reset
PA7
PA0
PC0
PC4
PC7
PC5
PC6
CRW
83H
data
ADCINTRb WRb RDb
LM135
Temp
Sensor
+5V
Relay
Relay
Cooler
Heater
+ -
230V
• Control word
– Port A as I/P from ADC
– Port CL : as I/P PC0 is used for end of conversion
– Port CU : as O/P PC4 -> Start con. PC7 ->assert RDb signal
• BSR Control word
– 0 (mode) 000 (don’t care) 000 (0/1=set/reset)
– Set PC7 high = 0 000 111 1 = 0FH (Send RDb to ADC)
– Set PC4 low = 0 000 100 0 = 08F (send Start Conv WRb)
– Set PC5 high = 0 000 101 1 = 0BF (Fan On)
– Set PC5 low = 0 000 101 0 = 0AF (Fan Off)
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 0 0 0 1
I/O
function
Port A in
Mode 0
Port A
as I/P
Port CU
As O/P
Port B
Is Not used
Port CL
As I/P
91H
MVI A, 91H ; mode 0 control word
OUT 83H ; Set A& CL as I/P & CU as
O/P
MVI A,0FH ;Set PC7 High
OUT 83H ; Disable RDb
MVI A,08H ; Set PC4 WRb low
OUT 83H ; Start conversion
MVI A, 09H ; Set PC4 WRb high
OUT 83H ; Ser WRb high
RD: IN 82H ; Read Port C to Chck PC0
RAR ; Place PC0 in Carry Flag
JC RD ;if PC0=1, read Again
MVI A,0EH ; Set PC7 RDb low
OUT 83H ; Assert RDb signal
IN 80H ; Read A/D conv. Port A
MOV B,A ; get temp in B
MVI A 0FH; ; Set PC7 (RDb) high
OUT 83 ; Disable RDb
MOV A,B;
CPI 30D;
CNC COOLEROFF; PC5 off 0AH
CC COOLERON; PC5 on 0BH
CPI 10D;
MOV A,B;
CNC HEATERON; PC6on: 0CH
CC HEATEROFF; PC6off: 0DH
RET
COOLEROFF:
MVI A, 0AH ; Reset PC5 to turn off Cooler
OUT 83H
RET
• Two port A & V function 8 bit I/O
– Configured either Input or output port
• Each port each 3 lines of port C as HS signal
– Remaining two lines can be used as simple I/O
• Input and output are latched
• Interrupt logic is supported
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 0/1 1 1 X=0
I/O
function
Port A in
Mode 1
Port A
as O/P
Port CU
As O/P
Port B in
Mode 1
Port B
As I/P
Port CL
As I/P
AEH
PC6, PC7 in
In/Out mode
• STBb: Strobe generated by Peripheral
• IBF: Input buffer full
– Acknowledge by 8255 to I/O that I/O latched received
– Reset when MPU read the data
• INTR: output signal to MPU and it generate when STBb=1,
IBF=1 and INTE=1
• INTE: Enable or disable Interrupt
– INTEA is through PC4, INTEB is through PC2
• Status word
D7 D6 D5 D4 D3 D2 D1 D0
OBFb
A INTEA 1/0 1/0 INTRA INTEB OBFb
B INTRB
Mask with 02H
• Designing for interfacing
– Keyboard with interrupt I/O in port A
– Output port for a printer using status check I/O
• Control word
• To generate interrupt INTEA PC4 to set in BSR mode
– 0 (mode) 000 (don’t care) 000 (0/1=set/reset)
– Set PC4 High = 0 000 100 1 = 09F (send INTR to MPU
RST 6.5)
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 1 0 1 0 0
I/O
function
Port A in
Mode 1
Port A
as I/P
PC6,7 as
X
Port B in
Mode 1
Port B
As O/P
Don’t
care
B4H
8255
CSb
A1
A0
RDb
WRb
A1
A0
IORb
IOWb
Reset
PA7
PA0
PC4
PC5
PC3
PC1
PC2
PB7
PB0
CRW
83H
data KBD
Printer
STBb
IBF
INTRA
OBFb to PTR
ACKb
80A
81H
To
RST 6.5
A7
A6
A5
A4
A3
A2
Initialization Program
MVI A, B4H ; initialize port A as IP and B
as O/P
OUT 83H
MVI A,09H ; Set INTEA , that is PC4
EI ;Enable interrupt
CALL PRINT ; Continue other Task
ISR at 0034 at RST6.5 vector location
0034: JMP READPORTA
READ PORTA:
DI
IN 80H
MOV M, A
INX H
EI
RET
PRINT: LXI H MEM
MVI B COUNT
MOV A,M
MOV C,A
STATUS: IN 82H ; from port C for
Status OBFb
ANI 02H
JNZ STATUS
MOV A,C
OUT 81H; Send to port B
printer
INX H
DCR B
JNZ NEXT
RET
• Bi-directional
– Data transfer between two MPU
– Data transfer between MPU and Controller
• Port A can be bi-directional, Port B in either 0
or 1 mode
• Port A use 5 signals from port C as Handshake
signal for data transfer
• One is Master other is Slave
• Use 8255 as Interfacing device
Master
MPU
Slave
MPU8255
OBFb
ACKb
IBF
STBb
Decode
Logic CSb
RDb
WRb
PC7
PC6
PC5
PC4
PC3
• Master read the status of OBF to verify
whether the previous byte has read by Slave
• Mater write date in port A and 8255 inform to
Slave by OBFb low
• Slave check OBF for data availability
• Slave read the data from port A and ACK low
to 8255
• Slave check the HS signal IBF to find out
whether port A is available or not
• Slave Write a data in port A and inform 8255
by enabling STBb low
• 8255 causes a IBF to go high and MPU get the
signal the data byte to read
• Master read the data from port A and make
IBF low
Slave
MPU
8255
CSb
A1
A0
RDb
WRb
A1
A0
IORb
IOWb
Reset
PA7
PA0
PC7
PC5
PC6
PC4
CRW
83H
data
ACKb
A7
A6
A5
A4
A3
A2
data
Latch
TriStat
e
STBb
IOR
b
Master
MPU
IORb
IOWb
3to8
Decoder
07
05
00
D7
D0
A7
A6
A5
A2
A1
A0
EN
80H=A
81H=B
82H=C
83H=CRW
85H = A
87H = C
• Control word
• Status word:
D7 D6 D5 D4 D3 D2 D1 D0
1 1 X X X 1/0 1/0 1/0
I/O
function
Port A in
Mode 1
Port A
as Bi
Port B in
Mode
1/0
Port B
As 1/0
Port C
Port C bit 2,1,0
mode 0/1
C0H
D7 D6 D5 D4 D3 D2 D1 D0
OBFA INTE1 IBFA INTE2 INTRA X X X
RAL instruction to get
the Status
Master:
LXI H, MemptrM
MVI B, Byte2Trasfer
MVI A, CTRL; Control word for
Mode 2
OUT 83H; Write Control word
OBFLO:
IN 82H ; Read port C
RAL ; place OBF in CY
JNC OBFLO;
OUT 80H ; place on Port A
INX H
DCR B
JNZ OBFLO
HLT
SLAVE:
LXI H, MemptrS
MVI B, Byte2Trasfer
OBFHI:
IN 87H ; Read port C
RAL ; place OBF in CY
JC OBFHI;
IN 85H ; Read from Port A
MOV M, A
INX H
DCR B
JNZ OBFHI
HLT
• Acts as a multiplexer, combining multiple interrupt input
sources into a single interrupt output to interrupt a single
device.
• Original PC introduced in 1981
• Eight interrupt input request lines
– IRQ0 - IRQ7,
– An interrupt request output line named INTR
– Interrupt acknowledgment line named INTA
– D0 through D7 for communicating the interrupt level or vector
offset.
• There are three registers
– Interrupt Mask Register (IMR)
– Interrupt Request Register (IRR)
– In-Service Register (ISR)
• R S Gaonkar, “Microprocessor
Architecture”, Chapter 15
Lec14

Más contenido relacionado

La actualidad más candente

Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copy
mkazree
 

La actualidad más candente (20)

8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha
 
Chapter
ChapterChapter
Chapter
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255A
 
Interfacing ics for microprocessor
Interfacing ics for microprocessorInterfacing ics for microprocessor
Interfacing ics for microprocessor
 
8155 Basic Concepts
8155 Basic Concepts8155 Basic Concepts
8155 Basic Concepts
 
8255 Programmable parallel I/O
8255 Programmable parallel I/O 8255 Programmable parallel I/O
8255 Programmable parallel I/O
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
7 8255
7 82557 8255
7 8255
 
Microprocessor Basics 8085-8255 ch-5
Microprocessor Basics 8085-8255 ch-5Microprocessor Basics 8085-8255 ch-5
Microprocessor Basics 8085-8255 ch-5
 
1204 Ppi 8255
1204 Ppi 82551204 Ppi 8255
1204 Ppi 8255
 
Ppi 8255
Ppi 8255Ppi 8255
Ppi 8255
 
Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copy
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentation
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
8085 lab
8085 lab8085 lab
8085 lab
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architecture
 
8085 ppi 8255 and 8155
8085 ppi 8255 and 81558085 ppi 8255 and 8155
8085 ppi 8255 and 8155
 
Unit 5 assembly language programming
Unit 5   assembly language programmingUnit 5   assembly language programming
Unit 5 assembly language programming
 
Microprocessor systems 8085(2)
Microprocessor systems 8085(2)Microprocessor systems 8085(2)
Microprocessor systems 8085(2)
 

Similar a Lec14

Io (2)
Io (2)Io (2)
Io (2)
Aisu
 
8255.pdf
8255.pdf8255.pdf
8255.pdf
someshdash1
 

Similar a Lec14 (20)

L4-L6 8255 A.pptx
L4-L6 8255 A.pptxL4-L6 8255 A.pptx
L4-L6 8255 A.pptx
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
Io (2)
Io (2)Io (2)
Io (2)
 
8255 programming
8255 programming8255 programming
8255 programming
 
Lec11
Lec11Lec11
Lec11
 
8255 & IO Interfacing.pdf
8255 & IO Interfacing.pdf8255 & IO Interfacing.pdf
8255 & IO Interfacing.pdf
 
8255
82558255
8255
 
unit-3-8255.pdf
unit-3-8255.pdfunit-3-8255.pdf
unit-3-8255.pdf
 
Mod-2 M&M.pptx
Mod-2 M&M.pptxMod-2 M&M.pptx
Mod-2 M&M.pptx
 
MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3
 
8255-PPI MPMC text book for engineering.ppt
8255-PPI MPMC text book for engineering.ppt8255-PPI MPMC text book for engineering.ppt
8255-PPI MPMC text book for engineering.ppt
 
8255.pdf
8255.pdf8255.pdf
8255.pdf
 
26. 8255 control word programming
26. 8255 control word programming26. 8255 control word programming
26. 8255 control word programming
 
8255.ppt
8255.ppt8255.ppt
8255.ppt
 
PPI-MECHATRONICS
PPI-MECHATRONICSPPI-MECHATRONICS
PPI-MECHATRONICS
 
Programmable Peripheral Devices
Programmable Peripheral Devices Programmable Peripheral Devices
Programmable Peripheral Devices
 
MPMC Unit-3 PPT.pdf
MPMC  Unit-3 PPT.pdfMPMC  Unit-3 PPT.pdf
MPMC Unit-3 PPT.pdf
 
1.ppi 8255
1.ppi 8255 1.ppi 8255
1.ppi 8255
 
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
 

Más de siddu kadiwal (12)

Chp10 sw constr
Chp10 sw constrChp10 sw constr
Chp10 sw constr
 
Lec10
Lec10Lec10
Lec10
 
Lec09
Lec09Lec09
Lec09
 
Lec08
Lec08Lec08
Lec08
 
Lec07
Lec07Lec07
Lec07
 
Lec06
Lec06Lec06
Lec06
 
Lec05
Lec05Lec05
Lec05
 
Lec04
Lec04Lec04
Lec04
 
Lec03
Lec03Lec03
Lec03
 
Lec02
Lec02Lec02
Lec02
 
Lec04
Lec04Lec04
Lec04
 
Ece iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notesEce iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notes
 

Último

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Último (20)

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

Lec14

  • 1. Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati
  • 2. Hierarchy of I/O Control Devices 8155 I/O + Timer 8255 I/O 8253/54 Timer 2 Port (A,B), No Bidirectional HS mode (C) 4 mode timer 2 Port (A,B) A is Bidirectional HS mode (C) Extra controls 6 mode timer 8259 Interrupt controller 8237 DMA controller 8251 Serial I/O USART controller
  • 3. • 8255 Architecture and its block diagram • 8255 Ports and mode of operations • BSR Mode • Mode 0 – Interfacing A/D Converter using Handshake mode using 8255 • Mode 1 – Interfacing DIP keyboard using Handshake mode using 8255 • Mode 2 – Interfacing keyboard (with bounce) using Handshake mode using 8255 • Introduction to interrupt controller (8259A)
  • 4. Group A Control Group B Control Read Write Control Logic Data Bus Buffer Gr A Port A (8) Gr A Port C (H 4) Gr B Port C (L 4) Gr B Port B (8) I/O PA7-PA0 I/O PC7-PC4 I/O PC3-PC0 I/O PB7-PB0 8 bit Internal Data Bus Bi directional Data Bus D7-D0 RDb WRb A1 A0 RESET CSb CSb A1 A0 Sel 0 0 0 Port A 0 0 1 Port B 0 1 0 Port C 0 1 1 CRW
  • 5. Port C D7 D6 D5 D4 D3 D2 D1 D BSR Mode Bit Set/Reset 8255 Port B CU CL Port A I/O Mode Mode 0 Simple I/O for Ports A, B & C Mode 1 HS mode for Ports A and/or B Port C bits are used for HS Mode 2 Bidirectional Data mode for Port A B can in mode 0/1 Port C bits are used for HS BSR Mode Bit Set/Reset For Port C No Effect on I/O Mode 0/1
  • 6. D7 D6 D5 D4 D3 D2 D1 D0 7 6 5 4 3 2 1 0 Port A – 1 Input 0 output Mode select: 00 mode 0; 01 mode 1; 1x mode 2 1 – mode select 0 – bit set/reset Port C(U) – 1 Input 0 output Mode select: 0 mode 0; 1 mode 1 Port B – 1 Input 0 output Port C(L) – 1 Input 0 output Group A Group B
  • 7. 8255 CSb A1 A0 RDb WRb A7 A6 A5 A4 A3 A2 A1 A0 IORb IOWb Reset Reset Port A=80H Port C=82H Port B=81H CSb A1 A0 HEX Address Port A7 A6 A5 A4 A3 A2 1 0 0 0 0 0 A1 A0 0 0 = 80H A 0 1 =81H B 1 0 =82H C 1 1 =83H Control Register CRW 83H
  • 8. • Control register controls the overall operation of 8255 • All three ports A, B and C are grouped into two Group BGroup A Port A Upper C Port BLower C
  • 9. • 8255 has three modes: - Mode 0: basic input-output - Mode 1: Strobbed input-output - Mode 2: Strobbed bi-directinal bus I/O • In mode 0 - Two 8-bit ports and two 4-bit ports - Any port can be input or output - Outputs are latched, inputs are not latched
  • 10. • In mode 1: -Three ports are divided into two groups -Each group contains one 8-bit port and one 4-bit control/data port - 8-bit port can be either input or output and both latched - 4-bit port used for control and status of 8-bit data port • In mode 2 - Only port A is used - Port A becomes an 8-bit bidiectional bus - Port C acts as control port (only pins PC3-PC7 are used)
  • 11. • Set/Reset bit of Port C • Heavily used for HS and Interrupt mode • BSR Control word • BSR Control word – To set PC7= 0 000 111 1 (0FH) – To reset PC7= 0 000 111 0 (0EH) – To set PC3 = 0 000 011 1 (07H) D7 D6 D5 D4 D3 D2 D1 D0 0 BSR Mode Not used, So (000) Bit Select S/R (1/0)
  • 12. • BSR Control word – To set PC7= 0 000 111 1 (0FH) – To reset PC7= 0 000 111 0 (0EH) – To set PC3 = 0 000 011 1 (07H) Generate Activation pulse of Delay D on PC7&PC3 D7 D6 D5 D4 D3 D2 D1 D0 0 BSR Mode Not used, So (000) Bit Select S/R (1/0) MVI A,0FH ; Load ACC to set PC7 OUT 83H ; set PC7=1 MVI A,07H ; Load ACC to set PC3 OUT 83H ; set PC3=1 CALL DELAYD; MVI A,06H ; Load ACC to Reset PC3 OUT 83H ; set PC3=1 MVI A,0EH ; Load ACC to Reset PC7 OUT 83H ; set PC7=1
  • 13. • Simple I/O for port A,B,C • Output are latched • Input are not latched • Port don’t have HS or interrupt capability
  • 14. • Configure – Port A and port CU as out port – Port B and port CL as in port • Interface to Read from I/P DIPs and Display at O/P LEDs • Control word D7 D6 D5 D4 D3 D2 D1 D0 1 0 0 0 0 0 1 1 I/O function Port A in Mode 0 Port A as O/P Port CU As O/P Port B in Mode 0 Port B As I/P Port CL As I/P 83H
  • 16. MVI A,83H ; Load acc with Control word OUT 83H ; Load control register with 83 at port address 83 IN81H ; Read DIP from port B OUT 80H ; Write to LEDs IN 82H ; Read DIP from port C ANI 0FH ; Mask upper part of port C are not i/p RLC RLC RLC RLC; Rotate 4 time OUT 82H ; Display data at port CU HLT
  • 17. • Air Conditioning Room (Temperature Control) – Heater and Cooler – Temperature Sensor – A/D converter – Driver Switch to drive Heater/Cooler • Design an A/C controller using 8255 and 8085 based interfacing circuit • Read temperature and control the temperature between 20-30 degree Celciuous
  • 18. • Air Conditioning Room (Temperature Control) – Heater and Cooler – Temperature Sensor – A/D converter – Driver Switch to drive Heater/Cooler • Design an A/C controller using 8255 and 8085 based interfacing circuit • Read temperature and control the temperature between 20-30 degree Celsius • Use port A in mode 0 and Port C in BSR mode
  • 20. • Control word – Port A as I/P from ADC – Port CL : as I/P PC0 is used for end of conversion – Port CU : as O/P PC4 -> Start con. PC7 ->assert RDb signal • BSR Control word – 0 (mode) 000 (don’t care) 000 (0/1=set/reset) – Set PC7 high = 0 000 111 1 = 0FH (Send RDb to ADC) – Set PC4 low = 0 000 100 0 = 08F (send Start Conv WRb) – Set PC5 high = 0 000 101 1 = 0BF (Fan On) – Set PC5 low = 0 000 101 0 = 0AF (Fan Off) D7 D6 D5 D4 D3 D2 D1 D0 1 0 0 1 0 0 0 1 I/O function Port A in Mode 0 Port A as I/P Port CU As O/P Port B Is Not used Port CL As I/P 91H
  • 21. MVI A, 91H ; mode 0 control word OUT 83H ; Set A& CL as I/P & CU as O/P MVI A,0FH ;Set PC7 High OUT 83H ; Disable RDb MVI A,08H ; Set PC4 WRb low OUT 83H ; Start conversion MVI A, 09H ; Set PC4 WRb high OUT 83H ; Ser WRb high RD: IN 82H ; Read Port C to Chck PC0 RAR ; Place PC0 in Carry Flag JC RD ;if PC0=1, read Again MVI A,0EH ; Set PC7 RDb low OUT 83H ; Assert RDb signal IN 80H ; Read A/D conv. Port A MOV B,A ; get temp in B MVI A 0FH; ; Set PC7 (RDb) high OUT 83 ; Disable RDb MOV A,B; CPI 30D; CNC COOLEROFF; PC5 off 0AH CC COOLERON; PC5 on 0BH CPI 10D; MOV A,B; CNC HEATERON; PC6on: 0CH CC HEATEROFF; PC6off: 0DH RET COOLEROFF: MVI A, 0AH ; Reset PC5 to turn off Cooler OUT 83H RET
  • 22. • Two port A & V function 8 bit I/O – Configured either Input or output port • Each port each 3 lines of port C as HS signal – Remaining two lines can be used as simple I/O • Input and output are latched • Interrupt logic is supported D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 0 0/1 1 1 X=0 I/O function Port A in Mode 1 Port A as O/P Port CU As O/P Port B in Mode 1 Port B As I/P Port CL As I/P AEH PC6, PC7 in In/Out mode
  • 23. • STBb: Strobe generated by Peripheral • IBF: Input buffer full – Acknowledge by 8255 to I/O that I/O latched received – Reset when MPU read the data • INTR: output signal to MPU and it generate when STBb=1, IBF=1 and INTE=1 • INTE: Enable or disable Interrupt – INTEA is through PC4, INTEB is through PC2 • Status word D7 D6 D5 D4 D3 D2 D1 D0 OBFb A INTEA 1/0 1/0 INTRA INTEB OBFb B INTRB Mask with 02H
  • 24. • Designing for interfacing – Keyboard with interrupt I/O in port A – Output port for a printer using status check I/O • Control word • To generate interrupt INTEA PC4 to set in BSR mode – 0 (mode) 000 (don’t care) 000 (0/1=set/reset) – Set PC4 High = 0 000 100 1 = 09F (send INTR to MPU RST 6.5) D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 1 0 1 0 0 I/O function Port A in Mode 1 Port A as I/P PC6,7 as X Port B in Mode 1 Port B As O/P Don’t care B4H
  • 26. Initialization Program MVI A, B4H ; initialize port A as IP and B as O/P OUT 83H MVI A,09H ; Set INTEA , that is PC4 EI ;Enable interrupt CALL PRINT ; Continue other Task ISR at 0034 at RST6.5 vector location 0034: JMP READPORTA READ PORTA: DI IN 80H MOV M, A INX H EI RET PRINT: LXI H MEM MVI B COUNT MOV A,M MOV C,A STATUS: IN 82H ; from port C for Status OBFb ANI 02H JNZ STATUS MOV A,C OUT 81H; Send to port B printer INX H DCR B JNZ NEXT RET
  • 27. • Bi-directional – Data transfer between two MPU – Data transfer between MPU and Controller • Port A can be bi-directional, Port B in either 0 or 1 mode • Port A use 5 signals from port C as Handshake signal for data transfer
  • 28. • One is Master other is Slave • Use 8255 as Interfacing device Master MPU Slave MPU8255 OBFb ACKb IBF STBb Decode Logic CSb RDb WRb PC7 PC6 PC5 PC4 PC3
  • 29. • Master read the status of OBF to verify whether the previous byte has read by Slave • Mater write date in port A and 8255 inform to Slave by OBFb low • Slave check OBF for data availability • Slave read the data from port A and ACK low to 8255
  • 30. • Slave check the HS signal IBF to find out whether port A is available or not • Slave Write a data in port A and inform 8255 by enabling STBb low • 8255 causes a IBF to go high and MPU get the signal the data byte to read • Master read the data from port A and make IBF low
  • 32. • Control word • Status word: D7 D6 D5 D4 D3 D2 D1 D0 1 1 X X X 1/0 1/0 1/0 I/O function Port A in Mode 1 Port A as Bi Port B in Mode 1/0 Port B As 1/0 Port C Port C bit 2,1,0 mode 0/1 C0H D7 D6 D5 D4 D3 D2 D1 D0 OBFA INTE1 IBFA INTE2 INTRA X X X RAL instruction to get the Status
  • 33. Master: LXI H, MemptrM MVI B, Byte2Trasfer MVI A, CTRL; Control word for Mode 2 OUT 83H; Write Control word OBFLO: IN 82H ; Read port C RAL ; place OBF in CY JNC OBFLO; OUT 80H ; place on Port A INX H DCR B JNZ OBFLO HLT SLAVE: LXI H, MemptrS MVI B, Byte2Trasfer OBFHI: IN 87H ; Read port C RAL ; place OBF in CY JC OBFHI; IN 85H ; Read from Port A MOV M, A INX H DCR B JNZ OBFHI HLT
  • 34. • Acts as a multiplexer, combining multiple interrupt input sources into a single interrupt output to interrupt a single device. • Original PC introduced in 1981 • Eight interrupt input request lines – IRQ0 - IRQ7, – An interrupt request output line named INTR – Interrupt acknowledgment line named INTA – D0 through D7 for communicating the interrupt level or vector offset. • There are three registers – Interrupt Mask Register (IMR) – Interrupt Request Register (IRR) – In-Service Register (ISR)
  • 35. • R S Gaonkar, “Microprocessor Architecture”, Chapter 15