Hi,
I'm trying to use the 4MHz external oscillator (XT2) on the MSP-EXP430F5529LP and I have been having significant trouble doing so.
Can someone please let me know what I am doing wrong. All I'm doing in this code is enabling the oscillator, setting the port pins so that I can use the oscillator, and showing the clock output on one of the pins.
Cheers,
Luke
#include <msp430.h> #include "driverlib.h" #define SET |= /* Used as: PORTA SET BIT7; to set bit 7 of port a */ #define CLR &=~ /* Used as: PORTA CLR BIT7; to clear bit 7 of port a */ #define TOGGLE ^= /* Used as: PORTA TOGGLE BIT7; to toggle bit 7 of port a */ #define TXLED BIT0 #define RXLED BIT6 #define TXD BIT2 #define RXD BIT1 void Initialize_XT2CLK(void); int main(void) { WDTCTL = WDTPW + WDTHOLD; //Stop WDT P2DIR = 0x04; //Set pin 2.2 to display SMCLK P2SEL = 0x04; Initialize_XT2CLK(); while (1) { } } void Initialize_XT2CLK(void){ P5SEL SET BIT2; //Configure XT2 IO pins UCSCTL4 = SELS__XT2CLK | SELM__XT2CLK | SELA__XT2CLK; //Set XT2 as OSC for all Clocks UCSCTL5 = 0x0000; //Prescalers UCSCTL6 = XT1OFF; //Disable XT1 }