Micro MSP430F5171
At 20 Mhz with its internal clock i have found a lot of instability. Thsi with 2 different boards.
So i decided to put a 24MHz extarnal oscillator in hope this wil fix all. Clock inialization is:
void clock(void)
{
volatile unsigned long i;
// Increase Vcore setting to level3 to support fsystem=25MHz
// NOTE: Change core voltage one level at a time..
SetVcoreUp (0x01);
SetVcoreUp (0x02);
SetVcoreUp (0x03);
// configure clocks
UCSCTL1|=DISMOD; //Disable modulator
UCSCTL4=0; //ACLK=SMCLK=MCLK=XT1
UCSCTL6|=XT1DRIVE_3; //Drive strength for 25MHz
UCSCTL6|=XTS; //HF oscillator - 1 or 0 should not be important
UCSCTL6|=XT1BYPASS; //XT1 bypass oscillator circuit
UCSCTL6&=~XT1OFF; //XT1 enabled
__delay_cycles(782000);
// Loop until XT1 fault flag is cleared
do
{
UCSCTL7 &= ~(XT1LFOFFG + XT1HFOFFG+ DCOFFG);
// Clear XT1,DCO fault flags
SFRIFG1 &= ~OFIFG; // Clear fault flags
}while (SFRIFG1&OFIFG); // Test oscillator fault flag
}
but it doesn't exit loop, fault flag is always on.
Thanks, Enzo