EmbeddedRelated.com
Forums

Problem with MSP430F249 XT2

Started by "stephen.dyble" May 8, 2012
Hi All

Is there anybody out there that has used XT2 in the HF mode on the MSP430F249?. I have tried the example code from TI (using CCS4) but
it seems to never leave the loop checking the OSIFG bit. I am using
a 7.3728Mhz Crystal with 22pf loading caps from XT2IN and XT2OUT to ground and as far as I have tested, the hardware is fine (3V3 supply, reset line high, no short or open circuits, etc...) have tried it without the caps too, and have replaced the crystal just in case.

Code from TI example 'msp430x24x_hfxt2.c'

#include "msp430x24x.h"

volatile unsigned int i;

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P5DIR |= 0x10; // P5.4= output direction
P5SEL |= 0x10; // P5.4= MCLK option select
P1DIR |= 0x02; // P1.1 = output direction
BCSCTL1 &= ~XT2OFF; // Activate XT2 high freq xtal
BCSCTL3 |= XT2S_2; // 3 16MHz crystal or resonator
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFF; i > 0; i--); // Time for flag to set
}
while (IFG1 & OFIFG); // OSCFault flag still set?
BCSCTL2 |= SELM_2; // MCLK = XT2 HF XTAL (safe)
for (;;) // Infinite loop
{
P1OUT |= 0x02; // P1.1 = 1
P1OUT &= ~0x02; // P1.1 = 0
}
}

Being that this is the simplest of all peripherals and there was an example available, it eludes me as to why I can't get it to function.
Am I missing something?

Regards
Steve

Beginning Microcontrollers with the MSP430