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

📄 wdt.txt

📁 EM78P468单片机汇编详细代码
💻 TXT
字号:
;**************************************************************************
;下面是按方式1给出的一段程式,该程式循环的用WDT timeout唤醒SLEEP IC,每唤醒一次,P67的输出改变一次。
;**************************************************************************


;=====================================================
status==0x03
t==4
temp==0x10
;---------------------------------------------------
	org 0x000
	jmp main
	org 0x050
 
 ;-----------------------------------------
main:
	bc 0x05,0      		;select ioc page 0
	mov a,@0x0          ;p6 output
	iow 0x06
	jbs status,t        ;judge power on reset or wdt timeout reset
	jmp main1

	mov a,@0x00         ;port6 output low
	mov 0x06,a
	mov temp,a          ;temp store port6 output
;-----------------------------------------------
main1:
	mov a,temp
	xor a,@0x80
	mov 0xtemp,a        ;temp.7 reverse
	mov 0x06,a          ;port6.7 output
	
	wdtslep             ;use macro

wdtslep macro
	bs 0x05,0      		;select ioc page 1
	mov a,@0b00001000   ;enable wdt
	iow 0x08            ;set prescaler to wdt(ioc81)
	wdtc                ;clr wdt
	slep                ;in sleep mode
	nop
	endm

⌨️ 快捷键说明

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