Help with watchdog

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

Help with watchdog

2,254 Views
kubanb
Contributor III

Does anyone know a trick to get the watchdog timer working on frdm-kv31f using KSDK_1.3.0? 

Tags (1)
4 Replies

2,112 Views
mjbcswitzerland
Specialist V

Hi Barry

It is not exactly KDSK_1.3.0 code but it is all needed:

// This sequence must be performed within 20 bus cycles (after reset) and the writes are possible during the WCT period

//

UNLOCK_WDOG();
WDOG_TOVALL = (2000/5);
WDOG_STCTRLH = (WDOG_STCTRLH_STNDBYEN | WDOG_STCTRLH_WAITEN | WDOG_STCTRLH_STOPEN | WDOG_STCTRLH_WDOGEN) // watchdog enabled to generate reset on 2s timeout (no further updates allowed - various options possible)

// Retrigger
// (protect from interrupts!)
//
_uDisable_Interrupt();
REFRESH_WDOG();
_uEnable_Interrupt();

where unlock sequence is:
WDOG_UNLOCK = WDOG_UNLOCK_SEQUENCE_1; // 0xc520
WDOG_UNLOCK = WDOG_UNLOCK_SEQUENCE_2; // 0xd928

and retrigger sequence is:

WDOG_REFRESH = WDOG_REFRESH_SEQUENCE_1; // 0xa602
WDOG_REFRESH = WDOG_REFRESH_SEQUENCE_2; // 0xb480

Regards

Mark


Complete KV31 solutions, training and support:http://www.utasker.com/kinetis.html
Kinetis KV31:
- http://www.utasker.com/kinetis/TWR-KV31F120M.html
- http://www.utasker.com/kinetis/FRDM-KV31F.html

FreeMaster: http://www.utasker.com/kinetis/FreeMASTER.html

2,112 Views
kubanb
Contributor III

Thank you, I appreciate your help.

0 Kudos

2,112 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Barry,

There is kv31 wdog demo in ksdk1.3.0 package. Please see it in

KSDK_1.3.0\examples\frdmkv31f\driver_examples\wdog

Regards,

Jing

0 Kudos

2,112 Views
kubanb
Contributor III

I feel really stupid for not finding the WDOG example in KSDK_1.3.0.  I haven't yet figured out why my code doesn't work but the example does... it looks the same. 

0 Kudos