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

微型计算机技术 PowerPoint PPT Presentation


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

微型计算机技术. 教 学 指 导 (六). 太原广播电视大学 郭建勇. 第 6 章 常用可编程外围接口芯片 内容提要:本章主要介绍微处理器常用的外围接口芯片,定时器 8253 ,并行的外围接口芯片 8255 和串行的通讯接口芯片 8251A 。介绍每种芯片的结构框图,各个部件的功能和用途,以及它们的使用方式。 学习目标:通过学习这些接口芯片,要求掌握不同外围接口芯片在使用时的工作方式。熟练掌握它们在微机接口中的运用环境和使用时的方式控制,以及不同芯片的编程命令字的设置。进一步了解每种芯片的基本的编程步骤及各种方式命令字的使用。.

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


5788924


5788924

  • 6

  • 825382558251A


5788924

  • 6.1 8253

  • CPU CPUCPU

    /CPU/ CPU


5788924

1.

2.


5788924

/

I/OCPU

CPU


5788924

  • 6118253

  • 18253

  • (1)316

  • (2)

  • (3)6

  • (4)2MH226MHz

  • (5)TTL

  • (6)+5V


5788924

CLOCK0

D7 ~D0

0

GATE0

OUT0

RD

1

/

WR

A1

A0

2

  • 28253


5788924

  • 16012

  • (1)8

  • CPU8253

  • CPU

  • CPU

  • (2)RDWRCSA1A08253

  • (3)8

  • (4)3012316


5788924

  • D7D0 188

  • CLK0 9 0OUT0 10 0

  • GATE0 11 0CLK1 15 1OUT1 13 1GATE2 14 1

  • CLK2 18 2OUT2 17 2GATE2 16 2CS 21

  • RD 22 CS=0 RD=0

  • WR 23 CS=0WR=0

  • A1A0 2019 A1A03


5788924

  • 6138253

  • 1

  • 825338253

  • GATECLK0OUTn()tTCK :

t

n=

TCK


5788924

  • 28253

  • (1)

  • D7D6(SC1SC0)2

  • D5D4(RW1RW0)

  • D3D1(M2M1M0)82536

  • D0(BCD)

  • (2)

  • (3)


5788924

D7

SC1

D6

SC0

D5

RW1

D4

RW0

D3

M2

D2

M1

D1

M0

D0

BCD

000

011

102

11

00:0

0

1BCD

00 0000

01/ 0011

10/ 102

11/ 113

/ 1004

  • 1015

  • 8253

01:1

10:2

11


5788924

  • 6.1.4 8253

  • 825363

  • (1)8253OUT

  • (2)100216BCD0104

  • (3)CLK(GATE)

  • 04

  • 15

  • 23

  • 0145

  • 23


5788924

  • 8253GATE

  • 0

  • 1 1.

  • 2.

  • 2 1.

  • 2.

  • 3 1.

  • 2.

  • 4

  • 5


5788924

  • 10()

  • OUT0OUT0OUTCPUCPU

n=4

CW

WR

CLK

GATE

4

3

2

1

OUT


5788924

CW

n=3

WR

  • 0GATEGATE

CLK

GATE

3

2

2

1

OUT


5788924

CW

n=3

n=5

WR

  • 21()

  • OUTGATE()OUT0OUTGATE

CLK

GATE

3

2

1

5

OUT


5788924

CW

n=3

WR

  • GATE()GATEOUT2

CLK

GATE

3

2

1

3

2

1

OUT


5788924

CW

n=3

WR

  • 32 ()

  • 2OUTGATECLKN(N1)CLKOUTlCLK0OUTOUTNCLKCLK

  • =NCLKT

CLK

GATE

3

2

1

3

2

1

OUT


5788924

CW

n=3

WR

CLK

  • GATGATEGATE

GATE

2

3

2

2

3

2

1

OUT

2CLKN

1/N


5788924

CW

n=4

WR

  • 43()

  • 3GATE N2OUTN2OUT

