📄 m10_wdt.txt
字号:
// File : m10_wdt.c
#include <gc80c520_pl44i.h>
void delay()
{
char temp;
for(temp=0;temp<0x30;temp++);
}
void main()
{
// 1) Restart the WDT Couter
RWT = 1; // Clear Watchdog Timer Counter (WDCON.0)
// 2) Clear the WDT Interrupt & Reset Flags
WDIF = 0; // WDT Interrupt Flag (WDCON.3)
WTRF = 0; // WDT Reset Flag (WDCON.2)
// 3) Set the WDT mode
CKCON &= 0x3F; // WDT Mode 3 (Fosc/32; 528.38)
CKCON += (3 << 6);
// 4) Enable the WDT Enable
EWT = 1; // WDT Reset Enable
while(1)
{
delay();
RWT=1;
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -