Help with watchdog

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

Help with watchdog

3,290 次查看
kubanb
Contributor III

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

标记 (1)
4 回复数

3,148 次查看
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

3,148 次查看
kubanb
Contributor III

Thank you, I appreciate your help.

0 项奖励
回复

3,148 次查看
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 项奖励
回复

3,148 次查看
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 项奖励
回复