排污泵厂家
免费服务热线

Free service

hotline

010-00000000
排污泵厂家
热门搜索:
技术资讯
当前位置:首页 > 技术资讯

基于AT89C2051的红外遥控学习器源程序

发布时间:2020-06-30 23:21:35 阅读: 来源:排污泵厂家

源程序 ORG 0000H AJMP MAIN ORG 0003H AJMP KEYPRESS ORG 000BH AJMP TIMEOUT ORG 001BH AJMP TIMEOUT

本文引用地址: SENDDUAN BIT P3.0 JIEDUAN BIT P3.1 INTRPO BIT P3.2 JIEXUAN BIT P3.3 SENDLIGHT BIT P3.4 JIELIGHT BIT P3.5 CS BIT P3.7 DATADUAN BIT P1.6 CLK BIT P1.7 JIANWEI EQU R5 JIANMA EQU R6 SHANGJIAN EQU 07H;R7 OPENKEY EQU 81H CLOSEKEY EQU 00H CHUT0 EQU 11H CHUT1 EQU 11H BUFBEGIN EQU 18H OPENT1 EQU 88H CLOSET1 EQU 00H OPENT0 EQU 82H CLOSET0 EQU 00H DATABEG1 EQU 0AAH DATABEG2 EQU 33H

ORG 0030HMAIN: MOV IE,#80H MOV IP,#00H MOV P3,#0FFH CLR CS SETB P1.0 SETB P1.1 SETB P1.2 CLR P1.3 CLR P1.4 CLR P1.5 CLR P1.6 CLR P1.7 MOV R3,#80H MOV R0,00HCYCLE1: MOV @R0,#00H INC R0 DJNZ R3,CYCLE1 MOV PSW,#00H MOV SP,#07H

MOV TMOD,#11H MOV TCON,#00H

START: MOV SP,#07H SETB SENDDUAN CLR F0 SETB EXOWAITKEY: MOV C,F0 JNC WAITKEY CJNC JIANMA,#1BH,SEND LCALL LEARNP LJMP STARTSEND: LCALL SENDP LJMP START

SENDP: SETB SENDDUAN CLR F0 MOV TMOD,#CHUT1 CLR SENDLIGHT MOV A,JIANMA CJNE A,SHANGJIAN,SAMESAME: MOV R0,#BUFBEGIN CLR TR1 LJMP NEXT3RETURN: CLR ET1 SETB SENDDUAN SETB SENDLIGHT CLR F0 LCALL DELAY RETNEXT3: CPL F0 JB F0,SEND1SEND0: CLR C ;1 MOV A,#0FFH SUBB A,@R0 MOV R2,A ;1 INC R0 ;1 MOV A,#0FFH ;1 SUBB A,@R0 ;1 MOV R3,A INC R0 CLR C MOV A,#4FH ADDC A,R2 MOV R2,A MOV A,R3 ADDC A,#00H MOV R3,A MOV TL1,R2 MOV TH1,R3 SETB TR1 ;1 SETB ET1 ;1SEND1: CLR C MOV A,#0FFH SUBB A,@RO MOV TL1,A INC R0 MOV A,#0FFH SUBB A,@R0 MOV TH1,A INC R0 SETB TR1 SETB ET1NEXT6: CLR SENGGUAN MOV R3,#03HNEXT4: DJNZ R3,NEXT4 SETB SENDDUAN MOV R3,#07HNEXT5: DJNZ R3,#NEXT5 SJMP NEXT6

TIMA1OUT: CLR ET1 ;2 CLR TR1 ;2 SETB SENDDUAN ;1 CJNE@R0,#DATABEG2,TIM1NT2 MOV DPTR,#RETURN ;2 MOV R1,SP ;2 MOV @R1,DPH ;2 DEC R1 ;1 MOV @R1,DPL ;2 RETI ;2TIM1NET2: DEC R0TIM1NET1: CPL F0 ;1 JB F0,SEND11 ;2SEND00: MOV DPTR,#SENDO ;11 MOV R1,SP MOV @R1,DPH DEC R1 MOV @R1,DPL RETISEND11: MOV DPTR,#SEND1 ;11 MOV R1,SP MOV @R1,DPH DEC R1 MOV @R1,DPL RETILEARNP: MOV R2,#02HNEXT91: MOV R3,#0FFHNEXT81: MOV R4,#0FFHNEXT71: DJNZ R4,NEXT71 DJNZ R3,NEXT81 GJNZ R2,NEXT91 CLR F0 SETB EX0 MOV R2,#0AHMEXT9: MOV R3,#0FFHNEXT8: MOV R4,#0FFHNEXT7: JB F0,NEXT10 DJNZ R4,NEXT7 DJNZ R3,MEXT8 DJNZ R2,NEXT9 CLR EX0 RETNEXT10: CJNE JIANMA,#1BH,NEXT11 LJMP NEXT111NEXT11: RETNEXT111: CLR JIELIGHT CLR JIEXUAN CLR F0 MOV R0,#BUFBEGIN SETB ET0 MOV TCON,#00H MOV TMOD,#CHUT0 MOV TL0,#00H MOV TH0,#00H MOV R2,#02HNEXT92: MOV R3,#0FFHNEXT82: MOV R4,#0FFHNEXT72: DJNZ R4,NEXT72 DJNZ R3,NEXT82 DJNZ R2,NEXT92

辽宁定制劳保工服

淄博劳保工服定制

黑龙江职业装订做

防静电工作服制作