Monday, March 18, 2019

FMA Unit 5.4 8255_PPI_operating modes


8255 Operating Modes
     1.     Bit set reset (BSR) mode – This mode is used to set or reset the bits of port C only. This mode affects only one bit of port C at a time because, as user set the bit, it remains set until and unless user changes it.

Bit D7: 0 for BSR mode and

    1 for I/O mode.

Bit D6, D5 and D4: Don’t care bits
Bit D3, D2 and D1: Port C bit select Bit
D3
D2
D1
Bit
0
0
0
Bit 0
0
0
1
Bit 1
0
1
0
Bit 2
0
1
1
Bit 3
1
0
0
Bit 4
1
0
1
Bit 5
1
1
0
Bit 6
1
1
1
Bit 7
Bit D0: 0 for reset and
    1 for set
2. Input/output mode (I/O) or Control word register
 – This mode is selected when the most significant bit (D7) in the control register is 1.
·         Mode 0 – Simple or basic I/O mode:
Port A, B and C can work either as input function or as output function. The outputs are latched but the inputs are not latched.
It has interrupt handling capability.
·                   Mode 1 – Handshake or strobbed I/O:
In this either port A or B can work and port C bits are used to provide handshaking.
The outputs as well as inputs are latched.
It has interrupt handling capability.
Before actual data transfer there is transmission of signal to match speed of CPU and printer.
·                   Mode 3 – Bidirectional I/O:
In this mode only port A will work, port B can either is in mode 0 or 1 and port C bits are used as handshake signal.
The outputs as well as inputs are latched.
It has interrupt handling capability.

D7
D6
D5
D4
D3
D2
D1
D0
1
GA Mode
PA
PCU
GB Mode
PB
PCL

Bit D7: Mode selection

0 for BSR mode and

1 for I/O mode.

Bit D6 and D5: Group A Mode Selection

                        00 for Mode 0

                        01 for Mode 1

                        0x for Mode 2

Bit D4: Group A port A (PA7 – PA0)

                        0 for output and

1 for input

Bit D3: Port C upper (PC7 – PC4)

                        0 for output and

1 for input

 

Bit D2: Group B Mode Selection

                        0 for Mode 0

                        1 for Mode 1

Bit D1: Group B port B (PB7 – PB0)

                        0 for output and

1 for input

Bit D0: Port C lower (PC3 – PC0)

                        0 for output and

1 for input

 


No comments:

Post a Comment