1102 views|1 replies

1w

Posts

16

Resources
The OP
 

[Shanghai Hangxin ACM32F070 development board evaluation] 5. Run the watchdog [Copy link]

 

I often use the watchdog to monitor the house, so I also paid attention to the watchdog in this review.

Open the routine and you can see two interesting options:

void WDT_Reset_Test(void)
{   
    WDT_MODE watchdog_mode;  
    watchdog_mode = WDT_MODE_RST;  //WDT_MODE_INT   WDT_MODE_RST  
    WDT_Init(watchdog_mode); // you can choose reset mode or interrupt mode 
    while(1) 
    {
        if (WDT_MODE_RST == watchdog_mode)
        {
            HAL_WDT_Feed(&WDT_Handle);  // if not feed watchdog more than 5 seconds, watchdog reset should happen. 
        }
        else
        {
            WDT_Interrupt_Test(); 
        }
    }

}

If you select WDT_MODE_INT, you will not feed the dog when compiling. Of course, the dog interrupt will be sent if you select WDT_MODE_RST.

This program will keep feeding the dog, of course it will not reset, but if you don't feed the dog, it will definitely reset. The routine will keep feeding the dog.

The results are as follows:

This post is from Domestic Chip Exchange

Latest reply

It turns out that there are two options for the watchdog. If you choose WDT_MODE_INT, you won't feed the watchdog when you compile. If you choose WDT_MODE_RST, the program will keep feeding the watchdog and won't reset. If you don't feed the watchdog, it will definitely reset. It's interesting. Thanks for sharing   Details Published on 2022-10-30 08:34
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 
 

6593

Posts

0

Resources
2
 

It turns out that there are two options for the watchdog. If you choose WDT_MODE_INT, you won't feed the watchdog when you compile. If you choose WDT_MODE_RST, the program will keep feeding the watchdog and won't reset. If you don't feed the watchdog, it will definitely reset. It's interesting. Thanks for sharing

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list