微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 基于51单片机的超声波测距仪LED显示电路的设计

基于51单片机的超声波测距仪LED显示电路的设计

时间:11-29 来源:互联网 点击:

MOV R7,A

MOV R6,A

MOV R5,A

MOV R4,A

MOV 46H,#10H

MULLOOP1:CLR C

MOV A,R4

RLC A

MOV R4,A

MOV A,R5

RLC A

MOV R5,A

MOV A,R6

RLC A

MOV R6,A

MOV A,R7

RLC A

MOV R7,A

MOV A,R0

RLC A

MOV R0,A

MOV A,R1

RLC A

MOV R1,A

JNC MULLOOP2

MOV A,R4

ADD A,R2

MOV R4,A

MOV A,R5

ADDC A,R3

MOV R5,A

MOV A,R6

ADDC A,#00H

MOV R6,A

MOV A,R7

ADDC A,#00H

MOV R7,A

MULLOOP2:DJNZ 46H,MULLOOP1

RET

div4BY2:MOV 46H,#20H

MOV R0,#00H

MOV R1,#00H

divLOOP1:MOV A,R4

RLC A

MOV R4,A

MOV A,R5

RLC A

MOV R5,A

MOV A,R6

RLC A

MOV R6,A

MOV A,R7

RLC A

MOV R7,A

MOV A,R0

RLC A

MOV R0,A

MOV A,R1

RLC A

MOV R1,A

CLR C

MOV A,R0

SUBB A,R3

JC divLOOP2

MOV R0,B

MOV R1,A

divLOOP2:CPL C

DJNZ 46H,divLOOP1

MOV A,R4

RLC A

MOV R4,A

MOV A,R5

RLC A

MOV R5,A

MOV A,R6

RLC A

MOV R6,A

MOV A,R7

RLC A

MOV R7,A

RET

END PIXTEL_MMI_EBOOK_2005>9 /PIXTEL_MMI_EBOOK_2005>

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top