// 1. Enable the IWDG by writing 0x0000 CCCC in the IWDG_KR register.
IWDG->KR = 0xCCCC;
// 2. Enable register access by writing 0x0000 5555 in the IWDG_KR register.
IWDG->KR = 0x5555;
// 3. Write the IWDG prescaler by programming IWDG_PR from 0 to 7.
IWDG->PR = 7;
// 4. Write the reload register (IWDG_RLR).
IWDG->RLR = 0xFFF;
// 5. Wait for the registers to be updated (IWDG_SR = 0x0000 0000).
while (IWDG->SR);
// 6. Refresh the counter value with IWDG_RLR (IWDG_KR = 0x0000 AAAA)
IWDG->KR = 0xAAAA;
I tried to enter the code and readjust it to make the timer be 1 second, but it resets first instead.