CLK

GATE

4

2

4

2

4

2

4

2

OUT


5788924

CW

n=5

WR

  • N

  • N+12OUTN-12OUT

CLK

GATE

4

2

0

4

2

4

2

0

OUT


5788924

CW

n=4

WR

  • 3GATEGATEOUT GATEOUT

CLK

GATE

4

2

4

2

2

2

4

2

4

2

OUT


5788924

CW

n=3

WR

  • 54()

  • 48253OUTGATE0GATE1GATE0

CLK

GATE

3

2

1

0

OUT

GATE


5788924

CW

n=4

WR

  • 65[)

  • 5OUTGATE10

CLK

GATE

3

2

1

0

3

OUT

GATE


5788924

CW

n=3

WR

  • GATEGATE

CLK

GATE

3

2

3

2

1

0

OUT


5788924

  • 6.1.5 8253

  • 8253

  • (1)

  • (2)8801688

  • 03200

  • 0 88 3

  • MOV AL36H AL

  • MOV DXCRLP DX

  • OUT DXAL

0

0

1

1

0

1

1

0

36H

CRLP


5788924

  • CPU2

  • (1)GATE

  • (2)8253D5D400) 8253

  • MOV AL00H O D5D400

  • MOV DXCRLP DX

  • OUT DXAL

  • IN ALPRT008

  • XCHG ALAH 8AH

  • IN ALPRT0

  • XCHG ALAH 8AL

  • 8AH

PRT0

0


5788924

  • 6.1.6 8253

  • 5s25MHz

  • 325M

  • Tckl25106

  • n=T/Tck=5(l25106 )=1.25107

  • 655360OUT01CLK1

  • 050000C350H1250FAH

  • =50000250=1.25 107

  • 0336H

  • 1254H

  • CRPT0PRT01PRT1


5788924

  • MOV AL36H

  • MOV DXCRPT

  • OUT DXAL 03

  • MOV AL50H

  • MOV DXPRT0

  • OUT DXAL 8

  • MOV ALC3H

  • OUT DXAL 8

  • MOV AL54H

  • MOV DXCRPT

  • OUT DXAL 12

  • MOV ALFAH

  • MOV DXPRT1

  • OUT DXAL 8

2.5MHZ

8253

CLK0

GATE0

+5V

OUT0

CLK1

GATE0

+5V

OUT0

5S


5788924

  • 6.2 8255A

  • 6.2.1

  • (CPU)CPU

  • CPUCPUCPU


5788924

CPU

RD

WR

M/IO

CS

A0

A1


5788924

  • 1

  • 2

  • 3

  • 4

  • 5CPU

  • 1

  • 2CPU

  • 3

  • 4

  • 5l


5788924

  • 6.2.2 8255A

  • 8255AIntelIO24212

  • TTL

  • 10

  • +5V

  • 8255A


5788924

CPU

A8

PA7-PA0

A

PC7-PC4

C

4

DB

8

C

4

PC3-PC0

RD

/

WR

B8

A0

B

A1

PB7-PB0

REST

CS

8253A


5788924

  • 1

  • AA88

  • BC88

  • 2AB

  • AAC4(PC4PC7)

  • BBC4(PC0PC3)

  • CPUAB

  • 3

  • CPUAlAO8255ACSRDWRAB


5788924

  • 8255A

  • CS RD WR A1A0

  • 0 0 1 00 A(A)

  • 0 1 0 00 A(A)

  • 0 0 1 01 B(B)

  • 0 1 0 01 B(B)

  • 0 0 1 10 C(C)

  • 0 1 0 10 C(C)

  • 0 1 0 11 D7l8255A

  • D7OC

  • 0 0 1 11

  • 0 1 1 ** D7D0

  • 1 * * **


5788924

  • 6.2.3 8255A

  • 8255A402

  • 1CPU

  • RESET8255A0

  • CS

  • RD

  • WR

  • A1A000A01B

  • 10C11

  • D7D08

  • 2

  • PA7PA0A

  • PB7PB0B

  • PC7PC0C


