This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hi everyone,
Clock I need is ACLK with 32768-Hz and the 135-MHz(or the maximum frequency I can set with this chip) with SMCLK and MCLK.
ACLK has finished setting as the 32768-Hz but I have a trouble with SMCLK and MCLK.
But the most important of all, it is shown that the chip can only operate with the maximum frequency 20-Mhz.
And the question is that, can I really make the frequency up to 135-MHz?
What is the meanings in the 5.16 and 5.19 in the datasheet of this chip?
Crystal of XT2 and the capacitance I use are 24-MHz and 15 pf.
I have check on the sample code which named msp430f6xx_UCS08, 07, 04 and 03, and make a change.
Do I have any registers that is miss setting or error setting?
Now, the MCLK output is 4.9-MHz, and the code for register setting is below,
while(BAKCTL & LOCKBAK)//Unlock XT1 pins for operation
BAKCTL &= ~(LOCKBAK);
UCSCTL6 &= ~(XT2OFF + XT1OFF);//Enable XT1 and XT2
UCSCTL6 |= XT2DRIVE_3 + XCAP_3;//XT2 Drive Level mode:3, Internal load cap
UCSCTL4 = SELA__XT1CLK + SELS__DCOCLK + SELM__DCOCLK;//ACLK=XT1,SMCLK=DCO,MCLK=DCO
UCSCTL3 = SELREF__XT2CLK ;//FLLREF=XT2
UCSCTL2 |= FLLD__32;
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);//Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG;//Clear fault flags
}while(SFRIFG1&OFIFG);
Hi Guyan and Clemens,
I know that there is not many knowledge about the clock system in the MSP430.
Now, my trouble is that, I have checked the route of the UCS Block Diagram and the registers in the datasheet of MSP430x5xx Family.
I have tried to use 24-MHz on XT2 and use 32768-Hz with FLL.
And no matter how I set, the clock from P3.4 (I set the SMCLK and CLK as DCOCLK) only around 5-MHz.
Maybe I am in a mess, but could you teach me how to check .
I use 32768-Hz on XT1, and I decided to use FLL to run with 25-MHz.
The code is changed from sample code,
while(BAKCTL & LOCKBAK)//Unlock XT1 pins for operation
BAKCTL &= ~(LOCKBAK);
UCSCTL6 &= ~(XT1OFF);//XT1 On
UCSCTL6 |= XCAP_3;//Internal load cap
do//Loop until XT1 fault flag is cleared
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);//Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG;//Clear fault flags
}while (SFRIFG1&OFIFG);//Test oscillator fault flag
__bis_SR_register(SCG0); //Disable the FLL control loop
UCSCTL0 = 0x0000; //Set lowest possible DCOx, MODx
UCSCTL1 = DCORSEL_3;
UCSCTL2 = FLLD_1 + 761;
//(N + 1) * FLLRef = Fdco
//Set FLL Div = fDCOCLK/2
UCSCTL3 |= FLLREFDIV__4;
UCSCTL4 = SELM__DCOCLK + SELS__DCOCLK + SELA__XT1CLK;
__bic_SR_register(SCG0); //Enable the FLL control loop
__delay_cycles(76563);
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);//Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG;//Clear fault flags
}while (SFRIFG1&OFIFG);//Test oscillator fault flag
Sincerely,
Norton
**Attention** This is a public forum