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