我使用demo中的例子,注釋掉了按鍵
void?IWDG_Feed_Init(?u16?prer,?u16?rlr?) { ????IWDG_WriteAccessCmd(?IWDG_WriteAccess_Enable?); ????IWDG_SetPrescaler(?prer?); ????IWDG_SetReload(?rlr?); ????IWDG_ReloadCounter(); ????IWDG_Enable(); } /********************************************************************* ?*?@fn??????main ?* ?*?@brief???Main?program. ?* ?*?@return??none ?*/ int?main(?void?) { ????SystemCoreClockUpdate(); ????USART_Printf_Init(?115200?); ????printf(?"SystemClk:%d\r\n",?SystemCoreClock?); ????printf(?"ChipID:%08x\r\n",?DBGMCU_GetCHIPID()?); ????Delay_Init(); ????KEY_Init(); ????printf(?"IWDG?test...\r\n"?); ????Delay_Ms(?1000?); ????IWDG_Feed_Init(?IWDG_Prescaler_32,?4000?);???//?3.2s?IWDG?reset ????while(?1?) ????{ //????????if(?KEY_PRESS()?==?1?)????//PA0 ????????{ ?????????????Delay_Ms(?100?); ????????????printf(?"Feed?dog\r\n"?); ????????????IWDG_ReloadCounter();????//Feed?dog ????????????Delay_Ms(?10?); ????????} ????} } 我注釋掉了按鍵,按道理來(lái)說(shuō)他一直在循環(huán)喂狗,不應(yīng)該重啟,可實(shí)際他是?每個(gè)3.2S就重啟,如下??在初始化看門(mén)狗就死機(jī)了,程序都運(yùn)行不到打印喂狗
[00:13:42.930]收←◆SystemClk:96000000
ChipID:20700418
IWDG test...
[00:13:47.301]收←◆SystemClk:96000000
ChipID:20700418
IWDG test...
[00:13:51.672]收←◆SystemClk:96000000
ChipID:20700418
IWDG test...
[00:13:56.045]收←◆SystemClk:96000000
ChipID:20700418
IWDG test...
熱門(mén)產(chǎn)品 :
CH182: 以太網(wǎng)PHY收發(fā)器芯片