⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 remote.asm

📁 接收红外遥控,控制2314
💻 ASM
字号:
;************************************************************************
;			PT2222 START
;		   SEND REMOTE CODE
.IF 0
REMOTE_SEND_HEARD_CODE		proc
.ENDIF
REMOTE_SEND_HEARD_CODE:
;************************************************************************
		CLR_REMOTE
		ld		ACC_SEN_VAL,#2AH
		call		REMOTE_DELAY_200uS
		SET_REMOTE
		ld		ACC_SEN_VAL,#16H
		call		REMOTE_DELAY_200uS
		RET
.IF 0
REMOTE_SEND_HEARD_CODE			endp
.ENDIF
;*************************************************************************


;*************************************************************************
;
;			remote code from  acc
;	
.IF 0
REMOTE_SEND_BYTE		proc
.ENDIF
REMOTE_SEND_BYTE:
;*************************************************************************

		push		R0
		push		R1
		ld		R0,ACC_SEN_VAL
		ld		R1,#08H
		
send_remote_code:
		;----------high pulse 0.6ms---------------
		CLR_REMOTE
		ld		ACC_SEN_VAL,#03H
		call		REMOTE_DELAY_200uS
	;------------------------------------------
	;------low pulse 0.6 ms or 1.6 ms--------
		SET_REMOTE
		ld		ACC_SEN_VAL,#02H
		tm		R0,#01H
		jr		Z,no_ld_7
		ld		ACC_SEN_VAL,#07H
no_ld_7:
		call		REMOTE_DELAY_200uS
		rr		R0
		dec		R1
		cp		R1,#00H
		jp		NE,send_remote_code
		pop		R1
		pop		R0
		ret
;***********************************************************************

;***********************************************************************
;
;			delay time from  ACC_SEN_VAL
;			DELAY_200US_VAL IN TIME0INT
.IF 0
REMOTE_DELAY_200uS	PROC
.ENDIF
REMOTE_DELAY_200uS:
;***********************************************************************
				clr	DELAY_200US_VAL
		rem_delay:
				cp	ACC_SEN_VAL,DELAY_200US_VAL
				jp	UGT,rem_delay
				ret
;************************************************************************
;
;		MAIN: cmd_code from  acc_sen_val
;
.IF 0
REMOTE_SEND_CODE	PROC
.ENDIF
REMOTE_SEND_CODE:
;************************************************************************

		push		ACC_SEN_VAL
		call		REMOTE_SEND_HEARD_CODE
		ld		ACC_SEN_VAL,#00H
		call		REMOTE_SEND_BYTE
		ld		ACC_SEN_VAL,#0FFH
		call		REMOTE_SEND_BYTE
		pop		ACC_SEN_VAL
		push		ACC_SEN_VAL
		call		REMOTE_SEND_BYTE
		pop		ACC_SEN_VAL
		COM		ACC_SEN_VAL
		call		REMOTE_SEND_BYTE
		CLR_REMOTE
		ld		ACC_SEN_VAL,#02H
		call		REMOTE_DELAY_200uS
		SET_REMOTE
		ret
;****************************************************************************** 

;*************************************************************
.if 0
Send_40K	proc
.endif
;*************************************************************
Send_40K:
		DI


		
		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us

		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us

		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us
		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us

		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us

		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us

		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us
		
		SET_REMOTE
		call	Delay_12us
		CLR_REMOTE
		call	Delay_12us


		EI
		ret
;*************************************************************



.if 0
;*************************************************************
.IF 0
Delay_12us	proc
.ENDIF
;*************************************************************
Delay_12us:;24
		nop
		nop
		
		nop
		nop

		nop
		nop

		nop
		nop
		
		nop
		nop
		
		nop
		nop

		nop
		nop


		nop
		nop


		nop
		


		ret
;*************************************************************
.endif



.if 1
.IF 0
Delay_12us	proc
.ENDIF
;*************************************************************
Delay_12us:;24


		call	Delay_10ms
		ret
.endif




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -