Hi Mark,
Thank you for the feedback. In response to your question I "shurnk" my code so that there was only a while(1) with a LED toggle, watchdog kick, and small delay. This reduced code works correctly in that the watchdog doesn't trip. This means there is something else in my code after wakeup that is delaying the watchdog kick.
My main execution loop wakes up on a PIT interrupt. The interrupt fires every 1 msec and a flag is set to indicate an execution cycle should begin every 250 interrupts. This yields a 250 msec cycle time. On exit from sleep mode the watchdog is tripping after about 172 of these 1 msec interrupts. Looking at the Processor Expert Cpu_SetOperationMode() it appears the clock is being configured differently after wakeup than at __init_hardware(). I don't have a scope available but I'm thinking the clock is running slower after wakeup than it ran prior to sleep mode.
Cpu_SetOperationMode()
...
if ((MCG_S & MCG_S_CLKST_MASK) != MCG_S_CLKST(3)) { /* If in PBE mode, switch to PEE. PEE to PBE transition was caused by wakeup from low power mode. */
/* MCG_C1: CLKS=0,IREFS=0 */
MCG_C1 &= (uint8_t)~(uint8_t)((MCG_C1_CLKS(0x03) | MCG_C1_IREFS_MASK));
while( (MCG_S & MCG_S_LOCK0_MASK) == 0x00U) { /* Wait for PLL lock */
}
}
...
__init_hardware()
/* MCG_C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
MCG_C1 = (MCG_C1_CLKS(0x02) | MCG_C1_FRDIV(0x03) | MCG_C1_IRCLKEN_MASK);
Thank you for pointing me in the right direction.