STM32 window watchdog principle

Publisher:钱老李Latest update time:2018-09-05 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

stm32 has two watchdogs, an independent watchdog and a window watchdog. In fact, their functions are similar, but the time limit for feeding the watchdog is different.

 

The independent watchdog limits the feeding time to 0-x, where x is determined by your related registers. The feeding time cannot be too late.

Window watchdog, so called window because its feeding time is within a range of upper and lower limits, you can set the upper and lower limits by setting the relevant registers. The feeding time should not be too early or too late.

figure 1

 

Window Watchdog

The upper window is W[6:0] set in the configuration register WWDG->CFR;

The lower window is fixed at 0x40;

When the window watchdog counter is outside the upper window value or below the lower window value, a reset will occur.

figure 2

 

 

&& The value of the upper window can only be set. The maximum value of a 7-bit binary number can only be set to 127 (0x7F), and the minimum value must be greater than 0x40 of the lower window, so its value range is 64~127 (i.e.: 0x40~0x7F);

 

&& Set the clock division factor for the counter in the configuration register WWDG->CFR to determine the time range that the counter can be timed, thereby determining the time range of the window.

 

&& The clock of the window watchdog comes from PCLK1. In the clock configuration, its frequency is the two-frequency clock of the external clock after the multiplier, that is, 36MHz. According to the manual, we can know the timing time calculation method:

      

Upper window time: T_min = 4096 * (2^WDGTB)*(WWDG_CR[6:0] - WWDG_CFR[6:0])/36 (us)

 

 Lower window time: T_max = 4096 * (2^WDGTB)*(WWDG_CR[6:0] - 0x40)/36 (us)

 

 

The feeding time range of the watchdog in the relevant window at 36Mhz is:

WDGTB (counter frequency division value) Earliest feeding time/us Latest feeding time/ms

0 113 7.28

1 227 14.56

2 455 29.12

3 910 58.25


Keywords:STM32 Reference address:STM32 window watchdog principle

Previous article:STM32 watchdog
Next article:STM32 learning Flash write operation & watchdog feeding

Recommended ReadingLatest update time:2024-11-16 19:58

STM32 JNTRST JTDI JTDO pins are used as normal IO method
When STM32 starts by default, the three pins PB4, PB3, and PA15 are not ordinary IOs, but JTAG multiplexing functions, namely JNTRST, JTDI, and JTDO. When we try to use the SWD interface to debug the simulation, these three pins can be used as normal IO. The specific method is to disable the JTAG function. Just use
[Microcontroller]
STM32 SPI Flash DFU
This time we are going to talk about downloading programs, pictures or other files to SPI Flash. I use W25X16 SPI Flash, which has 2MB space, 2 Blocks, 512ge Sectors, and 8096 Pages. Since SPI Flash cannot run programs directly, we know it from the interface. Next we will talk about how to write the upgrade function o
[Microcontroller]
STM32 SPI Flash DFU
STM32 Hex file format analysis
        If you use a special program to view the Hex file (usually Notepad can do this), you will find that the entire file is in lines, each line starts with a colon, and the content is all hexadecimal code. The Hex file can be split as follows to analyze its content:   For example:   :020000040000FA , I see it as 0x
[Microcontroller]
Summary of problems in PWM wave generation of STM32
Using STM32F103RC Question: The calculation result of PWM duty cycle is correct, but the output is wrong. The motor of Xinxida cannot be unlocked because the function of register is not understood. #include "tim2_pwm.h" #include "stm32f10x_tim.h" void Init_GPIO(void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_APB
[Microcontroller]
STM32 Experiment 4: Key Interrupt
Port Configuration #include "stm32f10x.h"//PA13 PA15void KEY_Init(void) {     GPIO_InitTypeDef GPIO_InitStructure;     EXTI_InitTypeDef EXTI_InitStructure;     NVIC_InitTypeDef NVIC_InitStructure;     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO,ENABLE); //Enable external clock     GPIO_InitStruct
[Microcontroller]
What you need to know when debugging STM32!
When learning STM32 development, DEBUG is an indispensable step. So, this article will show you some knowledge related to this debugging. This article takes STM32F1 and Cortex-M3 as examples. The principles of other series of chips or cores are the same or similar. 1Overview In STM32, there are many debugging com
[Microcontroller]
STM32 failed to download environment configuration using jlink
Today I created a new project and used jlink to download it. Suddenly, an inexplicable error occurred, as shown in Figure (1). However, the demo example can be downloaded to the development board using jlink. There are two opinions on Baidu: (1) It needs to be cloned and unlocked (download via serial port and refresh
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号