Tool/software: TI C/C++ Compiler
hello Sir,
please help me to slove the problem, i my pcb i am using msp430fr5729 controller in that i have used 8 mhz clock and for that i had made changes in CSCTL register as shown below, my problem is that in my some pcb my code get stuck in "do..while" loop which is given below but in some pcb it does not stuck there and was working fine. The ratio for working out of not working is 7/10 works and 3/10 fail. i just want to what is the problem?, the same code loaded in all 10 pcb out of which in 3 it was stuck in do while loop, does there will be problem in crystal or in controller, please help me to slove this.
CSCTL0_H = 0xA5; // clock 8MHZ
CSCTL1 |= DCOFSEL0 + DCOFSEL1; // Set max. DCO setting
CSCTL2 = SELA_3 + SELS_3 + SELM_3; // set ACLK = XT1; MCLK = DCO
CSCTL3 = DIVA_0 + DIVS_0 + DIVM_0; // set all dividers
CSCTL4 |= XT1DRIVE_0;
CSCTL4 &= ~XT1OFF;
do
{
CSCTL5 &= ~XT1OFFG;
// Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
}while (SFRIFG1&OFIFG); // Test oscillator fault flag