基于单片机的数字时钟设计方案
3个回答
展开全部
数字钟〔★〕这里用了两种编写方法(即汇编语言与C语言)
(1. 开机时,显示12:00:00的时间开始计时;
(2. P0.0/AD0控制“秒”的调整,每按一次加1秒;
(3. P0.1/AD1控制“分”的调整,每按一次加1分;
(4. P0.2/AD2控制“时”的调整,每按一次加1个小时;
2. 电路原理图
3. 系统板上硬件连线
(1. 把“单片机系统”区域中的P1.0-P1.7端口用8芯排线连接到“动态数码显示”区域中的A-H端口上;
(2. 把“单片机系统:区域中的P3.0-P3.7端口用8芯排线连接到“动态数码显示”区域中的S1-S8端口上;
(3. 把“单片机系统”区域中的P0.0/AD0、P0.1/AD1、P0.2/AD2端口分别用导线连接到“独立式键盘”区域中的SP3、SP2、SP1端口上;
4. 相关基本知识
(1. 动态数码显示的方法
(2. 独立式按键识别过程
(3. “时”,“分”,“秒”数据送出显示处理方法
5. 程序框图
6. 汇编源程序
SECOND EQU 30H
MINITE EQU 31H
HOUR EQU 32H
HOURK BIT P0.0
MINITEK BIT P0.1
SECONDK BIT P0.2
DISPBUF EQU 40H
DISPBIT EQU 48H
T2SCNTA EQU 49H
T2SCNTB EQU 4AH
TEMP EQU 4BH
ORG 00H
LJMP START
ORG 0BH
LJMP INT_T0
START: MOV SECOND,#00H
MOV MINITE,#00H
MOV HOUR,#12
MOV DISPBIT,#00H
MOV T2SCNTA,#00H
MOV T2SCNTB,#00H
MOV TEMP,#0FEH
LCALL DISP
MOV TMOD,#01H
MOV TH0,#(65536-2000) / 256
MOV TL0,#(65536-2000) MOD 256
SETB TR0
SETB ET0
SETB EA
WT: JB SECONDK,NK1
LCALL DELY10MS
JB SECONDK,NK1
INC SECOND
MOV A,SECOND
CJNE A,#60,NS60
MOV SECOND,#00H
NS60: LCALL DISP
JNB SECONDK,$
NK1: JB MINITEK,NK2
LCALL DELY10MS
JB MINITEK,NK2
INC MINITE
MOV A,MINITE
CJNE A,#60,NM60
MOV MINITE,#00H
NM60: LCALL DISP
JNB MINITEK,$
NK2: JB HOURK,NK3
LCALL DELY10MS
JB HOURK,NK3
INC HOUR
MOV A,HOUR
CJNE A,#24,NH24
MOV HOUR,#00H
NH24: LCALL DISP
JNB HOURK,$
NK3: LJMP WT
DELY10MS:
MOV R6,#10
D1: MOV R7,#248
DJNZ R7,$
DJNZ R6,D1
RET
DISP:
MOV A,#DISPBUF
ADD A,#8
DEC A
MOV R1,A
MOV A,HOUR
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
MOV A,#10
MOV @R1,A
DEC R1
MOV A,MINITE
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
MOV A,#10
MOV @R1,A
DEC R1
MOV A,SECOND
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
RET
INT_T0:
MOV TH0,#(65536-2000) / 256
MOV TL0,#(65536-2000) MOD 256
MOV A,#DISPBUF
ADD A,DISPBIT
MOV R0,A
MOV A,@R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P1,A
MOV A,DISPBIT
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P3,A
INC DISPBIT
MOV A,DISPBIT
CJNE A,#08H,KNA
MOV DISPBIT,#00H
KNA: INC T2SCNTA
MOV A,T2SCNTA
CJNE A,#100,DONE
MOV T2SCNTA,#00H
INC T2SCNTB
MOV A,T2SCNTB
CJNE A,#05H,DONE
MOV T2SCNTB,#00H
INC SECOND
MOV A,SECOND
CJNE A,#60,NEXT
MOV SECOND,#00H
INC MINITE
MOV A,MINITE
CJNE A,#60,NEXT
MOV MINITE,#00H
INC HOUR
MOV A,HOUR
CJNE A,#24,NEXT
MOV HOUR,#00H
NEXT: LCALL DISP
DONE: RETI
TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,40H
TAB: DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
END
7. C语言源程序
#include <AT89X51.H>
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x00};
unsigned char dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
unsigned char dispbuf[8]={0,0,16,0,0,16,0,0};
unsigned char dispbitcnt;
unsigned char second;
unsigned char minite;
unsigned char hour;
unsigned int tcnt;
unsigned char mstcnt;
unsigned char i,j;
void main(void)
{
TMOD=0x02;
TH0=0x06;
TL0=0x06;
TR0=1;
ET0=1;
EA=1;
while(1)
{
if(P0_0==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_0==0)
{
second++;
if(second==60)
{
second=0;
}
dispbuf[0]=second%10;
dispbuf[1]=second/10;
while(P0_0==0);
}
}
if(P0_1==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_1==0)
{
minite++;
if(minite==60)
{
minite=0;
}
dispbuf[3]=minite%10;
dispbuf[4]=minite/10;
while(P0_1==0);
}
}
if(P0_2==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_2==0)
{
hour++;
if(hour==24)
{
hour=0;
}
dispbuf[6]=hour%10;
dispbuf[7]=hour/10;
while(P0_2==0);
}
}
}
}
void t0(void) interrupt 1 using 0
{
mstcnt++;
if(mstcnt==8)
{
mstcnt=0;
P1=dispcode[dispbuf[dispbitcnt]];
P3=dispbitcode[dispbitcnt];
dispbitcnt++;
if(dispbitcnt==8)
{
dispbitcnt=0;
}
}
tcnt++;
if(tcnt==4000)
{
tcnt=0;
second++;
if(second==60)
{
second=0;
minite++;
if(minite==60)
{
minite=0;
hour++;
if(hour==24)
{
hour=0;
}
}
}
dispbuf[0]=second%10;
dispbuf[1]=second/10;
dispbuf[3]=minite%10;
dispbuf[4]=minite/10;
dispbuf[6]=hour%10;
dispbuf[7]=hour/10;
}
(1. 开机时,显示12:00:00的时间开始计时;
(2. P0.0/AD0控制“秒”的调整,每按一次加1秒;
(3. P0.1/AD1控制“分”的调整,每按一次加1分;
(4. P0.2/AD2控制“时”的调整,每按一次加1个小时;
2. 电路原理图
3. 系统板上硬件连线
(1. 把“单片机系统”区域中的P1.0-P1.7端口用8芯排线连接到“动态数码显示”区域中的A-H端口上;
(2. 把“单片机系统:区域中的P3.0-P3.7端口用8芯排线连接到“动态数码显示”区域中的S1-S8端口上;
(3. 把“单片机系统”区域中的P0.0/AD0、P0.1/AD1、P0.2/AD2端口分别用导线连接到“独立式键盘”区域中的SP3、SP2、SP1端口上;
4. 相关基本知识
(1. 动态数码显示的方法
(2. 独立式按键识别过程
(3. “时”,“分”,“秒”数据送出显示处理方法
5. 程序框图
6. 汇编源程序
SECOND EQU 30H
MINITE EQU 31H
HOUR EQU 32H
HOURK BIT P0.0
MINITEK BIT P0.1
SECONDK BIT P0.2
DISPBUF EQU 40H
DISPBIT EQU 48H
T2SCNTA EQU 49H
T2SCNTB EQU 4AH
TEMP EQU 4BH
ORG 00H
LJMP START
ORG 0BH
LJMP INT_T0
START: MOV SECOND,#00H
MOV MINITE,#00H
MOV HOUR,#12
MOV DISPBIT,#00H
MOV T2SCNTA,#00H
MOV T2SCNTB,#00H
MOV TEMP,#0FEH
LCALL DISP
MOV TMOD,#01H
MOV TH0,#(65536-2000) / 256
MOV TL0,#(65536-2000) MOD 256
SETB TR0
SETB ET0
SETB EA
WT: JB SECONDK,NK1
LCALL DELY10MS
JB SECONDK,NK1
INC SECOND
MOV A,SECOND
CJNE A,#60,NS60
MOV SECOND,#00H
NS60: LCALL DISP
JNB SECONDK,$
NK1: JB MINITEK,NK2
LCALL DELY10MS
JB MINITEK,NK2
INC MINITE
MOV A,MINITE
CJNE A,#60,NM60
MOV MINITE,#00H
NM60: LCALL DISP
JNB MINITEK,$
NK2: JB HOURK,NK3
LCALL DELY10MS
JB HOURK,NK3
INC HOUR
MOV A,HOUR
CJNE A,#24,NH24
MOV HOUR,#00H
NH24: LCALL DISP
JNB HOURK,$
NK3: LJMP WT
DELY10MS:
MOV R6,#10
D1: MOV R7,#248
DJNZ R7,$
DJNZ R6,D1
RET
DISP:
MOV A,#DISPBUF
ADD A,#8
DEC A
MOV R1,A
MOV A,HOUR
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
MOV A,#10
MOV @R1,A
DEC R1
MOV A,MINITE
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
MOV A,#10
MOV @R1,A
DEC R1
MOV A,SECOND
MOV B,#10
DIV AB
MOV @R1,A
DEC R1
MOV A,B
MOV @R1,A
DEC R1
RET
INT_T0:
MOV TH0,#(65536-2000) / 256
MOV TL0,#(65536-2000) MOD 256
MOV A,#DISPBUF
ADD A,DISPBIT
MOV R0,A
MOV A,@R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P1,A
MOV A,DISPBIT
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P3,A
INC DISPBIT
MOV A,DISPBIT
CJNE A,#08H,KNA
MOV DISPBIT,#00H
KNA: INC T2SCNTA
MOV A,T2SCNTA
CJNE A,#100,DONE
MOV T2SCNTA,#00H
INC T2SCNTB
MOV A,T2SCNTB
CJNE A,#05H,DONE
MOV T2SCNTB,#00H
INC SECOND
MOV A,SECOND
CJNE A,#60,NEXT
MOV SECOND,#00H
INC MINITE
MOV A,MINITE
CJNE A,#60,NEXT
MOV MINITE,#00H
INC HOUR
MOV A,HOUR
CJNE A,#24,NEXT
MOV HOUR,#00H
NEXT: LCALL DISP
DONE: RETI
TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,40H
TAB: DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
END
7. C语言源程序
#include <AT89X51.H>
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x00};
unsigned char dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
unsigned char dispbuf[8]={0,0,16,0,0,16,0,0};
unsigned char dispbitcnt;
unsigned char second;
unsigned char minite;
unsigned char hour;
unsigned int tcnt;
unsigned char mstcnt;
unsigned char i,j;
void main(void)
{
TMOD=0x02;
TH0=0x06;
TL0=0x06;
TR0=1;
ET0=1;
EA=1;
while(1)
{
if(P0_0==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_0==0)
{
second++;
if(second==60)
{
second=0;
}
dispbuf[0]=second%10;
dispbuf[1]=second/10;
while(P0_0==0);
}
}
if(P0_1==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_1==0)
{
minite++;
if(minite==60)
{
minite=0;
}
dispbuf[3]=minite%10;
dispbuf[4]=minite/10;
while(P0_1==0);
}
}
if(P0_2==0)
{
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P0_2==0)
{
hour++;
if(hour==24)
{
hour=0;
}
dispbuf[6]=hour%10;
dispbuf[7]=hour/10;
while(P0_2==0);
}
}
}
}
void t0(void) interrupt 1 using 0
{
mstcnt++;
if(mstcnt==8)
{
mstcnt=0;
P1=dispcode[dispbuf[dispbitcnt]];
P3=dispbitcode[dispbitcnt];
dispbitcnt++;
if(dispbitcnt==8)
{
dispbitcnt=0;
}
}
tcnt++;
if(tcnt==4000)
{
tcnt=0;
second++;
if(second==60)
{
second=0;
minite++;
if(minite==60)
{
minite=0;
hour++;
if(hour==24)
{
hour=0;
}
}
}
dispbuf[0]=second%10;
dispbuf[1]=second/10;
dispbuf[3]=minite%10;
dispbuf[4]=minite/10;
dispbuf[6]=hour%10;
dispbuf[7]=hour/10;
}
展开全部
这是我用C编的,不知你能看懂不?没有按键调节。昨天刚编的
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e,
0x89,0xc7,0xff };
uchar t0,temp1,temp2,temp3,miao1,miao2,fen1,fen2,shi1,shi2;
void delay(uint z);
void chushi();
void chaifen1();
void chaifen2();
void chaifen3();
void xianshi();
void main()
{
chushi();
while(1)
{
xianshi();
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void chushi()
{
TMOD=0x1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
}
void timer0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
t0++;
if(t0==20)
{
t0=0;
temp1++;
chaifen1();
if(temp1==60)
{
temp1=0;
temp2++;
chaifen2();
if(temp2==60)
{
temp2=0;
temp3++;
chaifen3();
if(temp3==12)
temp3=0;
}
}
}
}
void chaifen1()
{
miao1=temp1/10;
miao2=temp1%10;
}
void chaifen2()
{
fen1=temp2/10;
fen2=temp2%10;
}
void chaifen3()
{
shi1=temp3/10;
shi2=temp3%10;
}
void xianshi()
{
P0=table[miao2];
P2=0x20;
delay(30);
P0=table[miao1];
P2=0x10;
delay(30);
P0=table[fen2];
P2=0x08;
delay(30);
P0=table[fen1];
P2=0x04;
delay(30);
P0=table[shi2];
P2=0x02;
delay(30);
P0=table[shi1];
P2=0x01;
delay(30);
}
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e,
0x89,0xc7,0xff };
uchar t0,temp1,temp2,temp3,miao1,miao2,fen1,fen2,shi1,shi2;
void delay(uint z);
void chushi();
void chaifen1();
void chaifen2();
void chaifen3();
void xianshi();
void main()
{
chushi();
while(1)
{
xianshi();
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void chushi()
{
TMOD=0x1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
}
void timer0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
t0++;
if(t0==20)
{
t0=0;
temp1++;
chaifen1();
if(temp1==60)
{
temp1=0;
temp2++;
chaifen2();
if(temp2==60)
{
temp2=0;
temp3++;
chaifen3();
if(temp3==12)
temp3=0;
}
}
}
}
void chaifen1()
{
miao1=temp1/10;
miao2=temp1%10;
}
void chaifen2()
{
fen1=temp2/10;
fen2=temp2%10;
}
void chaifen3()
{
shi1=temp3/10;
shi2=temp3%10;
}
void xianshi()
{
P0=table[miao2];
P2=0x20;
delay(30);
P0=table[miao1];
P2=0x10;
delay(30);
P0=table[fen2];
P2=0x08;
delay(30);
P0=table[fen1];
P2=0x04;
delay(30);
P0=table[shi2];
P2=0x02;
delay(30);
P0=table[shi1];
P2=0x01;
delay(30);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我用汇编做的
FLAG BIT 20H.1
HOU EQU 3H
MIN EQU 31H
SEC EQU 32H
COUNT EQU 33H
DISPH EQU 34H
DISPL EQU 35H
ORG 0000H
LJMP START
ORG 000BH
LJMP T0_ISR
ORG 0030H
START:
MOV SP,#50H
MOV SEC,#00
MOV MIN,#00
MOV HOU,#00
MOV TMOD,#01H
MOV TH0,#4CH
MOV TL0,#00H
SETB TR0
SETB ET0
SETB EA
MAIN:
LCALL DISP
JNB FLAG,MAIN
CLR FLAG
LCALL TIMEUP
SJMP MAIN
TIMEUP:
;********* 秒*****************
INC SEC
MOV A,SEC
CJNE A,#60,TIME1
MOV SEC,#0
;***********分*****************
INC MIN
MOV A,MIN
CJNE A,#60,TIME1
MOV MIN,#0
;***********时******************
INC HOU
MOV A,HOU
CJNE A,#24,TIME1
MOV HOU,#0
MOV MIN,#0
MOV SEC,#0
TIME1: RET
;**********显示模块***********************
DISP:
MOV A,SEC
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.7
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.7
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.6
MOV P0,A
LCALL DELAY
SETB P3.6
CLR P3.5
MOV P0,#40H
LCALL DELAY
SETB P3.5
;************************************
MOV A,MIN
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.4
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.4
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.3
MOV P0,A
LCALL DELAY
SETB P3.3
CLR P3.2
MOV P0,#40H
LCALL DELAY
SETB P3.2
;***************************************
MOV A,HOU
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.1
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.1
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.0
MOV P0,A
LCALL DELAY
SETB P3.0
CLR P3.2
MOV P0,#40H
LCALL DELAY
SETB P3.2
RET
;********************************
DELAY:MOV R6,#10
DEL1:MOV R7,#25
DEL2: NOP
NOP
DJNZ R7,DEL2
DJNZ R6,DEL1
RET
;*******************************
TABLE:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
;***********************************************
T0_ISR: MOV TH0,#4CH
MOV TL0,#00H
INC COUNT
MOV A,COUNT
CJNE A,#20,OP
MOV COUNT,#0
SETB FLAG
OP: RETI
END
FLAG BIT 20H.1
HOU EQU 3H
MIN EQU 31H
SEC EQU 32H
COUNT EQU 33H
DISPH EQU 34H
DISPL EQU 35H
ORG 0000H
LJMP START
ORG 000BH
LJMP T0_ISR
ORG 0030H
START:
MOV SP,#50H
MOV SEC,#00
MOV MIN,#00
MOV HOU,#00
MOV TMOD,#01H
MOV TH0,#4CH
MOV TL0,#00H
SETB TR0
SETB ET0
SETB EA
MAIN:
LCALL DISP
JNB FLAG,MAIN
CLR FLAG
LCALL TIMEUP
SJMP MAIN
TIMEUP:
;********* 秒*****************
INC SEC
MOV A,SEC
CJNE A,#60,TIME1
MOV SEC,#0
;***********分*****************
INC MIN
MOV A,MIN
CJNE A,#60,TIME1
MOV MIN,#0
;***********时******************
INC HOU
MOV A,HOU
CJNE A,#24,TIME1
MOV HOU,#0
MOV MIN,#0
MOV SEC,#0
TIME1: RET
;**********显示模块***********************
DISP:
MOV A,SEC
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.7
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.7
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.6
MOV P0,A
LCALL DELAY
SETB P3.6
CLR P3.5
MOV P0,#40H
LCALL DELAY
SETB P3.5
;************************************
MOV A,MIN
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.4
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.4
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.3
MOV P0,A
LCALL DELAY
SETB P3.3
CLR P3.2
MOV P0,#40H
LCALL DELAY
SETB P3.2
;***************************************
MOV A,HOU
MOV B,#10
DIV AB
MOV DISPH,A
MOV DISPL,B
CLR P3.1
MOV A,DISPL
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
SETB P3.1
MOV A,DISPH
MOVC A,@A+DPTR
CLR P3.0
MOV P0,A
LCALL DELAY
SETB P3.0
CLR P3.2
MOV P0,#40H
LCALL DELAY
SETB P3.2
RET
;********************************
DELAY:MOV R6,#10
DEL1:MOV R7,#25
DEL2: NOP
NOP
DJNZ R7,DEL2
DJNZ R6,DEL1
RET
;*******************************
TABLE:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
;***********************************************
T0_ISR: MOV TH0,#4CH
MOV TL0,#00H
INC COUNT
MOV A,COUNT
CJNE A,#20,OP
MOV COUNT,#0
SETB FLAG
OP: RETI
END
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询