WDOG TOVALH and TOVALL

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

WDOG TOVALH and TOVALL

1,260 次查看
mrandreas
Contributor III

In term of setting the minimum time for the watch dog to be updated. Has someone made the conversion from microsecond to setting the tovalh and tovall when using the ALT CLK \ bus clk or LPO?

Thanks

Andreas

标签 (1)
标记 (1)
1 回复

1,043 次查看
Robinwithu
Senior Contributor I

Hi Andreas,

Here i did for MC9S08RN16 micro controller

/* Initialize watchdog with ~1-kHz clock source, ~1s time-out */

DisableInterrupts; // disable global interrupt

WDOG_CNT = 0xC520; // write the 1st unlock word

WDOG_CNT = 0xD928; // write the 2nd unlock word

WDOG_TOVAL = 1000; // setting timeout value

WDOG_CS2 = WDOG_CS2_CLK_MASK; // setting 1-kHz clock source

WDOG_CS1 = WDOG_CS1_EN_MASK; // enable counter running

EnableInterrupts; // enable global interrupt

Thanks and Regards,

Robin