EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #692 background imageLoading...
Page #692 background image
HAL WWDG Generic Driver
UM1940
692/1371
DocID028236 Rev 2
The WWDG counter input clock is derived from the APB clock divided by a
programmable prescaler.
WWDG clock (Hz) = PCLK1 / (4096 * Prescaler)
WWDG timeout (mS) = 1000 * Counter / WWDG clock
WWDG Counter refresh is allowed between the following limits :
min time (mS) = 1000 * (Counter _ Window) / WWDG clock
max time (mS) = 1000 * (Counter _ 0x40) / WWDG clock
Min-max timeout value at 50 MHz(PCLK1): 81.9 us / 41.9 ms
The Early Wakeup Interrupt (EWI) can be used if specific safety operations or data
logging must be performed before the actual reset is generated. When the
downcounter reaches the value 0x40, an EWI interrupt is generated and the
corresponding interrupt service routine (ISR) can be used to trigger specific actions
(such as communications or data logging), before resetting the device. In some
applications, the EWI interrupt can be used to manage a software system check
and/or system recovery/graceful degradation, without generating a WWDG reset. In
this case, the corresponding interrupt service routine (ISR) should reload the WWDG
counter to avoid the WWDG reset, then trigger the required actions. Note:When the
EWI interrupt cannot be served, e.g. due to a system lock in a higher priority task, the
WWDG reset will eventually be generated.
Debug mode : When the microcontroller enters debug mode (core halted), the WWDG
counter either continues to work normally or stops, depending on
DBG_WWDG_STOP configuration bit in DBG module, accessible through
__HAL_DBGMCU_FREEZE_WWDG() and __HAL_DBGMCU_UNFREEZE_WWDG()
macros
49.2.2 How to use this driver
Enable WWDG APB1 clock using __HAL_RCC_WWDG_CLK_ENABLE().
Set the WWDG prescaler, refresh window, counter value and Early Wakeup Interrupt
mode using using HAL_WWDG_Init() function. This enables WWDG peripheral and
the downcounter starts downcounting from given counter value. Init function can be
called again to modify all watchdog parameters, however if EWI mode has been set
once, it can't be clear until next reset.
The application program must refresh the WWDG counter at regular intervals during
normal operation to prevent an MCU reset using HAL_WWDG_Refresh() function.
This operation must occur only when the counter is lower than the window value
already programmed.
if Early Wakeup Interrupt mode is enable an interrupt is generated when the counter
reaches 0x40. User can add his own code in weak function
HAL_WWDG_EarlyWakeupCallback().
WWDG HAL driver macros list
Below the list of most used macros in WWDG HAL driver.
__HAL_WWDG_GET_IT_SOURCE: Check the selected WWDG's interrupt source.
__HAL_WWDG_GET_FLAG: Get the selected WWDG's flag status.
__HAL_WWDG_CLEAR_FLAG: Clear the WWDG's pending flags.
49.2.3 Initialization and Configuration functions
This section provides functions allowing to:
Initialize and start the WWDG according to the specified parameters in the
WWDG_InitTypeDef of associated handle.
Initialize the WWDG MSP.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals