bigmac, you set the clock source to the CGMVCLK before it locks. not sure if this is a good idea.
i am having problem with the PLL locking on a design. thought i was doing something wrong so i used processor expert to verify and here is what they came up with. (32.768kHz crystal, 8MHz bus clk desired).
PCTL_BCS = 0; /* Select clock source from XTAL */
PCTL_PLLON = 0; /* Disable the PLL */
PMS = 977; /* Set the multiplier */
PMRS = 208; /* Set the range select */
PCTL = 0;
PCTL_VPR = 2;
PBWC = 128; /* Select the operating modes */
PCTL_PLLON = 1; /* Enable the PLL */
while(!PBWC_LOCK); /* Wait */
PCTL_BCS = 1;
here is my code.
PCTL_PLLON = 0;
PCTL_VPR = 1; //E = 2
PCTL_PRE = 0; //P = 0 Fvrs = Lx(2^E)x125000
PMS = 0x03d1; //N = 977 N = Fvclk/crystal
PMRS = 0x40; //L = 64
PMDS = 1; //R = 1
PBWC_AUTO = 1;
PCTL_PLLON = 1;
while (PBWC_LOCK == 0) //wait for lock
;
PCTL_BCS = 1; //switch to PLL
not sure why PE uses a value of 208 for L. anyone have any ideas?