Thomas Payne

Watchdog for MCF52235 - Cannot turn it on

Discussion created by Thomas Payne on Dec 15, 2006
Latest reply on Dec 19, 2006 by Thomas Payne
Working with ColdFire_Lite Tcp Stack.  Having an issue with unresponsive TCP or general lockup.  Thought I would enable watchdog.
 
Changed mcf5223_wtm_init in mcf5223_sysinit.c to turn on Watchdog.
void mcf5223_wtm_init(void)
{
 /*
 * Enable Software Watchdog Timer - Timing 2^23 * Bus Freq
 */
 MCF_SCM_CWCR =  MCF_SCM_CWCR_CWT(5)  |
     MCF_SCM_CWCR_CWE  |
     MCF_SCM_CWCR_CWTA  |
     MCF_SCM_CWCR_CWTAVAL |
     MCF_SCM_CWCR_CWTIC  ;
           
 MCF_INTC0_ICR8  =  MCF_INTC_ICR_IL(2);     
 MCF_INTC0_IMRL &= ~(MCF_INTC_IMRL_MASK8);
  
 MCF_SCM_CWSR = 0x55;
 MCF_SCM_CWSR = 0xAA;
}
 
Tried without setting    CWTA,  CWTAVAL,  & CWTIC  also.
 
Added _watchdog_handler to mcf5223_vectors.s as .extern and to vector48:
 .extern _watchdog_handler
vector48: .long  _watchdog_handler //_irq_handler
 
Added  watchdog_handler to Int_handlers.c to perform soft reset
__interrupt__
void watchdog_handler (void)
{
  mcf5xxx_irq_disable();
 MCF_CIM_RCR |= MCF_CIM_RCR_SOFTRST;  //TEP Software Reset *********************** 
}
 
Purposely did not service the CWSR on a periodic basis for test.
 
What am I doing wrong.
 

Outcomes