who can give me a demo about wdog of MKE02z16?

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

who can give me a demo about wdog of MKE02z16?

1,082 次查看
wangbaode
Contributor IV

hello everyone,

I have a new project based on mke02z16. i want to configure wdog module.but I'm failed . who can give me a demo about wdog?

0 项奖励
回复
2 回复数

954 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Wang baode,

Please go for download the FRDM-KExx Driver Library package which contains the Watchdog demo for the KE02 through the link as below.

https://cache.nxp.com/files/microcontrollers/software/device_drivers/KEXX_DRIVERS_V1.2.1_DEVD.zip
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

954 次查看
mjbcswitzerland
Specialist V

Hello

The following is the KE02 watchdog configuration code from the uTasker project:

UNLOCK_WDOG();

WDOG_CS2 = (WDOG_CS2_CLK_1kHz | WDOG_CS2_FLG);

WDOG_TOVAL = BIG_SHORT_WORD(2000);  // 2s timeout

WDOG_WIN = 0; // disable windowing operation

WDOG_CS1 = (/*WDOG_CS1_UPDATE | */WDOG_CS1_EN); // enable

It configured a 2s watchdog timeout based on the 1kHz IRC clock.

UNLOCK_WDOG() is WDOG_REFRESH = 0x20c5; WDOG_REFRESH = 0x28d9

The WDOG_CS1_UPDATE flag can be used to allow the watchdog to be reconfigured, rather than being locked from further modification.

Note that the TOVAL is in big-endian format, which often catches people out. Some (original) user manuals incorrectly gave code examples which wrote it in little-endian format which confused.

Regards

Mark

0 项奖励
回复