2018-07-05 04:53 AM
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);//offHAL_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
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
2018-07-05 05:13 AM
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.
2018-08-07 05:15 AM
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