6 mcs 51
Download
1 / 44

6 MCS-51 - PowerPoint PPT Presentation


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

. ????:??????????????????,??????????? 6.1 MCS-51??????????? ??:????????????????????????,????????????? ?????:????????????????????????????????????????????? 6.1.1 ?? ?????????:???????? 1.??????? ??????,?????I/O???,CPU??????I/O???/???????????????????,?????,????;????I/O???? ????:?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha

Download Presentation

6 MCS-51

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


6 mcs 51 l.jpg

MCS-51

6MCS-51


Slide2 l.jpg

:

6.1 MCS-51

6.1.1

1

I/OCPUI/O/I/O


Slide3 l.jpg

2.

,/,CPU()I/O,(),I/O,


Slide4 l.jpg

44

3.


Slide5 l.jpg

6.1.2

11020ms

2

3

4

6.1.3

1//


Slide6 l.jpg

2//CPU

1

X0X3+5V

CPU CPU

CPU


Slide7 l.jpg

2

1

2

3

4

5CPU

3

1

I/O

[]MCS-51 8

MCS-5188MCS-51P18I/OP1.0P1.7


Slide8 l.jpg

P1.0P1.7I/O

P18I/O74LS30174LS04MCS-51 20 ms


Slide9 l.jpg

ORG 0000H

LJMP MAIN

ORG 0003H; 0

LJMP INT;

ORG 0100H

MAIN: SETB EA;

SETB EX0; INT0

SETB IT0;

INT: LCALL D20ms ;

MOV P1, #0FFH; P11

MOV A, P1; P1

CJNE A, #0FFHCLOSE;

AJMP OUT;


Slide10 l.jpg

CLOSE: JNB ACC.7, KEY 7; 7

JNB ACC.6, KEY 6; 6

JNB ACC.5, KEY5; 5

JNB ACC.4, KEY4; 4

JNB ACC.3, KEY 3; 3

JNB ACC.2, KEY 2; 2

JNB ACC.1, KEY 1; 1

JNB ACC.0KEY 0; 0

OUT:RETI

KEY 7:; 7

KEY 71:MOV A, P1; P1

JNB ACC.7, FUNC71;

RETI

KEY 6:;

D20ms: ; 20ms

END


Slide11 l.jpg
2

I/O

11

2,,

3

[]805144

44P24P1474LS218051


Slide12 l.jpg

1KEYR

KEYR00A KEYR003R3


Slide13 l.jpg

KEYR

KEYR:CJNE A, #0FEH, TESTP11; P1.0

MOV R3, #0 ; P1.0=0P1.0

LJMP FINISH;

TESTP11:CJNE A, #0FDH, TESTP12 ; P1.1

MOV R3, #1

LJMP FINISH

TESTP12:CJNE A, #0FBH, TESTP13 ; P1.2

MOV R3, #2

LJMP FINISH

TESTP13:CJNE A, #0F7H, FINISH; P1.3

MOV R3, #3

FINISH:RET


Slide14 l.jpg

2

ORG 1000H

INT11: LCALL DELAY;

MOV A, P1;

ANL A, #0FH;

CJNE A, #0FH, TEST;

RETI;

TEST: MOV B, A;

LCALL KEYR;

MOV 40H, R3; 40H

MOV P2, #0FFH; 1

MOV P1, B;

MOV A, P2;

LCALL KEYR;

XCH A, R3

SWAP A

ORL 40H, A;

RETI


Slide15 l.jpg

40H40H4440H

3DELAY

CPUT1 T16MHz20ms

216TC6/12=20103sTC=25536=63C0H

DELAY:MOV TOMD, #11H; 1

MOV TL1, #0C0H; 1

MOV TH1, #63H

SETB EA;

SETB ET1; 1

SETB PT1; 1

SETB TR1;

ORL PCON#1; CPU

CLR TR1 ;

CLR PT1

CLR ET1

RET

END


Slide16 l.jpg
3

1000

[]81554832

8155PAPC3PC08155MCS-51PA7F01HPC7F03H


Slide17 l.jpg

PC0, PC1, PC2, PC3800H +00H07H08H +00H07H10H +00H07H18H +00H07H00H07HR4


Slide18 l.jpg

1KEY1A

ORG 1000H

KEY1:MOV DPTR, #7F01H ; PADPTRPA

