cancel
Showing results for 
Search instead for 
Did you mean: 

IWDG without reset

Carter Lee
Associate III
Posted on September 27, 2017 at 10:00

Hi.

I'm trying to implement such as watch dog program, and I know STM32 supports 2 kind of function.

the name of IWDG and WWDG. But I just needed such as simple watch dog(under 40KHZ), so I just planned with IWDG.

but I heard that the IWDG's purpose is system reset. but I just want to check whether something signal toggled or not in the given time. what if it does not toggled in the given time then just want PA0 is active high, not want to reset. but If I use IWDG, then I think my system will be have a system reset . But I don't it. So.

So If I want to heck this function, what am I supposed to do ?

1 ACCEPTED SOLUTION

Accepted Solutions
Danish1
Lead II
Posted on September 27, 2017 at 10:22

The watchdogs are to catch entire system-lockup. During lockup, the processor might be doing anything and be in any state (e.g. stack pointer not valid so it's not possible save the state). The only safe solution is for watchdog-timeout to always generate a reset. So that's what is does.

(Yes I know window-watchdog can generate an interrupt when nearly-timed-out. But that's not at full timeout).

You could use a timer to generate an interrupt.

Have the appropriate interrupt-handler set the 'thing hasn't happened within interval' flag.

Of course that means you can't shut down whatever clock is used to drive the timer, so it's more complicated to enter low-power modes.

Hope this helps,

Danish

View solution in original post

3 REPLIES 3
Danish1
Lead II
Posted on September 27, 2017 at 10:22

The watchdogs are to catch entire system-lockup. During lockup, the processor might be doing anything and be in any state (e.g. stack pointer not valid so it's not possible save the state). The only safe solution is for watchdog-timeout to always generate a reset. So that's what is does.

(Yes I know window-watchdog can generate an interrupt when nearly-timed-out. But that's not at full timeout).

You could use a timer to generate an interrupt.

Have the appropriate interrupt-handler set the 'thing hasn't happened within interval' flag.

Of course that means you can't shut down whatever clock is used to drive the timer, so it's more complicated to enter low-power modes.

Hope this helps,

Danish

Carter Lee
Associate III
Posted on September 27, 2017 at 10:49

I can't find  

TIM1_IRQn like TIM2_IRQn. I think TIM1 is separated with more functionality.

What is the more fit to me to implement a simple timer?  which TIM1_xxxxx should I have to use?

TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */

TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */

TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */

TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */

TIM2_IRQn = 28, /*!< TIM2 global Interrupt
Posted on September 27, 2017 at 10:30

Thanks I think it's good Idea, Could you introduce any reference to implement ?