cancel
Showing results for 
Search instead for 
Did you mean: 

watchdogtimer parameters cubemx

TARHAN SAMAH
Senior
Posted on July 05, 2018 at 13:53

hello , im testing watchdogtimer in stm32f103cb , now i started by independant wdt  i suceed ,

MX_IWDG_Init();

/* USER CODE BEGIN 2 */

HAL_GPIO_WritePin(led_GPIO_Port, led_Pin, GPIO_PIN_SET);//off

HAL_Delay(1000);

/* USER CODE END 2 */

/* Infinite loop */

/* USER CODE BEGIN WHILE */

while (1)

{

HAL_IWDG_Refresh(&hiwdg);//put counter to zero to not reach 6553,6 ms for 64 prescaler

HAL_GPIO_WritePin(led_GPIO_Port, led_Pin, GPIO_PIN_RESET);//on

HAL_Delay(9000);

/* USER CODE END WHILE */

}

i coudlnt understand the window one , any way my question is :

in cube mx we control the timout of the wdt by 

0690X0000060LdfQAE.png

if i select 64 as prescaler according to the datasheet it means my timout is 6553,6 ms for example

so what is the meaning of 4095 the downcounter ? what is the downcounter role ??

thanks for ansewering 

2 REPLIES 2
aa bb_2
Associate II
Posted on July 05, 2018 at 14:13

Hi, 

The prescaler 64 is used as a divider of the WDG clock. The countdown timer is the number of tick clock until the WDG resets.

TARHAN SAMAH
Senior

thanks much i have another question , i want to reset my nucleo kart using a keypad ok ,

if i push a key it should reset my software

if i use for example prescaler 16 so the timout is

2048 ms

if key=='R'

{

hal_delay(2500);//provocate the iwdt to reset

}

i dont want use this dely i want to put directly the iwdt register to reset

how can i do that ,, direct acces reset register

( i mean oposite of refresh action HAL_IWDG_Refresh(&hiwdg);)

thanks