MCS - 51 单片机的硬件结构

  • View
    85

  • Download
    3

Embed Size (px)

DESCRIPTION

I/O 接口. 中断系统. 定时 / 计数器. CPU. 存储器. MCS - 51 单片机的硬件结构. 硬 件 结 构. 内部 ROM. B. 暂存器 1. 暂存器 2. ACC. 程序地址寄存器. 控制信号. ALU. 缓冲器. 微操作控制电路. PSW. +1. PC. 指令寄存器. 时序电路. 指令译码器. DPTR. Ⅰ CPU. 存储器. ROM. 片内 ROM. 片外 ROM. 片内 RAM. 片外 RAM. RAM. MCS - 51 单片机的硬件结构( 2 ). Ⅱ 存储器. FFH. - PowerPoint PPT Presentation

Text of MCS - 51 单片机的硬件结构

  • MCS51

  • CPU

  • MCS512

  • MCS51280HFFH20HRAMSFR80H-FFH92SFR)RAM

  • MCS512 ROM80518052

  • MCS512 RAM80518052

  • MCS512 00H20H2FH7FH1FH128RAM00H20H2FH7FH1FH30HRAM25680HFFHRAM80518052

  • MCS512FFFFH0000HFFFFH0000H

  • MCS512FFFFH0000H 64K

  • MCS512FFFFH0000H 64K,

  • MCS512FFFFH0000H 64K16A0A158D0D7PSENALEEA0PCROM

  • MCS512FFFFH0000HRAM 64K16A0A158D0D7WRRDALEDPTRRAM

  • MCS512

  • MCS512 CPU

  • MCS512

  • MCS512 MCS-5148I/OP0P1P2P3P08LSTTLP1P2P34LSTTL

  • MCS512 P0.0P0.7: I/O 888I/O21DQCK/Q/P0.X34VccP0

  • MCS51221DQCK/Q =1/P0.X34=0 100100=0Vcc P0.0P0.7: I/O 888I/O

  • MCS51221DQCK/Q/P0.X34=0 00100=0Vcc P0.0P0.7: I/O 888I/OVcc

  • MCS51221DQCK/Q =0/=1P0.X34=1/1/ =0 1011=0=0Vcc P0.0P0.7: I/O 888I/O

  • MCS51221DQCK/Q =0/=1P0.X34=1/2/ =1 1100=1=1Vcc P0.0P0.7: I/O 888I/O

  • MCS51221DQCK/Q =1/=1P0.X34=1/ 3Vcc P0.0P0.7: I/O 888I/O

  • MCS512 P1.0P1.7: I/O 121DQCK/QVccP1.XP1

  • MCS51221DQCK/QVccP1.X = 1 110=1 P1.0P1.7: I/O 1

  • MCS51221DQCK/QVccP1.X = 0 001=0 P1.0P1.7: I/O 1

  • MCS51221DQCK/Q =1VccP1.X1110 P1.0P1.7: I/O 1

  • MCS512 P2.0P2.7: I/O 88I/O21DQCK/Q8 P2.X3VccP2

  • MCS51221DQCK/Q =08 P2.X=0 =1110311Vcc=1=0 P2.0P2.7: I/O 88I/O

  • MCS51221DQCK/Q =08 P2.X=0=0001300Vcc=0=0 P2.0P2.7: I/O 88I/O

  • MCS51221DQCK/Q =08=1 P2.X=1 8A8A15 =1 1031=1Vcc=1 P2.0P2.7: I/O 88I/O

  • MCS51221DQCK/Q =08=1 P2.X0130=0Vcc=0=1 8A8A15 =0 P2.0P2.7: I/O 88I/O

  • MCS512 P3.0P3.7: I/O21DQCK/Q P3.X3Vcc4P3

  • MCS51221DQCK/QWRRDTxD P3.X3Vcc4 D=1111 P3.0P3.7: I/O

  • MCS51221DQCK/Q1 P3.X3Vcc RxDT0T1INT0INT144 1110 P3.0P3.7: I/O

  • MCS512P3P.26 23

    P3.0RxD: P3.1TxD: P3.2INT0: 0P3.3INT1: 1P3.4T0: 0P3.5T1: 1P3.6WR: P3.7RD:

  • MCS512

  • MCS512 50

  • 89017891011

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    1

    0/1

    0/1

    0/1

    0/1

    7(8)

    7(8)

    0

    1

    0

    n

    (n-1)

    (n+1)

  • 1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    0/1

    1

    1

    1

    0/1

    7(8)

    0

    0

    n

    (n+1)

  • CPU Baud rate

  • ABAB ABBAK AB

    (b)

    (a)

    (c)

    A

    B

    A

    B

    A

    B

    K

    K

  • MCS-51 (UART) 51USBI2CCANSPIRS-485RS-232CRS422A

  • MCS-51

  • SM0 SM1 SM2 REN TB8 RB8 TI R1SCON SM0SM14 0 0 08I/O, fosc/12 0 1 18UART1+8+1 , 1 0 29UART1+8+1+1 =fosc x1/321/64 1 1 39UART1+8+1+1 SM2 23SCON

  • RI,TI/ 1 0 TB8239 ,TB8=0 TB8=1 RB8239 ,/ SM0 SM1 SM2 REN TB8 RB8 TI R1 REN = 1 = 0 SCON

  • 08I/OSBUFRxD TxD=fosc1/12 8 TI1 TI RxDSBUF TxD=fosc1/12 8RI1 RI

  • 00I/OABCLKh g f e d c b aABCLKABCLKCLR+5V74LS16474LS16474LS16474LS164h g f e d c b ah g f e d c b a+5VLED VCCTxDRxD51

  • /8 D00 D711 1:8UART(1+8+1)() T1 =2SMOD/32T1

  • =(2SMOD/32)T1 T1 T1 X = 2n - 2SMOD fosc32 12 =2SMOD fosc32 12(2n - X)X

  • RxDTxD, T1,0/ TxD T1: 2(TMOD8); ()XTH1,TL1; T1 (SETB TR1); T1 !!1/: SCON PCONSMOD(=0) , 1REN

  • , 8+1 (TB8/RB8) 2: 9UART(1+8+1+1) 2 = fosc 2SMOD/64 : fosc 1/32 fosc 1/64 SFRSCON

  • 81 1 81 1

  • 91 8 91 81 1 81 0

  • A 1P=1 TB81 P=0TB8=0 P=0,RB8=0 P=1,RB8=1 P=0RB8=1P=1RB8=02 SM0 SM1 SM2 REN TB8 RB8 TI RISCONSCONTB8 RB8

  • 3:9UART(1+8+1+1) 32232643 =2SMOD fosc32 12(2n - X)X

  • SBUF/SFR SCON PCON TMOD TH1,TL11 TCON/8

  • MOV SBUFA , SBUF MOV ASBUF ,SBUF SBUF//8

  • SM0 SM1 SM2 REN TB8 RB8 TI R1SCON SM0SM14 0 0 08I/O, fosc/12 0 1 18UART1+8+1 , 1 0 29UART1+8+1+1 =fosc x1/321/64 1 1 39UART1+8+1+1 SM2 23SCON

  • RI,TI/ 1 0 TB8,TB8=0 TB8=1 23 9 RB8,/ 239 SM0 SM1 SM2 REN TB8 RB8 TI R1 REN = 1 = 0 SCONSCON

  • SMOD GF1 GF0 PD 1DL PCON97HPCON SMOD 123 =1 =0 (PCON) PCON

  • MCS51 P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7RST(RXD)P3.0(TXD)P3.1(INT0)P3.2(INT1)P3.3(T0)P3.4(T1)P3.5(WR)P3.6(RD)P3.7XTAL2XTAL1GNDP0.0(AD0)P0.1(AD1)P0.2(AD2)P0.3(AD3)P0.4(AD4)P0.5(AD5)P0.6(AD6)P0.7(AD7)VCCEA/VPPALE/PROGPSENP2.7(A15)P2.6(A14)P2.5(A13)P2.4(A12)P2.3(A11)P2.2(A10)P2.1(A9)P2.0(A8)VCCGND VCC(40):GND(20):XTAL1XTAL2 XTAL1(19):XTAL2(18): RST(9):ALE/PROG(30):PSEN(29):EA/Vpp(31):I/O(P0,P1,P2,P3)AT89C51

Search related