Sponsored Links
This presentation is the property of its rightful owner.
1 / 119

第七章 可编程接口芯片 PowerPoint PPT Presentation


  • 62 Views
  • Uploaded on
  • Presentation posted in: General

第七章 可编程接口芯片. 可编程接口概术 可编程并行输入/输出接口芯片 8255A 可编程定时/计数器接口芯片 8253. 可编程接口概术 一个简单的具有输入功能和输出功能的可编程接口 电路如下图,它包括一个输入接口,其组成主要是 八位的三态门 ;一个输出接口,其组成主要是 八位的锁存器 ;另外还有八位的 多路转换开关 及控制这个开关的寄存器 FF 。. 数据端口. 控制端口. 命令寄存器. 方式控制字. 控制信息.

Download Presentation

第七章 可编程接口芯片

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


  • 8255A

  • 8253


  • FF



FFFF


  • 8255A I/O

  • 8253 /

  • 8251 I/O

  • 8259A


7.1 8255A

8255AIO8086MCS51Z80CPU8255A3CPU


8255A

A

B

C


8255A

AB


8255A


18255A824APA7PA0I/OBPB7PB0I/OCPC7PC0I/OPC7PC0


PA0PA7

PB0PB7

PC0PC7


2CPU D7D0RESETCPUA0A1


D0D7

A0

A1

/CS

/WR

/RD

RESET

CPU


38255AVCCGNDVCC5V; GND


82558086CPU

    • RAMM/IO=0

  • 8I/O82550300H

    (138)


8255A

18255A8255A012---


28255A 8255A8255

8255AABC0


18255A3ABAB:


1

D6

D5

D4

D3

D2

D1

D0

PC3~PC0: 1

0 0

A

00 0

01 1

1x 2

B: 1

0

A

1

0

B

0 0

1 1

PC7~PC4: 1

0 0


2C10

10


0

D6

D5

D4

D3

D2

D1

D0

1: 1

0: 0

x

x

x

C1/0

PC0

PC1

PC2

PC3

PC4

PC5

PC6

PC7

0

0

0

0

1

1

1

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

0

1


38255A12CCI/O


1


8255A

18255A0

  • 0

  • AB

  • C4(PC7PC4) 4(PC3PC0) 44

  • 16

  • 8255A0LED


  • 8255

    • 18255

    • 2


8255AAB0AB


LED


A:8020H, B:8022H,

C:8024H, :8026H.

10011001B=99H


a_port equ 8020h

b_port equ 8022h

ctrl_port equ 8026h

mov al,99h8255

mov dx,ctrl_port

out dx , al

mov dx,a_port

in al,dx

and al,0fh4

mov bx,offset tab1

xlat

mov dx,b_port

out dx,al


28255A1

A

AA

AA

A8255AACPUCPUA


  • C

    1PC35A PC4 /STB

    PC5 IBFPC3INTR

    2PC67I/O

    3PC02B


PB7~PB0

PC2

STBB

INTEB

PC1

IBFB

PC0

INTRB

1B

1

1

2

3

B

2

CPU


1

8255A1

2

3

4

1/STB>A

2IBFCPU

3INTACPU A

4CPUAIBFINTA


8255A1

ACPUIBFA


  • 8255ASTBAIBFA


8255AAB10A8B81CPUB


1K0K72KA CPU8255A


3IBFALED 8255A CPUA CPU 4CPULED51


8255I/O88H8EH (A:88H B:8AH C:8CH :8EH)

mov al,10111001bA1

loop1 in al,8chC

test al,00100000bIBFA(PC5)

jz loop1

in al,88hLED4

out 8ah,alB

jmp loop1


38255A1

A

AA

A8255AACPUCPUA


  • C

    1PC3 ,PC6 ,PC7A

    PC3 /INTR

    PC7 /ACKPC5/OBF

    2PC45I/O

    3PC02B


PB7~PB0

PC2

INTEB

ACKB

PC1

OBFB

CPU

PC0

INTRB

CPU


1

8255A1

3

1

4

2

1CPUA/OBFA

28255/ACK8255A

3A/OBFA

4INTACPU


ACPUIBFA


OBFAACKA OBFA8255AA ACKAA


8255AA1810,A


  • CPUA

  • LED LED

  • KACKCPU

1OBFACK


mov cx,1010

mov bx,offset xxbx

loop1: mov al,[bx]

out 88h,alA

loop2:in al,8ch C

and al,80hOBFA

jz loop2

,; LED2

call delay

LED 4

inc bx

loop loop110


A8255AACPUCPUA

48255A2

AA

AA

AA


8255AAB218255ACI/OB0C3I/O


8255

1

80868255A0BUFF400HASCII


1D7D0

2STB

3BUSYBUSY

1

2

3


mov al,10001010B

out ctrl_port,al

mov al,00000001B;/

out ctrl_port,al ;PC0

mov bx,offset buff400ASCII

mov cx,400

again: mov dl,[bx]

call print_data

inc bx

loop again


print_data proc dl

print1: in al,c_portC

test al, 00010000bbusyPC4

jnz print1 busy(1-)

mov al,dl

out a_port,alA

mov al,00000000bPC0()

