Thank you robin. Unfortunately the code that I work with will not work on the tower.
I do have some more questions.
1. I am setting the MGC_SC and the SIM_DIV registers before entering VLPR. I actually set up the MGC_SC register in the FEI state. Does the FCRDIV setting have any effect while in in any other mode such as RUN as long as the internal fast clock is not enabled?
2. Does this setting of FCRDIV look correct? I am setting this in the FEI state.
// Set FCRDIV to 0 so that when the internal fast clock is used it will not
// be divided down. This will allow us to get to the max frequency of the
// 4 Mhz fast clock.
unsigned char tempRegister = MCG_SC;
tempRegister &= ~(MCG_SC_FCRDIV_MASK);
tempRegister |= MCG_SC_FCRDIV(0);
MCG_SC = tempRegister;
3. I am setting the dividers just before entering VLPR mode. MSGCLKOUT should be at 4 Mhz because of the setting of FCRDIV. Does this look correct?
// The MSGCLKOUT is then divided by SIMDIV of 0, 0, 0, 7.
//
// 0 = divide by 1
// 7 = divide by 8
//
// Thus, the following rates apply in this situation:
// Core/System = 4Mhz
// Bus = 4Mhz
// Flexbus = 4Mhz
// Flash = 500Khz // Cannot go over 800 due to security processor errata
// see section 6.5.2 VLPR mode clocking in reference manual
SetSysDividers2( 0, 0, 0, 7 );
Thank you.