How enable watchdog timer for CF51223x nixheliet demo baord?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How enable watchdog timer for CF51223x nixheliet demo baord?

785件の閲覧回数
TVNAIDU
Contributor III

How enable watchdog timer for CF51223x nixheliet demo baord?

ラベル(1)
0 件の賞賛
返信
1 返信

649件の閲覧回数
mjbcswitzerland
Specialist V

Hi

 

The M5223x has a watchdog that generates an interrupt.

To use this as a watchdog (2s timeout) the following code can be used (whereby the WATCHDOG_2_SEC needs to be defines to suit the bus clock speed):

 

CWCR = (CWE | WATCHDOG_2_SEC | CWTA | CWTAVA | CWTIF);

fnSetIntHandler(SW_WD_VECTOR, (unsigned char *)_sw_wdog_timeout);

IC_ICR_0_8 = (INTERRUPT_LEVEL_7 | INTERRUPT_PRIORITY_7);

IC_IMRL_0 &= ~(SW_WDG_PIF_INT_L | MASK_ALL_INT);

 

The interrupt handler can reset the processor with something like:

static __interrupt__ void _sw_wdog_timeout(void)
{
    RESET_RCR = SOFT_RST;                                                // command a soft reset of the board
}

 

Regards

 

Mark

 

 

 

 

 

0 件の賞賛
返信