红绿灯延时程序
时间:10-02
整理:3721RD
点击:
ORG 00H ;
LJMP AA;
ORG 000BH ;
LJMP TIME ;
ORG 30h ;
AA : MOV P1, #0ffH ;
MOV 34H,#00H;
MOV R5,#10;
MOV R6,#10;
MOV R7,#15;
MOV TMOD, #01H;
MOV TH0, #15h;
MOV TL0, #9FH;
SETB EA;
SETB ET0;
SETB TR0;
CLR P1.0;
LOOP: AJMP LOOP;
TIME: INC 34H;
MOV A,34H;
CJNE A, #20,D1;
DJNZ R5,D2;
CPL P1.0;
MOV R5,#20;
D2: DJNZ R6,D3 ;
SETB P1.0;
CPL P1.1;
MOV R6,#30;
D3: DJNZ R7,D1;
SETB P1.1;
CPL P1.2;
MOV R7,#30;
D1: MOV TH0,#15H;
MOV TL0,#9FH;
MOV 34H,#00H;
RETI ;
END ;
请各位大神帮忙看下这个程序问题出现在哪,为什么没有中断出现?
LJMP AA;
ORG 000BH ;
LJMP TIME ;
ORG 30h ;
AA : MOV P1, #0ffH ;
MOV 34H,#00H;
MOV R5,#10;
MOV R6,#10;
MOV R7,#15;
MOV TMOD, #01H;
MOV TH0, #15h;
MOV TL0, #9FH;
SETB EA;
SETB ET0;
SETB TR0;
CLR P1.0;
LOOP: AJMP LOOP;
TIME: INC 34H;
MOV A,34H;
CJNE A, #20,D1;
DJNZ R5,D2;
CPL P1.0;
MOV R5,#20;
D2: DJNZ R6,D3 ;
SETB P1.0;
CPL P1.1;
MOV R6,#30;
D3: DJNZ R7,D1;
SETB P1.1;
CPL P1.2;
MOV R7,#30;
D1: MOV TH0,#15H;
MOV TL0,#9FH;
MOV 34H,#00H;
RETI ;
END ;
请各位大神帮忙看下这个程序问题出现在哪,为什么没有中断出现?