STM8S 獨(dú)立看門狗配置及使用
//選擇 IWDG_Prescaler_128
//64/128 =0.5 khz 2ms周期
#define IWDG_500MS_REST (uint8)250#define IWDG_400MS_REST (uint8)200#define IWDG_300MS_REST (uint8)150#define IWDG_250MS_REST (uint8)125#define IWDG_200MS_REST (uint8)100#define IWDG_100MS_REST (uint8)50#define IWDG_50MS_REST (uint8)25#define IWDG_4MS_REST (uint8)2IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);//同意操作獨(dú)立看門狗IWDG_SetPrescaler(IWDG_Prescaler_128);//看門狗預(yù)分頻IWDG_SetReload(IWDG_200MS_REST);//設(shè)置看門狗復(fù)位時(shí)間IWDG_Enable();//啟動(dòng)獨(dú)立看門狗IWDG_ReloadCounter();//看門狗復(fù)位 正常使用時(shí)不想發(fā)生看門狗復(fù)位,就運(yùn)行此指令
評(píng)論