out ctrl_port,al

NOP

NOP

mov al,00000001b PC0

out ctrl_port,al

ret

print_datA endp

/STB

(PC0)


2

8


8

1


ai0bicidei1>ifi8bg8


a_port equ 80h8255A

b_port equ 82h

c_port equ 84h

ctrl_port equ 86h

datasegment

tab1db 3FH,06H,5BH,4FH,,

dispbuffdb 2,0,0,7,1,0,1,5

dataends


dispbuff

displayproc ..

mov bx,offset tab1

mov si,offset dispbuffa

mov cx,8

mov ah,80h1000 0000B

disp1:mov al,[si]b

xlat

out a_port,al

mov al,ahc al=1000 0000B

out b_port,alcall delay5msd5ms

shr ah,1e

inc si

loop disp1

ret

displayendp


3

I/O


a

b0

c1

b

1

d10ms

e i0dh

f i01ah

g

h0dl

ii1f

ikey_num


I/O




a

b0

c1

b

1

d10ms

e0j

f

g0

h0i

ikey_num (i, j)


7. 2 8253

    • CPUCPU

    • /


7. 2 8253

INTEL8253825331616553562MHz


8253


1

0

1

2


2

CLK

CLK1.

GATE

OUT


82538086

1

2


8253

8253825382534/


SC1 SC0

0 0

0

0 1

1

1 0

2

1 1

<>SC1SC0


RL1 RL0

1 1

16

0 0

0 1

1 0

<>/RLlRL0


    • 8253CPU

    • GATE

      • (16)CPUCPU

    • 0000XXXXB

88 1000H 0F00H


STB

H

L


M2 M1 M0

0 0 0

0

0 0 1

1

X 1 0

2

X 1 1

3

1 0 0

4

1 0 1

5

<>M2M1M0


BCD

0

1

BCD

<>BCD


8253

10

0

aGATE1

bOUT0

c0OUT01

a

b

c


INT

8086

8004

MOV AL,10011010B8255A

OUT 8255AL

MOV AL,00H 8255A/,PC00

OUT 8255AL

MOV AL,30H 82530

OUT 8253AL

MOV AL40H82530(4)

OUT 0AL 4=14400s=3840H s

MOV AL38H

OUT 0AL

MOV AL,00000001B 8255/PC01

OUT 8255AL


1

21

aGATEGATE

bOUT

c0OUT

d

a

d

c

b


T3T1, T2


3 2

2

aGATE1CLK

b1CLK0OUT2CLK

c0


a

c

b


43

23


    • OUT

    • GATEOUT

    • nn2OUT 0OUT

  • 0

    • NOUTNCLK11

    • NNCLK[(N+1)/2][(N-1)/2]


8253030OUT01.19MHz/216 =18.2Hz036H

8253lRAM212H181.19M/1866.1kHz15.13s154H

8253236A4H11901.19MHz/11901kHz20B6H


8253030OUT01.19MHz/216 =18.2Hz036H

8253lRAM212H181.19M/1866.1kHz15.13s154H

8253236A4H11901.19MHz/11901kHz20B6H


4

  • :CPU

  • :STB,STB

  • CPU8253CPU

  • 4OUTCPU0OUT


  • 4

    • GATE1OUT

    • 0OUTCLKOUT

    • OUT1CLK

GATEGATE1


882530 ,CPU

4


5

    • OUT;

    • ;

    • GATE(5);

    • 0OUTCLKOUT(OUT1CLK )


  • 0GATE

8 ,82530 ,CPU8


8253

  • 8253OUTGATE


  • 825323

    • OUT23

    • GATE


  • 0145

    • CPUGATE04

    • CPUGATEGATE

      15


OUT0145


8253

11MHz82530.50.5825380H86H


1

82531MHz11Hz1N


825365536N1000000

2


3

113023 02BCD13BCD


4

mov al,00110101b0

out 86h,al

mov al,000

out 80h,al

mov al,10h

out 80h,al

mov al,01110110b1

out 86h,al

mov al,0e8h103E8H=1000BCD

out 82h,al

mov al,03h

out 82h,al


2825380H86H825588H 8EH

1

82538255


8255

PC0

8253

OUT0

1KHz

CLK0

GATE0

+5V


2

8253CLK1KHz1S

N1/0.001=1000D=03E8H

3

4


MOV AL,10011011BABC

OUT 8255_CTRL,AL

DELAY1SPROC

MOV AL,00110001B00

16BCD

OUT 8253_CTRL,AL

MOV AL,0

OUT COUNTER0,AL

MOV AL,10H

OUT COUNTER0,AL

AGAIN:IN AL,8255_C OUT1

TEST AL,01

JZ AGAIN

RET

DELAY1SENDP


3825380H86H 825588H 8EH

1

82538255


8255

PC0

8253

OUT0

1KHz

CLK0

GATE0

+5V

OUT1

1MHz

CLK1

GATE1

+5V


2

8253CLK1KHz1S

Nfclk/fout


3

00 1s

13

4


4

PC100001KHz


1

01KHz10100000GATE11KHz


2

11KHz

3

00041GATE0OUTOUT00


3

N010000=2710H

4


  • Login