AnsweredAssumed Answered

Watchdog in MQX 3.5.1

Question asked by Elco Elettronica on Jul 28, 2010
Latest reply on Dec 13, 2010 by David E Seymour

Hi Everybody.


I'm trying to enable the watchdog timer in my software, I've decided to use the core watchdog.


I've setted at 1 the define MQX_USE_SW_WATCHDOGS, and I've installed the watchdog isr with this two function:


  _int_install_isr(MCF5225_INT_SWT,(void (_CODE_PTR_)(pointer))Core_WatchDog_Expire_Handle, NULL);
And than I've create the watchdog isr routine that is this function:

void Core_WatchDog_Expire_Handle(pointer)
    VMCF5225_STRUCT_PTR reg_ptr = _PSP_GET_IPSBAR();
    reg_ptr->CCM.RCR = 0x80;


And the watchdog it's working well.


Now my question is: why the MQX manage the watchdog refresh into the PIT0 isr routine?


I think it's better to refresh the watchdog timer into the main of the software, because if the main is blocked the watchdog timer reaches the underflow and the interrupt is generated and if the interrupt is blocked the main is not running(because the interrupt as an higher priority) and the watchdog is reached too.
Instead if the watchdog timer is refreshed into the PIT0 isr and if the main is blocked but the interrupt it's running the watchdog will never reached.