5788924

  • 6.2.4 8255A

  • 8255AC10

  • 11

  • 1

D7 D6 D5 D4 D3 D2 D1 D0

0 00

0 11

12

PA

1

0

PC7PC4

1

0

00

11

PB

1

0

PC3PC0

1

0

A

B


5788924

1

0

0

1

0

1

0

0

94H

  • 8255AABCA0Bl

  • 94H

  • A0 B1

  • A B

  • C C

  • MOV AL,94H AL

  • MOV DXPortctr PortctrDX

  • OUT DXAL 8255

Portctr


5788924

  • 2C10

  • 8255ACPUCAB

  • Cl0C01D70Cl0

  • D6D4D3D1C8Dol0

  • C

  • C000PC0 001PC11/0

  • 010PC2 011PC3 00

  • 0 100PC4 101PC5 11

  • 110PC6 111PC7

D7

D6

D5

D4

D3

D2

D1

D0

0


5788924

0 0 0 0 0 1 1 0

0 0 0 0 1 1 1 1

  • CPC30PC7l

  • 06H 0FH

  • MOV AL06H PC30AL

  • MOX DXPortCtr ; PortCtrDX

  • OUT DXAL PC3 0

  • MOV AL0FH PC71AL

  • OUT DXAL PC71

0

1

PC3

PC7


5788924

  • 6.2.5 8255A

  • 8255A30l2

  • A3

  • B01

  • CAB

  • 1.0

  • 02824


5788924

  • RDRD250ns

0

tRR

RD

tIR

tHR

tRA

CSA1A0

tAR

D7D0

tRD

tDF


5788924

  • WRWR20ns

  • WR400ns

  • 100ns30ns

tWW

WR

D7D0

CSA1A0

0


5788924

  • 21

  • ABC

  • 12(AB)814

  • 8

  • 48

  • (1)

  • :PC3PC5APC0PC2BC2PC6PC7D3lD30


5788924

1

0

1

1

1/0

1

1

1

  • A1 B1

PC7PC6

1

1

10

B

A

8

PB7PB0

8

PA7PA0

INTE

A

INTE

B

PC4

STBA

PC2

STBB

PC5

PC1

IBFA

IBFB

PC3

INTRA

PC0

INTRB

PC6PC7

RD

RD

I/O

1CAB


5788924

1

STB

  • STB

  • 500ns

  • STB

  • 300ns

  • IBF

  • STB

  • 300nsCPUINTR

  • CPURDCPU()400ns

  • IBF

IBF

INTR

RD


5788924

  • l

  • STBA

  • PC4 BPC2500ns

  • IBFAPC5BPC1STB300nsRD300nsIBF

  • INTRAPC3BPC0STB300nsIBF

  • INTEINTEC10


5788924

  • (2)

  • 1

  • PC3PC6PC7APC2PC1PC 0BPC4PC5D31PC4PC5D30PC4PC5

1

0

1

0

1/0

1

1

0

1

B

1

A

PA7PA0

PB7PB0

INTEA

INTEB

PC6

ACKA

PC2

ACKB

PC7

OBFA

PC1

OBFB

PC3

INTRA

PC0

INTRB

WR

PC4PC5

WR


5788924

WR

OBF

  • 8255A1

  • 8255A1

  • CPU

    8255A

    WR850ns

    WR

    INTR

    OBF

    ACKOBF

    ACKINTRCPU

    OBFINTR

    ACKINTE

INTR

ACK


5788924

  • 32

  • 2A8(A)15(C)

INTRA

1

1

PC3

PA7PA0

A

B

PC2PC0

PC7

OBFA

2

10

INTE1

PC6

ACKA

2

STB

IBF

OBF

INTR

ACK

INTEI

PC4

STBA

WR

INTE2

PC5

IBFA

RD

PC3PC0

I/O

