Hello all,
I am trying to use an MSP430FG4619 without an external crystal. From the users guide and other documentation, I can see that this is possible and that the DCO should be able to operate at its default frequency (~1.04MHz) on its own, but I am having trouble setting my control registers and I can't find any example code for the Fx46xxs that uses only the DCO.
Here is what I have so far in my main.c code, I know it needs work:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
//using default DCO , should be ~1 MHz
SCFI0 &= ~(BIT5+BIT4+BIT3+BIT2); //DCO range control 0000 = 0.65-6.1 MHz, should be all 0s
SCFI1 = 0x50; //set DCO to highest tap = 10
SCFQCTL = SCFQ_M; //mod disable
FLL_CTL0 &= ~BIT7;
FLL_CTL1 = XT2OFF; //XT2 off, DCO clk selected for MCLK
IE1 |= OFIE; //enable oscillator fault interrupt
// Loop until XT1,XT2 & DCO fault flag is cleared, means dco taps have settled
do
{
FLL_CTL0 &= ~(XT2OF + XT1OF + LFOF + DCOF); // Clear XT2,XT1,DCO fault flags
IFG1 &= ~OFIFG; // Clear fault flags
}while (IFG1&OFIFG);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Can anyone help me set up the DCO to run as fast as it possibly can, without any external crystals?
Thanks in advance
SJ