21ic问答首页 - 新唐51系列mcu的WDT reset功能不起作用
新唐51系列mcu的WDT reset功能不起作用
xxy95272024-05-03
我参照库函数的WDT reset代码写的,里面除了WDT_Open(1024); 和 WDT_Clear();好像也没有什么别的有效操作,为什么我不喂狗的时候mcu也不会reset重启呢?是什么地方没有注意到吗?void main (void)
{
uint8_t ct;
WDT_Clear();
WDT_Open(1024);
GPIO_LED_QUASI_MODE;
/* Note WDT timer base is LIRC 10Khz*/
Enable_UART0_VCOM_printf();
printf("\n\r Test start MCU reset ");
WDT_Clear();
Read_CONFIG();
SFRS = 0;
printf ("\n\r Now config value is : ");
for(ct=0;ct<5;ct++)
{
SFRS = 0;
printf ("\r 0x%X", IAPCFBuf[ct]);
WDT_Clear();
}
SFRS = 0;
printf("\n\r WDT Reset enabled in CONFIG ");
WDT_Clear();
printf ("\n\r ");
printf("\n\r P32 connect to VDD, WDT not reset ");
WDT_Clear();
//--------------------------------------------------------
//Warning:
//Pleaes always check CONFIG WDT disable first
//only when WDT reset disable, WDT use as pure timer
//--------------------------------------------------------
while (GPIO_LED)
{
WDT_Clear();
}
while(1);
}
{
uint8_t ct;
WDT_Clear();
WDT_Open(1024);
GPIO_LED_QUASI_MODE;
/* Note WDT timer base is LIRC 10Khz*/
Enable_UART0_VCOM_printf();
printf("\n\r Test start MCU reset ");
WDT_Clear();
Read_CONFIG();
SFRS = 0;
printf ("\n\r Now config value is : ");
for(ct=0;ct<5;ct++)
{
SFRS = 0;
printf ("\r 0x%X", IAPCFBuf[ct]);
WDT_Clear();
}
SFRS = 0;
printf("\n\r WDT Reset enabled in CONFIG ");
WDT_Clear();
printf ("\n\r ");
printf("\n\r P32 connect to VDD, WDT not reset ");
WDT_Clear();
//--------------------------------------------------------
//Warning:
//Pleaes always check CONFIG WDT disable first
//only when WDT reset disable, WDT use as pure timer
//--------------------------------------------------------
while (GPIO_LED)
{
WDT_Clear();
}
while(1);
}
赞0
评论
2024-05-07
赞0
评论
2024-05-03
您需要登录后才可以回复 登录 | 注册