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.

MSP430F247: Not able to use the external clock on XIN, not a crystal or oscillator

Part Number: MSP430F247

Please help me with this I am not able to proceed.

// Clock Setup
// -- Setup Clock to 16 MHz

__bic_SR_register(OSCOFF); // enable LFXT1 oscillator

BCSCTL1 |= XT2OFF + XTS; // LFXT1CLK is High Frequency
BCSCTL3 |= LFXT1S0 + LFXT1S1;// Digital external 0.4- to 16-MHz clock source
BCSCTL3 &= ~(XCAP0 + XCAP1);
do // wait for oscillator to stablise
{
IFG1 &= ~OFIFG; // clear flag 
// do a delay of at least 50uS
Delay = 0xFF;
while (Delay > 0) Delay--;
}
while ((IFG1 & OFIFG) != 0);// repeat until flag remains cleared
BCSCTL2 |= SELM1 + SELM0; // MCLK Source Select 3: LFXTCLK

  • This is how the input clock looks like
  • The external clock if 16MHz that fed in from CDCLVC1102PWR
  • How I am ensuring that the system uses the external clock. Is by having to check the clock interrupt.

    // -- Setup Timer_A - One MilliSecond Interrupt, use Output Unit 1 for ADC12
    TACTL = TACLR; // Halt and clear the timer
    TACCR1 = TACCR2 = 0; // Halt these counters
    CCR0 = 2000; // 16MHz, interrupt 1msec = 1000/sec

    // SMCLK (Sub-main clock), /8, Count Up @ 1.5 MHz
    TACTL = TASSEL1 + /* Timer A clock source select 1 */
    ID0 + /* Timer A clock input divider 0 */
    ID1 + /* Timer A clock input divider 1 */
    MC0; /* Timer A mode control 0 */
    CCTL0 = CCIE; // Enable interrupt

    I expect it to give me the interrupt every ms.

  • Hello Maneish,

    Were you able to get this working?  Also, an easier way to check the clock is probably to just output SMCLK out of a GPIO, such as P1.4.  

    Also, It seems like you are using an external clock source, not a crystal oscillator.  In this case, you actually need to bypass XT2.  The user's guide says you can do this:

    "XT2 may be used with external clock signals on the XT2IN pin when XT2Sx = 11 and XT2OFF = 0. When used with an external signal, the external frequency must meet the data sheet parameters for XT2. When the input frequency is below the specified lower limit, the XT2OF bit may be set to prevent the CPU from being clocked with XT2CLK."

    Try that and see if you can get it to run from the clock source.  

    Thanks,

    JD

  • Thanks, it got resolved 

**Attention** This is a public forum