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.

MSP430 Launchpad External Oscillator

Other Parts Discussed in Thread: MSP-EXP430F5529LP

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
}

  • I figured it out. Turns out SMCLK, MCLK, and ACLK cant use XT2 as an oscillator. only the USB can. It doesn't really make any sense because its connected directly to the chip, but this is what is said in the Launch pad development kit user guide.