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.

external oscillator

Other Parts Discussed in Thread: MSP430F5171

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

  • After PUC, XIN and XOUT pins are set to general-purpose I/Os and XT1 remains disabled until the I/O ports are configured for XT1 operation. You must define pins (PJ.4 and PJ.5) for XTAL function (PJSEL).

    Increasing core voltage is only needed when internal DCO is used. You are using external XTAL, so there is no need to change core voltage.

  • Enzo Ternavasio said:
    but it doesn't exit loop, fault flag is always on.

    According to the MSP430F5171 datasheet, for XIN to be used in bypass mode both the XT1BSYPASS and PJSEL.5 control bits need to be set. i.e. try adding the following to the configuration code:

      PJSEL |= BIT5;

  • Thanks for your help, i didn't program Xout.

    But the problem remains:  MSP430F5171 doesn't work at frequencies that apporach 20MHz, notwistanding the data sheet that claims 24Mhz (or 32MHz).

    I have tested this in 2 different boards, 2 and 4 layers.

    I wasted a lot of time with emulator that loosed control of micro.

    Enzo Ternavasio

  • Enzo Ternavasio said:
    I wasted a lot of time with emulator that loosed control of micro

    What is the supply voltage?

    Does the VCORE pin have the recommended 470nF capacitor fitted? (have seen other threads where insufficient capacitance on VCORE caused intermittent operation)

     

  • Hi Chester,

    it was the capacitor on that pin! I did'n look carefully at data sheet, note 2 (but why is it not written more clearly, due its importance?)

    Now it runs at 24Mhz with irs internal oscillator.

    Thanks a lot and best wishes, Enzo Ternavasio

     

**Attention** This is a public forum