who can give me a demo about wdog of MKE02z16?

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

who can give me a demo about wdog of MKE02z16?

1,085 Views
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 Kudos
Reply
2 Replies

957 Views
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 Kudos
Reply

957 Views
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 Kudos
Reply