Hello all,
I'm having some problems with the MSP430FR5739 and using a 32.768k crystal.
I've been using the UART fine with the DCO set at 8MHz, divided down to 1Mhz, for the past few days, and as my project has to be low power and have an RTC, so I decided to install a 32k crystal as the chip supports it and the built in RTC on the chip requires it. I set up the XT1 as directed in the datasheet, and initialsed the UART with the values provided, however I was only getting garbage over the port. As a last ditch, I scoped out the crystal which was giving the correct frequncy and set up some pins of the chip to output the MCLK, SMCLK and ACLK. The clock signals were giving out 8.666kHz according to my scope, which is quite obviously wrong.
Heres my setup code:
PJSEL0 |= XIN;
PJDIR |= BIT1 + BIT2 +BIT3; //Set up pins J.1,2 and 3 to output clock signals
PJSEL0 |= BIT1 + BIT2 + BIT3;
//CLOCK SETUP
CSCTL0_H = 0xA5;//Password write to change clock registers
CSCTL2 = SELA_0 + SELS_0 + SELM_0; //Sets all clocks to XT1 speed
CSCTL3 = DIVA_0 + DIVS_0 + DIVM_0; //Sets divisor of 0 for all CLKs
CSCTL0_H = 0x00; //Lock clock registers
I temporaily changed all my clocks back to the DCO and measured the frequencies at the clock pins and they were all as expected. Does anyone have any explanation as to what is causing this problem?