You are on page 1of 31

8255

Programmable
Peripheral Interface

c

8255
6  

  
£  

  .

   r 8 bits (Port Number 0H)  B 8 bits (Port Number 1H)  C 4 bits upper and 4 bits lower (Port Number 2H)  ! " c£    Ê .

|   | |   | |   |.

|   |  .

   .

            |      |.

   |    |   .

|    |  .

 | .

 | |   |.

|   | |   | |   |  #$Ê   .

. $+. " !" % /0 | %|  /0 | %|  %-" /!"!$ +$"$-   !" " * '(   "  '( /0 |%| /0 | %|  * . #$%$&  |  +"!$ $"$  %      "      !" '(  " ) '( $"$ - -.

     c Ê Ê  c Ê  *     c Ê  *     c Ê  *            c       *  c Ê  *        c Ê   c Ê  *    .

¦   .

.

 ¦ .

 8255 &''  Pr PB PC (Port r B C) CS (Chip Select) RD (Read) WR (Write) D0-D7 (Data Bus) r0 r1 (rddress) $ Â   .

 .

Port 3  ¦¦   /     .

 Â    .

 .

 !  Â   .

 Â.

! Â "   .

 .

  Â 8255  8255      8255    8255  .

  ! # $$ÂÂ      Bi-direction    .

  8255 ¦¦ Port 3  .

8255 zode   "!3 zode   1. zode 2 (Bi .Conditional Bus) . zode 0 (Basic I/O) 2. zode 1 (Strobe I/O) 3.

 £!  "  $($ "6   )*#$.

!   +"" .$  6   "6   ++& '' # !$ %& 6  .  .

(  6 "" #   .

> > > >* > >Ê >c > c    .

 c   c       c c c Ê      c   c       c c c Ê     .

 %&'()&* +. .(-.

Control Bytes   zode      D0 : Port C  (Port C lower) Â     Â  / Â  ´1´ 01Â   ³0´ 01 Â   Â  D1 :  Port B Â   Â    / Â   ³1´ 01Â    ³0´ 01Â Â  D2 : Â zode B / Â ³1´   zode 1 1 ³0´ 01    zode 0 D3 :  Port C (Port C upper Pc4-Pc7) / Â   ³1´ 01Â    ³0´ 01Â Â  D4 :   Port r / Â  ³1´ 01Â   ³2´01 Â   Â  c .

D5 D6 :    ¦Â zode     .

Group r / Â   ³00´ 01   zode 0 ³01´ 01    zode 1 ´1X´ (10 111) 01    zode 2 D7 : .

  !  " ¦¿lag 8255 cc .

¦ "   8255$ 0 cÊ .

¦ "   8255$ 0 c .

¦ "   8255$ 0 c* .

 c     zode 1  ¦0   ³Handshaking´  / #2  ¦  ¦r 1 ¦B  Â #   1Â   ¦ C (Pc4-Pc5)   ¦0   ³Handshaking´ .

 ¦r  ¦C  (Pc0-Pc3)   ¦0   ³Handshaking´ .

 ¦B Handshaking  Â     1    2 "   "!18255 c .

  zode 1.

8255        .

      8255    .

 Ê   CPU   ! c c .

    .

!6$."  #/  0 6  &0 -0. 8255  3&4-5 6  !(    +& #+6."Ê& &''6  £ + .

$/  06 .

$ /  0  # $6 0    c .

 &0 .

$  '1 Ê  &0 .

$ '.!& &'' £   .

$  Ê &0 + 6.+".

 Ê.!&&'' .

£  .

.

.

+  6 +.

!&&'' + .$& 0 6  Ê.

. 6 6&.$ '  '. "&'' .!&&'' 6  #0 .!+ #  &  '' .

!+ #"6  ..

$ &0 .

$6+ c .

 '&0 .

!&0 + .$   1 Ê  '.

/  +0 ".!0 .$  &- #+(&&''  ) 0 Ê.

!&&''. Ê.

£  .

.

.

 .

$ 0 + + 6  0 $ "  .!& &'' £ $ ( %+ .

$Ê" 0 6  " &'' .! 26 .

$ '& c 0 .

$+ .

 .

 .

0 | /1 /.0 |.  ¦ % 3&4-5  /!" 0"" | /  /  | /1 01 |  2 | /  /  |  /.

0 01 Ê .0 2 | /. /.

 0 6&)(7Â  8'9:( Pr7-Pr0      *  Ê c c  c c c" c   PC4  PC5 .

 PC3  " PC6 7 c)  )   8 PB7-PB0 8 PC1 .

 PC2   PC0  £   ' £ ' ' Êc .

 0 6&)(+Â   8'9:( Pr7-Pr0      *  Ê c c  c c c" c   PC4 .

 PC5   PC3  " PC6 7 c)  )   8 PB7-PB0 8 PC1  PC2 .

 PC0  £ ' ' £   ' ÊÊ .

Ê .

¦ "   8255 $ 1 Strobe Input Ê* .

¦ "   8255 $ 1 Strobe Output Ê .

¦ "   8255 $ 1 Strobe Output Ê .

¦ "   8255 $ 1 Strobe Output Ê .

 Ê£   !  Ê.

&''".&# !$ %& 6 && 3 (.

!.  6 "".&   ).

(.

$6  )   !6   .

!   +"  #.!   c Ê . 6 "& &!" Ê" &   &0 (&''  .

 Ê£   ! Ê .

 ʣ   !  .

Summary of Port Connection for 8255 zode 0 zode 1 zode 2 Port r IN OUT IN OUT I/O Port B IN OUT IN OUT Not Used OUT INTRB IB¿B STBB INTRr STBr IB¿B I/O I/O INTRB OB¿B rCKB INTRr I/O I/O rCKr OB¿B 0 Port C 1 2 3 4 5 6 7 IN I/O I/O I/O INTR STB IB¿ rCK OB¿ c .