1、6)要求为该系统设计一个直流5V单电源供电的稳压电路,保障系统的正常运行。4、 电路原理图5、 参考电路板图6、 装配图7、 制作实物照片8、 参考程序ORG 0000H LJMP MAIN ORG 000BH ;T0中断服务程序入口 LJMP T0FW ORG 0030HMAIN: MOV 30H,#15 MOV 40H,#15 MOV 36H,#00H MOV 46H,#0FFH MOV TMOD,#01H MOV TH0,#3CH MOV TL0,#0B0H MOV R1,#20 SETB ET0 SETB EA SETB TR0 STAR: ACALL DISP ACALL DEL A
2、JMP STARDISP: PUSH A MOV DPTR,#TAB MOV A,40H MOV B,#10 DIV AB MOV 50H,A MOV 51H,B MOV 54H,A MOV 55H,B MOV A,30H MOV 52H,A MOV 53H,B MOV 56H,A MOV 57H,B MOV R5,#8 MOV R0,#50HLOOP: MOV A,R0 MOVC A,A+DPTR MOV SBUF,A JNB TI,$ CLR TI INC R0 DJNZ R5,LOOP MOV R2,36H CJNE R2,#0,N1 ;36H=1,跳到N1,绿灯亮 CLR P1.0 ;
3、否则36H=0,红灯亮 CLR P2.0 SETB P1.1 SETB P2.1 SETB P1.2 SETB P2.2 AJMP N2 N1: CLR P1.2 ;N1,绿灯亮 CLR P2.2 SETB P1.0 SETB P2.0 N2: MOV R2,30H CJNE R2,#3,N3 ;30H3,跳到N8, CLR P1.4 ;否则40H=3,黄灯亮 CLR P2.4 N8: CJNE R2,#2,N9 ;2,跳到N9,否则40H=2,黄灯亮 N9: CJNE R2,#1,N10 ;1,跳到N10,否则40H=1,黄灯亮 N10: POP A RETTAB: DB 11H,0D7H,32H,92H,0D4H DB 98H,18H,0D3H,10H,90H ,0C4HDEL: MOV R7,#200 ; 125.775mSDEL1: MOV R6,#240 DJNZ R6,$ DJNZ R7,DEL1T0FW: DJNZ R1,EXIT0 CLR EA DJNZ 30H,M1 MOV A,36H CPL A mov 36H,A ;AJMP EXIT M1: DJNZ 40H,EXIT MOV A,46H mov 46H,A EXIT:EXIT0: RETI END