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 #348 background imageLoading...
Page #348 background image
HAL IWDG Generic Driver
UM1940
348/1371
DocID028236 Rev 2
Min-max timeout value @32KHz (LSI): ~125us / ~32.7s The IWDG timeout may vary due
to LSI frequency dispersion. STM32F2xx devices provide the capability to measure the LSI
frequency (LSI clock connected internally to TIM5 CH4 input capture). The measured value
can be used to have an IWDG timeout with an acceptable accuracy.
27.2.2 How to use this driver
1. Use IWDG using HAL_IWDG_Init() function to : (+) Enable instance by writing Start
keyword in IWDG_KEY register. LSI clock is forced ON and IWDG counter starts
downcounting. (+) Enable write access to configuration register: IWDG_PR &
IWDG_RLR. (+) Configure the IWDG prescaler and counter reload value. This reload
value will be loaded in the IWDG counter each time the watchdog is reloaded, then the
IWDG will start counting down from this value. (+) wait for status flags to be reset"
2. Then the application program must refresh the IWDG counter at regular intervals
during normal operation to prevent an MCU reset, using HAL_IWDG_Refresh()
function.
(#) Use IWDG using HAL_IWDG_Init() function to :
Enable instance by writing Start keyword in IWDG_KEY register. LSI clock is forced
ON and IWDG counter starts downcounting.
Enable write access to configuration register: IWDG_PR & IWDG_RLR.
Configure the IWDG prescaler and counter reload value. This reload value will be
loaded in the IWDG counter each time the watchdog is reloaded, then the IWDG will
start counting down from this value.
wait for status flags to be reset" (#) Then the application program must refresh the
IWDG counter at regular intervals during normal operation to prevent an MCU reset,
using HAL_IWDG_Refresh() function.
IWDG HAL driver macros list
Below the list of most used macros in IWDG HAL driver:
__HAL_IWDG_START: Enable the IWDG peripheral
__HAL_IWDG_RELOAD_COUNTER: Reloads IWDG counter with value defined in
the reload register
27.2.3 Initialization and Start functions
This section provides functions allowing to:
Initialize the IWDG according to the specified parameters in the IWDG_InitTypeDef of
associated handle.
Once initialization is performed in HAL_IWDG_Init function, Watchdog is reloaded in
order to exit function with correct time base.
This section contains the following APIs:
HAL_IWDG_Init()
27.2.4 IO operation functions
This section provides functions allowing to:
Refresh the IWDG.
This section contains the following APIs:
HAL_IWDG_Refresh()

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