MOV A, #00H;

MOVX @DPTR, A; PA00H

INC DPTR

INC DPTR; PC

MOVX A, @DPTR ;

CPLA;

ANL A, #0FH; A

RET;

2KEY DELAY1


Slide19 l.jpg

KEY:ACALL KEY1;

JNZ LKEY1; A0

ACALL DELAY1; 6 ms

AJMP KEY

LKEY1:ACALL DELAY1

ACALL DELAY1; 26ms=12ms

ACALL KEY1;

JNZ LKEY2; LKEY2

ACALL DELAY1;

AJMP KEY; 6msKEY

LKEY2:MOV R2, #0FEH; R2PA0

MOV R4, #00H; R4

LKEY4:MOV DPTR, #7F01H; PA

MOV A, R2

MOVX @DPTR, A; PA

INC DPTR

INC DPTR; PC

MOV A, @DPTR;

JB ACC.0, LONE ; ACC.0=10LONE

MOV A, #00H; 0

AJMP LKEYP;

LONE:JB ACC.1, LTWO; ACC.1=11LTWO


Slide20 l.jpg

MOV A, #08H; 1

AJMP LKEYP;

LTWO:JB ACC.2, LTHR; ACC.2=12LTHR

MOV A, #10H; 2

AJMP LKEYP

LTHR:JB ACC.3, NEXT; ACC.3=13NEXT

MOV A, #18H; 3

LKEYP:ADD A, R4 ;

PUSH ACC ;

LKEY3:ACALL DELAY1; 6ms

ACALL KEY1;

JNZ LKEY3

POP ACC; A

RET

NEXT:INC R4; 1

MOV A, R2

JNB ACC.7, KND; 70KND

RL A;

MOV R2, A

AJMP LKEY4;

KND: AJMP KEY;

DELAY1: ;

END


Slide21 l.jpg
4

MCS-51/74LS164

[]MCS-51/28015

/


Slide22 l.jpg

P1.0P1.1 P1.0800H+00H07HP1.1808H+00H07H00H07HR4

DLY1

ORG 1000H

SERKEY:MOV SCON, #00H;

MOV A, #00H ; 00H

LCALL VARTO ;

CHK:JNB P1.0, CHK0;

JNB P1.1, CHK0;

AJMP CHK;

CHK0:LCALL DLY1; 10ms

JNB P1.0, CHEN; CHEN

JNB P1.1, CHEN

AJMP CHK;

CHEN:MOV R2, #0FEH; R20

MOV R4, #00H ; R4


Slide23 l.jpg

CHKN:MOV A, R2;

LCALL VARTO

JB P1.0, CH1; P1.0CH1

MOV A, #0; A00H+R4

AJMP CKEY;

CH1:JB P1.1, NEXT; P1.1NEXT

MOV A, #8H; A

CKEY:ADD A, R4;

RET

NEXT:INC R4;

MOV A, R2;

JNB ACC.7KEND; 8

RL A; 8

MOV R2, A; R2

AJMP CHKN; 8

KEND:AJMP SERKEY; 8

VARTO:MOV SBUF, A; A

JNB TI, $;

CLR TI;

RET

DLY1: ; 10ms

END;


6 2 mcs 51 l.jpg
6.2 MCS-51

6.2.1 LED

LEDLight Emitting DiodeLED 8

1LED

LED


Slide25 l.jpg

agdp

LEDLED(0),(0)


Slide26 l.jpg

LED


Slide27 l.jpg

2LED

LEDmn


Slide28 l.jpg

3. LED

LEDLED1.82.2VLEDRLEDLEDLED1mA50mALED


4 led l.jpg
4LED

LED

1

I/OI/OCPUCPUCPU

[]80518255A3LED

8255A80518255APA, PB, PC3

8255APA, PB, PCI/ORAM 40H42HBCD


Slide30 l.jpg

ORG 1000H

DSP8255: MOV DPTR, #7FFFH

MOV A, #80H; 8255A

MOVX @DPTR, A; 8255A


Slide31 l.jpg

MOV R0, #40H ;

MOV R3, #03H;

MOV DPTR, #7FFCH; PA

LOOP :MOV A, @R0;

ADD A, #06H ; TAB 6

MOVC A, @A+PC;

MOVX @DPTR, A; 8255A

INC R0;

INC DPTR;

DJNZ R3, LOOP;