3


5788924

  • 6.2.5 8255A

  • A81C3BUSYSTBACK

  • STBBUSYACKBUSYSTB

D7D0

PA7PA0

D7D0

REST PC4

BUSY

IOR

RD PC6

ACK

IOW

WR ACK

AEN

DATASTB

CS PC7

OBF

A0

A1 8255A


5788924

  • APRACPRCPORC500

  • MOV AL 08AH A1PC4

  • MOV DX PORC DX

  • OUT DX AL

  • MOV CX 500 500

  • MOV DI BUF

    LOP1MOV AL [DI]

    MOV DX PRA ADX

    OUT DX AL A

    MOV DX PRC CDX

    NEXT IN AL DX C

    TEST AL 10H BUSY

    JNZ NEXT

    INC DI 1

    LOOP LOP1


5788924

D7D0

D7D0

ACK

DATASTB

PA7PA0

REST PC6

  • CFUPC4PC4OBFPC3INTRACKIRQ3OBH

ACK

IOR

RD

IOW

WR

PC4

CS

8255A

A0

PC3

INTR CPU

A1

INTR


5788924

A1

PC4

1 0 1 0 0 0 0 0

0AH

1 PC4

  • MOV AL , 0A0H

  • MOV DX , PROC

  • OUT DX , AL

  • MOV AL 09H PC41DATASTB1

  • CLI

  • MOV AH 35H

  • MOV AL OBH

  • INT 21H

  • PUSH ES

  • PUSH BX

  • PUSH DS

  • MOV DX OFFSET INTSERV

  • MOV AX SEG INTSERV

  • MOV DS AX

  • MOV AL 0BH

  • MOV AH 25H

  • INT 21H

09H

0 0 0 0 1 0 0 1

0BH

PC4

0

0BH

INTSERV

OFFSET INSERV

SEG INSERV

25HDOS

0BH


5788924

0 0 0 0 1 1 0 1

0DH

PC6=1

INTE1

C1/0

1

PC6

  • POP DS

  • MOV AL 0DH

  • MOV DX PROC

  • OUT DX AL

  • STI

  • CLI

  • POP DX ESBXDSDX

  • POP DS

  • MOV AL 0BH

  • MOV AH 25H

  • INT 21H 0BH

  • STI


5788924

  • INSERV

  • PUSHAD

  • MOV AL CL AL

  • MOV DX PORTA

  • OUT DX AL A

  • MOV AL 00H

  • MOV DX PORTCTR

  • OUT DX AL PC4=0

  • DATASTB

  • INC AL

  • OUT DX AL PC41

  • MOV DX 20H

  • OUT DX 20H EOI

  • POPAD

  • IRET


5788924

  • 63 8251A

    6.3.1

  • nTnT

RXRDY

TXRDY

CPU

RD

WR

M/IO

CS

C/D


5788924

  • :

  • :

  • 1

  • (1)10

816

32

816

32

1

1

CPU

CPU


5788924

  • 2 .DTEDCE

  • DTE:

  • DCEDCE

  • 2DTE

DTE

DTE

DCE

DCE


5788924

  • 2.

A

B

A

B

A

B


5788924

  • 3

  • :12()58


5788924

7

  • 058111.521

0

0

1/0

1/0

1/0

1/0

1/0

1/0

1/0

1/0

1 1 1 1

1/0

1/0


5788924

12

58

0

58 1

11.52

1

  • 4

  • (1)

  • (2)

  • bit/s

  • 1

  • (n1163264)n

n


5788924

  • 5

  • (modem)

  • (modom)

  • 10

1 0 1 0

1 0 1 0 1 1 0

1 01 01 1 0

MODEM

MODEM


5788924

  • 6.3.2 8251A

  • 18251A

  • 8251A

  • (1)0 64k 0 19.2k

  • (2)5 8

  • (3)5 81l16648251A11152

  • (4)


5788924

  • 8251A


5788924

  • 8251A

