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.

msp430f5529LP Clock Questions

Other Parts Discussed in Thread: MSP430F5529, ADS1258

Dear TI Community,

I have some questions about MSP430F5529 Clock setting and accuracy. My goal is to generate 16MHz MCLK and 8MHz SPI clock in order to communicate with ADS1258. But at first I would like to be familiar with the F5529 clock settings and calibration.

At first I have setup the LP to use XT2 source

void UseXT2Clock(void)
{
	GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5,GPIO_PIN2);
	GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5,GPIO_PIN13);

	UCS_setExternalClockSource(32000,4000000);
	UCS_XT2Start(UCS_XT2DRIVE_4MHZ_8MHZ);

	UCS_clockSignalInit(UCS_MCLK ,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);
	UCS_clockSignalInit(UCS_SMCLK ,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);
}

The SMCK signal on P2.2 seems very stable and accurate. But this freq. (4MHz) is not enough for my purpose so I have to change to DCO + FLL Calbiration.

Here is my Clock init code for 4MHz

void UseDCOClock(void){

	    // Set VCore for 16MHz
	    PMM_setVCore(PMM_CORE_LEVEL_3);

	    //Set DCO FLL reference = REFO
	    UCS_clockSignalInit(UCS_FLLREF,UCS_REFOCLK_SELECT,UCS_CLOCK_DIVIDER_1);

	    // Ratio = MCLK_FREQ_KHZ / FFL_REF ~ 4000 / 32.768 = 122.07
	    UCS_initFLLSettle(4000,122);
}

And the result of the Logic Analyzer

As you can see there are many clock phase don't match the requested 4Mhz. What is the reason of the inaccuracy? Is it? "4000 / 32.768 = 122.07" If I increase the clock speed to 16MHz this ratio will be 488,28. How does this "error" effect on the SPI clock? I mean, does the SPI communication stable and accurate despite of this error?

 My second question is shall I use XT2 for FLLREF for DCO in order to get accurate 16Mhz clock signal?

Looking forward your kind reply,

  • The DCO can only generate 256 different frequencies,as there are only 8 DCORSELx and 32 DCOx settings. also, these 256 frequencies drift with VCC and temperature. To provide more than those few frequencies, the DCO uses modulation by switching between two frequencies with a certain pattern. This introduces a certain jitter. Also, there is a long-time jitter by the FLL adjusting the DCOx and MODx bits up and down while comparing the average output frequency to the reference frequency.

    However, SPI is synchronous. This means the master give the clock, and as long as the clock doesn't exceed the maximum slave SPI hardware clock frequency, and the average clock frequency over a byte doesn't exceed the maximum speed the slave can handle the byte(s), the clock jitter is unimportant and doesn't affect the stability of the SPI transfer.

**Attention** This is a public forum