欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
松翰SN8F5703單片機WDT例程
[打印本頁]
作者:
hexinquan
時間:
2020-12-8 11:40
標題:
松翰SN8F5703單片機WDT例程
松翰5703例程-WDT
//--------------------------------------------------------------------------
//Filename : STOP_Mode.c
//Function : Use watch dog timer to Power save application when SN8F5708 run as stop mode.
//description : SN8F5708 be waked up by watch dog reset.
//--------------------------------------------------------------------------
//Note:
// 1)User need to add the STARTUP.A51 file which in this project to your project.
// 2)The STARTUP.A51 file has been modified for the Watchdog wakeup function.
// 3)User need to Reset the source which has used according to the PFLAG register.
//--------------------------------------------------------------------------
#include <SN8F5703.h>
#define uchar unsigned char
#define uint unsigned int
uchar RCycle_CNT;
//--------------------------------------------------------------------------
//subroutine : main()
//Function :
//--------------------------------------------------------------------------
void main(void)
{
CLKSEL = 0x03; //Fcpu=Fosc/16
// CLKSEL = 0x04; //Fcpu=Fosc/8
// CLKSEL = 0x05; //Fcpu=Fosc/4
CLKCMD = 0x69;
CKCON = 0x11;
WDTR = 0X5A;
if((PFLAG&0X40)==0X40) //Watchdog Reset
{
P0UR = 0X00;
P0 = 0X00;
P0M = 0XFF;
P1UR = 0X00;
P1 = 0X00;
P1M = 0XFF;
P2UR = 0X00;
P2 = 0X00;
P2M = 0XFF;
}
else //Other Reset
{
P0UR = 0X00;
P0 = 0XFF;
P0M = 0XFF;
P1UR = 0X00;
P1 = 0X00;
P1M = 0XFF;
P2UR = 0X00;
P2 = 0X00;
P2M = 0XFF;
}
while(1)
{
WDTR = 0X5A;
RCycle_CNT++;
P2 = RCycle_CNT; //P2 output registor data
P1W = 0X00; //Set P1 port wake up source, if enable, user need to set port as input mode
STOP();
}
}
復制代碼
5703_WDT_WakeUp_20161103.rar
2020-12-8 11:40 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
28.46 KB, 下載次數: 15, 下載積分: 黑幣 -5
作者:
tt98
時間:
2021-1-11 11:40
難道是用中文函數?
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1