RET

TAB:DB 0C0H, 0F9H, 0A4H, 0B0H; 0, 1, 2, 3

DB 99H, 92H, 82H, 0F8H; 4, 5, 6, 7

DB 80H, 90H, 88H, 83H; 8, 9, A, b

DB 0C6H, 0A1H, 86H, 8EH ; C, d, E, F

END


Slide32 l.jpg
2

I/OI/OCPU

[]68155RAM 79H7EH

8155PAPB PA7F01HPC7F03HPA61ULN2803 6


Slide33 l.jpg

ORG 1000H

DSP8155:MOV DPTR, #7F00H;8155

MOV A, #00000011B; PAPB

MOVX @DPTR, A;

DISP1:MOV R0, #7EH;

MOV A, #20H; PA51


Slide34 l.jpg

LOOP: MOV R2, A;

MOV DPTR, #7F01H; 8155PA

MOVX @DPTR, A;

MOV A, @R0;

MOV DPTR, #PTRN;

MOVC A, @A+DPTR;

MOV DPTR, #7F02H; 8155PB

MOVX @DPTR, A;

CALL D1MS; 1ms

DEC R0;

MOV A, R2;

CLR C;

RRC A;

JC PASS;

AJMP LOOP ;

PASS: RET ;

D1MS: MOV R7, #02H; 1ms

DMS: MOV R6, #0FFH

DJNZ R6, $

DJNZ R7, DMS

RET

PTRN: DB 0C0H, 0F9H, 0A4H, 0B0H, 99H ;

DB

DB

END


6 2 2 lcd l.jpg
6.2.2 LCD

LCDLiquid Crystal Diodes

1LCD

LCDLEDa, b, c, d, e, f, gBPCOM

LCDLCDA


2 lcd l.jpg
2LCD

LCDLCDLCDLCD4 V5 V

3LCDLCM Liquid Crystal Display Module

LCDLCDLCDLCM

LCMLCD LCMRAMASCII


Slide37 l.jpg

LCDLCMLCDLCDLCD


6 3 mcs 51 l.jpg
6.3 MCS-51

6.3.1 8155

1

815532PC48LED8155 PBPAPAPC0PC38155RAM7E00H7EFFHI/O7F00H7F05H81558255A

2

8155DSP8155


Slide40 l.jpg

ORG 1000H

KD1:MOV A, #0000 0011B; 8155PAPBPC

MOV DPTR, #7F00H

MOVX @DPTR, A

KEY1:ACALL KS1;

JNZ LK1; LK1

ACALL DSP8155; 81556ms

AJMP KEY1

LK1:ACALL DSP8155

ACALL DSP8155; 12ms

ACALL KS1

JNZ LK2

ACALL DSP8155; 81556ms

AJMP KEY1

LK2:MOV R2, #0FEH

MOV R4, #00H

LK3:MOV DPTR, #7F01H

MOV A, R2

MOVX @DPTR, A

INC DPTR

INC DPTR

MOVX A, @DPTR

JB ACC.0, LONE

MOV A, #00H

AJMP LKP


Slide41 l.jpg

LONE:JB ACC.1, LTWO

MOV A, #08H

AJMP LKP

LTWO:JB ACC.2, LTHR

MOV A, #10H

AJMP LKP

LTHR:JB ACC.3, NEXT

MOV A, #18H

LKP:ADD A, R4

PUSH ACC

LK4:ACALL DSP8155

ACALL KS1

JNZ LK4

POP ACC

NEXT:INC R4

MOV A, R2

JNB ACC.7, KND

RL A

MOV R2, A

AJMP LK3

KND:AJMP KEY1

KS1:MOV DPTR, #7F01H

MOV A, #00H

MOVX @DPTR, A

INC DPTR

INC DPTR


Slide42 l.jpg

MOVX A, @DPTR

CPL A

ANL A, #0FH

RET

END

6.3.3

Intel827964 16LED

7279


6 4 mcs 51 l.jpg
6.4 MCS-51

TPP-16A/40ALASER-PP40

6.4.1

1LASER PP40

LASER PP40

2. TPP-16A/40A

TPP-16A/40ATPP-40ATPP-16ATPP-1616TPP-40A4057240


Slide44 l.jpg

3. TPP-40A

2KBCentironic

ASCII128

234

0255


ad
  • Login