CH32F203 看門(mén)狗已經(jīng)喂狗了,為什么還復(fù)位

我使用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...

您好,我這邊測(cè)試是沒(méi)有問(wèn)題的,如下圖。你可以檢查一下你的硬件供電是否穩(wěn)定,后續(xù)若有問(wèn)題,可郵箱(lzs@wch.cn)溝通。

image.png


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频