Hello ! everyone, I`m configure MSP4305324 UCS
XT2 is connected 4Mhz crystal
then I want to configure it to FLL then MCLK select DCOCLK to 8Mhz
but not succeed,Does anyone help me to figure out it ? Thanks。
code:
P5SEL |= BIT2+BIT3; // Port select XT2
//System clock Set(XT2 4M to 8M)
UCSCTL6 &= ~XT2OFF; // Enable XT2
UCSCTL6 &= ~XT2DRIVE0;
UCSCTL6 &= ~XT2DRIVE1;
UCSCTL6 &= ~XT2BYPASS;
UCSCTL3 = SELREF__XT2CLK; // FLLref = XT2
UCSCTL4 = SELA_2+ //ACLK=REFOCLK
SELS__DCOCLK + //SMCLK=DCOCLK
SELM__DCOCLK; //MCLK=DCOCLK
__bis_SR_register(SCG0); // Disable the FLL control loop
UCSCTL0 = 0x0000;
UCSCTL1 = DCORSEL_5;
UCSCTL2 = FLLD_0 + 1 ; //4M*(N+1)=8M
__bic_SR_register(SCG0); // Enable the FLL control loop
// Loop until XT1,XT2 & DCO stabilizes - in this case loop until XT2 settles
do
{
UCSCTL7 &= ~XT2OFFG; // Clear XT2,XT1,DCO fault flags
}while ( UCSCTL7 & XT2OFFG ); // Test oscillator fault flag