at89c51单片机和4位共阴数码管从左到右依次显示1234,然后又依次显示5678,仿真图怎么画
1个回答
关注
展开全部
亲亲您好,很高兴为您解答。亲亲您好,at89c51单片机和4位共阴数码管从左到右依次显示1234,代码您可以按照以下步骤进行操作:首先是MOV 31H,#01H MOV 32H,#02H MOV 33H,#03H MOV 34H,#04H MOV 35H,#05H MOV 36H,#06H ACALL D0 JMP $-2D0: MOV R0,#31H MOV R2,#11111110B MOV DPTR,#TABD1: ORL P1,#00111111B MOV A,@R0 MOVC A,@A+DPTR MOV R3,#8D2: RLC A MOV P3.2,C SETB P3.3 CLR P3.3 DJNZ R3,D2 INC R0 MOV A,R2 ANL P1,AD3: MOV R3,#250 DJNZ R3,$ MOV A,R2 RL A MOV R2,A JB ACC.6,D1 RETTAB: DB 3FH,06H,5BH,4FH DB 66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH DB 39H,5EH,79H,71H DB 40H END
咨询记录 · 回答于2022-09-24
at89c51单片机和4位共阴数码管从左到右依次显示1234,然后又依次显示5678,仿真图怎么画,代码又怎么写啊[泣不成声]
亲亲您好,很高兴为您解答。亲亲您好,at89c51单片机和4位共阴数码管从左到右依次显示1234,代码您可以按照以下步骤进行操作:首先是MOV 31H,#01H MOV 32H,#02H MOV 33H,#03H MOV 34H,#04H MOV 35H,#05H MOV 36H,#06H ACALL D0 JMP $-2D0: MOV R0,#31H MOV R2,#11111110B MOV DPTR,#TABD1: ORL P1,#00111111B MOV A,@R0 MOVC A,@A+DPTR MOV R3,#8D2: RLC A MOV P3.2,C SETB P3.3 CLR P3.3 DJNZ R3,D2 INC R0 MOV A,R2 ANL P1,AD3: MOV R3,#250 DJNZ R3,$ MOV A,R2 RL A MOV R2,A JB ACC.6,D1 RETTAB: DB 3FH,06H,5BH,4FH DB 66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH DB 39H,5EH,79H,71H DB 40H END