Hi!
I have a problem with the accuracy of the XT1 oscillator. I am using launchpad f5529.
I set up the UCS so that ACLK is sourced by XT1, then sourced Timer A with ACLK.
Made a simple program which toggles the LED1 with 8 Hz frequency.
I measured the frequency of the signal directly at the crystal: 32.766 Khz
And the frequency I get at the led: 8.0898 Hz.
This is a significant, more than 1% difference!!!
My initialization of the UCS: (I used driverlib for FLL, and I did not touch the UCS settings apart from these)
PMM_setVCore(PMMCOREV_3);
P5SEL |= BIT2 + BIT3 + BIT4 + BIT5;
UCS_initFLLSettle(24903,760);
UCSCTL5 |= DIVS_1; //smclk divide by 2
As I reckon ACLK gets sourced from XT1 by default..
For timer A:
TA0CTL |= TASSEL__ACLK + MC__CONTINOUS;
And my program:
while(1)
{
tmp=TA0R;
LED1_TG;
while(TA0R!=tmp+2048);
}
What am I missing here? It seems as if ACLK does not come from XT1 after all...
I checked the XT1LFOFFG which is set after initialization, but if I reset it, it remains zero so the oscillator seems to run just fine.
Thank you!