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.

XT1 enable in MSP430F5338

Other Parts Discussed in Thread: MSP430F5338, MSP430F6438

Hi,

I'm working with MSP430F5338 and trying to enable XT1 (Low frequency). Currently i'm working with evaluation board MSP-TS430Z100C.

My init procedure includes "XT1 start" as follows:

    UCSCTL6 |= XCAP_3;                

     // Internal load cap    

     UCSCTL3 = 0;                             

     // FLL Reference Clock = XT1   

    // If the drive setting is not already set to maximum    

  // Set it to max for LFXT startup    

   if ((UCSCTL6 & XT1DRIVE_3)!= XT1DRIVE_3)

  {         UCSCTL6_L |= XT1DRIVE1_L + XT1DRIVE0_L; // Highest drive setting for XT1startup     }     

  UCSCTL6 &= ~(XT1OFF);                     // XT1 On       

  // Loop until XT1,XT2 & DCO stabilizes - In this case loop until XT1 and DCo settle    

 do     {        

            UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);        

              SFRIFG1 &= ~OFIFG;                      // Clear fault flags        

 }while (SFRIFG1&OFIFG);                   // Test oscillator fault flag         // Xtal is now stable, reduce drive strength    

UCSCTL6 = (UCSCTL6 & ~(XT1DRIVE_3)) | (xtdrive); // set requested Drive mode

 

The XIN/XOUT pins in MSP430F5338 are NOT selectable pins,so i couldn't set the pins as a peripherals(means 32K crystal should be connected always).

The problem is => i couldn't stabilize XT1. It always set as SFRIFG1&OFIFG= TRUE (oscillator FAULT).Please help to solve a problem.

Again,we check a several times that Crystal 32K is connected well according to schematics of evaluation board.It looks like something missing in a configuration....

Thanks,

  • SFRIFG1,OFIFG cannot be cleared as long as any of the OFIFG bits in UCSCTL7 is set. See there which oscillator is making trouble.

    renka said:
      if ((UCSCTL6 & XT1DRIVE_3)!= XT1DRIVE_3)
      {         UCSCTL6_L |= XT1DRIVE1_L + XT1DRIVE0_L; // Highest drive setting for XT1startup     }    


    Why not simply doing UCSCTL6 |= XT1DRIVE_3; ? It serves the same purpose and is shorter and faster. Of course you cannot simply do |=XT1_DRIVE_1 as |= ponly sets bit and doesn't clear them. This operation then would require UCSCTL6 = (UCSCTL6 & ~XT1DRIVE_3)|XT1DRIVE_x;

    However, the F5338 has an RTC_B. It's possible that you need to clear the RTCHOLD bit in RTCCTL1 register to enable the LFXT1. (I dimly remember reading something like that in a different thread but cannot confirm or decline - users guide only tells that clearing the bit will force the XT%1 to be enabled but it doesn't say that setting it - the default - will disable it).

  • Thanks for your answer,but the same problem still exists.

    I see clearly  that in UCSCTL7 XT1LFOFF = 1 (means oscillator fault detection).I've also cleared the RTCHOLD bit in RTCCTL1 regiter.But the XT1LFOFF still has the oscillator fault error.

    Maybe i've missed the selection of XTAL pins,but in MSP5338 the XIN/XOUT are not selectable pins(as i understand). Where is my problem? Please help me.

    P.S. maybe the combination of TI MSP-TS430PZ100C (evaluation board) and MSP430F5338 doesn't work.

    Thanks,

     

  • renka said:
    P.S. maybe the combination of TI MSP-TS430PZ100C (evaluation board) and MSP430F5338 doesn't work.

    That combination is documented as being compatible. What is the VBAT pin connected to?

    According to the user's guide, if there is no backup battery VBAT must be connected to DVCC. For the MSP-TS430PZ100C target board that is done with a jumper on JP11 between pins 1 (DVVC) and 2 (VBAT).

  • In TI MSP430PZ100C THERE IS  a jumber between pins1(DVVC) and 2(VBAT). Maybe i missed something in configuration?

  • I've checked MSP430F6438 as well on the same evaluation board(TS430PZ100c). the same problem with 32Khz exists. XT1LF returns fault detection.

  • renka said:
    I've checked MSP430F6438 as well on the same evaluation board(TS430PZ100c). the same problem with 32Khz exists. XT1LF returns fault detection.

    When using a 32kHz crystal and internal capacitors, teh following parts on teh board need to be removed: C1,C2 (external capaictors) and R6/R8. R6/R8 are connecting the crystal pins with the breakout connector (for external TTL clock signal input of MSPs with port pins multiplexed with XT1).

    If one or more of these parts are present, (parasitic) load capacitance might prevent crystal oscillation.

  • Thanks,

    But i've removed C1,C2,R6 and R8 before starting the test. So the problem of oscillator fault still exists. I think i miss something in XT1 enabling in software. I didn't found any examples from TI site,where XIN/XOUT are not selectable pins.

  • FYI - I had the same problem, and found I had to add:

    // Wait for backup power system to be satisfied with the primary power domain
    while (BAKCTL & LOCKBAK) BAKCTL &= ~LOCKBAK;

    See the Forum post:

    http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/273093.aspx

    for more information.

**Attention** This is a public forum