CS RD WR C/D

0 0 1 0 CPU8251A

0 1 0 0 CPU8251A

0 0 1 1 CPU8251A

0 1 0 1 CPU8251A


5788924

  • 6.3.3 8251A

  • 18251ACPU

  • (1)D7D0

  • (2)CS,

  • (3)

  • RD

  • WR

  • C/D

  • RESET

  • CLK


5788924

(4)

TXRDY

TxRDY CTS TSEN

TxEMPTY

TXC8251A

(5)

RxRDY

SYNDETBRKDET()

SYNDET

BRKDET80

RXC8251A


5788924

28251A

2

(1)

TxD()

RxD()

(2)

RTS()CPU8251A

CTS()8251A

(3)

DTR()CPU8251A

DSR()


5788924

D7D0

BB

D7D0

RS-232C

TXD

BA

IOR

RD

AB

RXD

WR

IOW

CD

DTR

A0

C/D

CC

DSR

CB

AEN

CTS

CA

RTS

8251A

TXC

RXC

8251A


5788924

D7D0

BB

D7D0

RS-232C

TXD

BA

IOR

RD

AB

RXD

WR

IOW

CD

DTR

A0

C/D

CC

DSR

CB

AEN

CTS

CA

RTS

DB

8251A

TXC

RXC

8251A


5788924

  • 6.3.5 8251A

  • 1

  • 200

  • 20

  • 2

  • 8251A

  • 3

  • 8251ACPUIN


5788924

8251A

D7

SCS

D6

ESD

D5

EP

D4

PEN

D3

L2

D2

L1

D1

0

D0

0

0211

0

0 0

1 1

0SYNDET

1SYNDET

005 016

107 118

  • 8 2

  • 7CH(01111100B7CH)


5788924

8251A

D7

S2

D6

S1

D5

EP

D4

PEN

D3

L2

D2

L1

D1

B2

D0

B1

00

011

1016

1164

0001 110 1 11 2

01

01

005 016

107 118

8251A648

20DFH

(11011111B0DFH)


5788924

8251A

D7

EH

D6

IR

D5

RTS

D4

ER

D3

SBRK

D2

RXEN

D1

DTR

D0

TXEN

1RTS0

1TXD0

1DTR0

1

1

8251A

1

PEOEFE

1

0

1

0


5788924

D7

DSR

D6

S/BDET

D5

FE

D4

OE

D3

PE

D2

TXEMP

D1

RXRDY

D0

TXRDY

  • 8251A

1

1

1

1

SYNDE/

BRKDET

1

1

1


5788924

Y

  • 6.3.6 8251A

  • 8251A

  • 1

  • 2

  • 8

  • 01011100B5CH

  • 10010111BB7H

  • A5H

  • 27H(2

N

Y

N

Y

N

Y


5788924

  • 40H8251APortE

  • MOV AL 40H

  • OUT PortE AL

  • MOV AL 5CH

  • OUT PortE AL

  • MOV AL 0A5H

  • OUT PortE AL

  • MOV AL 0E7H

  • OUT PortE AL

  • MOX AL 0B7H

  • OUT PortE AL

40HPortE

8251A


5788924

  • 2

  • 168l0101110B5DH50RxRDY8251ADlRxRDY1CPUCPURxRDY0RxRDYD3(PE)D4(OE)D5(FE)


5788924

MOV AL 40H

OUT PORTE AL 8251A

MOV AL 5DH

OUT PORTE AL

MOV AL 37H

OUT PORTE AL

MOV DI 0

MOV CX 32H

INPUTIN AL PORTE

TEST AL 02H RXRDY

JZ INPUT

IN AL PORTO RXRDY

LEA DX BUFFER DX

MOV [DX+DI] AL

INC DI


5788924

  • IN AL PORTE

  • TEST AL 38H

  • JNZ ERROR

  • LOOP INPUT 50INPUT

  • JMP EXIT 50

  • ERROR

  • EXIT


  • Login