Hello, I'm trying to set up my MSP430 to use an external 4MHz oscillator but it seems to be causing a fault, since the flag XT10FFG is set high on CSCTL7. Here is my set up code, can someone let me know what I'm doing wrong? The documentation isn't clear on the config order and such.
I have the oscillator feeding pin 2.7 on my device.
P2DIR = BIT4 | BIT6; //Set 4 out.
P2SEL0 = BIT1;
P2SEL1 = BIT6 | BIT7; //Set X1 mode on pins
CSCTL1 = DCORSEL_5; //Set clock to 8MHz
CSCTL4 = SELMS_2 | SELA__REFOCLK;
CSCTL6 = XTS_1; //HF Mode crystal
CSCTL7 &= ~XT1OFFG;