dan buday

PLL help for mc68hc908ap

Discussion created by dan buday on Jul 17, 2007
Latest reply on Aug 6, 2007 by Processor Expert
Hi All,
 
I am new to using freescale microcontrollers and would appreciate any help I can get.  I have got everything I need for my project working except the phased locked loop(PLL).  The controller seem to want to stay working at a 2Mhz bus speed.  I a clocking off a 8Mhz x-tal and want the bus frequency also at 8Mhz. Below is the register setting I have put into codewarrior. 
 
PCTL_PLLIE = 0;//turns off PLL interupt
  PCTL_PLLON = 0;//turn off PLL so can set P,R,N,E and L
 
  PCTL_PRE0 = 0;//sets P to 0
  PCTL_PRE1 = 0;//sets P to 0
 
  PCTL_VPR0 = 0;//sets E to 2
  PCTL_VPR1 = 1;//sets E to 2
 
  PMSH_MUL11 = 0;//sets N to 4
  PMSH_MUL10 = 0;//sets N to 4
  PMSH_MUL9 = 0;//sets N to 4
  PMSH_MUL8 = 0;//sets N to 4
  PMSL_MUL7 = 0;//sets N to 4
  PMSL_MUL6 = 0;//sets N to 4
  PMSL_MUL5 = 0;//sets N to 4
  PMSL_MUL4 = 0;//sets N to 4
  PMSL_MUL3 = 0;//sets N to 4
  PMSL_MUL2 = 1;//sets N to 4
  PMSL_MUL1 = 0;//sets N to 4
  PMSL_MUL0 = 0;//sets N to 4
 
  PMRS_VRS7 = 0;//sets L to 64
  PMRS_VRS6 = 1;//sets L to 64
  PMRS_VRS5 = 0;//sets L to 64
  PMRS_VRS4 = 0;//sets L to 64
  PMRS_VRS3 = 0;//sets L to 64
  PMRS_VRS2 = 0;//sets L to 64
  PMRS_VRS1 = 0;//sets L to 64
  PMRS_VRS0 = 0;//sets L to 64
 
  PMDS_RDS3 = 0;//sets R to 1
  PMDS_RDS2 = 0;//sets R to 1
  PMDS_RDS1 = 0;//sets R to 1
  PMDS_RDS0 = 1;//sets R to 1
  

  PCTL_PLLON = 1;//turn on PLL
  
    PCTL_BCS = 1;//set CGMPCLK to source CGMOUT
      PBWC_AUTO = 1;//Automatic bandwidth control
  while(PBWC_LOCK == 0){
  }
 
thanks
dan

Outcomes