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

📄 delay.asm

📁 RFID功能中阅读器源代码,实现汽车的无钥匙进入功能
💻 ASM
字号:
#include "Project.inc"
#define Delay.Returned	Delay.flag,3
Delay_ovr	udata_ovr	;May do some overlay
Delay.Counter	res 1
	global Delay.flag, Delay.start, Delay.Wait
flag_ovr	udata_ovr
Delay.flag	res	1			;using bit 3
------------------------------
;延时w*50mius
------------------------------
Delay.start
	banksel Delay.Counter		;2Cycles	1
	movwf	Delay.Counter		;1Cycle		1
	banksel	OPTION_REG			;2Cycles	1	;setting prescaler to 1:2,选择8M内部晶振
	clrf	OPTION_REG			;1Cycles	1
	banksel	TMR0				;2Cycles	1
	movlw	0xEA				;1Cycles	1	;0x100 - 0x32 (50u) + 0x06 (static offset) + 0x07(Interrupt) + 0x0F (n first cycle)= 0xEA to compenste static Offsets
	movwf	TMR0				;1Cycles	1
	bcf		INTCON,T0IF			;this and below: dont't care timer already started
	bsf		INTCON,T0IE
	banksel	Delay.flag
	bcf		Delay.Returned
	return
--------------------------------
;等待延时结束
--------------------------------
Delay.Wait
	banksel	Delay.flag
	btfss	Delay.Returned
	goto	$-1				;at least 2 Cycles	1
	bcf		INTCON,T0IE		;1Cycle				1
	return
	END

⌨️ 快捷键说明

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