WDOG TOVALH and TOVALL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WDOG TOVALH and TOVALL

682 Views
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

Labels (1)
Tags (1)
1 Reply

465 Views
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