STM32 independent watchdog usage experience (Cortex-M3)

Publisher:亚瑟摩根Latest update time:2018-05-14 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The calculation formula of the watchdog feeding time (watchdog overflow time) is:


Tout=((4*2^prer)*rlr)/40


Tout is the watchdog overflow time (in ms), prer is the watchdog clock prescaler value (IWDG_PR value), ranging from 0 to 7, and rlr is the watchdog reload value (IWDG_RLR).


void IWDG_Configuration(void)

{

    IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); //Remove register protection

    IWDG_SetPrescaler(IWDG_Prescaler_256); //Write the initialization division value 0~7

    IWDG_SetReload(0xFFF); //0xfff*256/40k=26s

    IWDG_ReloadCounter(); //Enable register protection

    IWDG_Enable(); //Start watchdog

}


After initialization, the watchdog starts to count down gradually to 0000 and resets, so the watchdog must be continuously fed before resetting, that is, data must be continuously reloaded into IWDG_RLR to prevent reset.


void IWDG_Feed(void) //dog feeding function

{

    IWDG->KR=0XAAAA;                                  

}


Keywords:STM32 Reference address:STM32 independent watchdog usage experience (Cortex-M3)

Previous article:STM32 self-study notes - watchdog
Next article:The difference and connection between stm32 independent watchdog and window watchdog

Recommended ReadingLatest update time:2024-11-16 20:31

STM32 multiplexing clock is turned on
Why turn on the clock in the first place? Answer: Because you need to read and write registers! In STM32, you need to turn on the clock corresponding to the register to read and write registers . Then it is clear when the AFIO clock is turned on (this is true for all clocks): the AFIO clock is turned on when the "AFIO
[Microcontroller]
STM32---Key learning
#include "stm32f10x.h"   GPIO_InitTypeDef GPIO_InitStructure;//声明GPIO_InitStructure   void LED_Init() {  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE); //Turn on GPIOA clock   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //Push-pull output  GPIO_InitStructure.GPIO_S
[Microcontroller]
About STM32GPIO port configuration commands
The following code is taken from the Atomic STM32 Development Guide //Initialize PB5 and PE5 as output ports and enable the clocks of these two ports        void LED_Init(void)   {   GPIO_InitTypeDef GPIO_InitStructure;   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE); //Enable PB, PE
[Microcontroller]
STM32 uses DMA plus serial port idle interrupt to receive data
 In STM32, you need to use the serial port to receive data, and you use the serial port interrupt to receive data. However, if you use this method, you have to frequently enter the serial port interrupt and then process it, which is inefficient. So I thought of using DMA to receive serial port data, which STM32 also su
[Microcontroller]
STM32 uses DMA plus serial port idle interrupt to receive data
Design of STM32 laser power supply control system
  The control system design of the laser power supply is realized by using STM32. Aiming at the practical application of laser welding, this paper has made better expansion and improvement to the functions of the laser power supply. The human-machine interface (HMI) display is used to control the laser power supply. T
[Power Management]
Design of STM32 laser power supply control system
STM32 USB learning notes 7
Host environment: Windows 7 SP1 Development environment: MDK5.14 Target board: STM32F103C8T6 Development library: STM32F1Cube library and STM32_USB_Device_Library Now let's analyze the core file usbd_ioreq in the USB device library. Compared with usbd_ctlreq, the code size of the usbd_ioreq file is smaller. Th
[Microcontroller]
STM32 Notes 8: Say hello to the PC, basic serial communication
a)               Purpose: Based on the success of the basic experiment, practice the serial port debugging method. After the hardware code is successfully completed, debug the printf redefinition needed for future debugging and fix it in your own library function. b)               Initialization function definition:
[Microcontroller]
STM32 GPIO Application Notes
1                      The input and output pins of STM32 have the following 8 possible configurations: (4 inputs + 2 outputs + 2 multiplexed outputs) ①Floating  input_IN_FLOATING ②With  pull-up input_IPU    ③With  pull-down input_IPD                      ④Analog  input_AIN ⑤Open  drain output_OUT_OD         
[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号