Hello everyone,
I am having a bit of trouble modifying the DCO without the FLL control loop enabled on 5xxx parts. Page 69 of the User Guide (slau208d) indicates that I should be able to disable the FLL by setting either SCG0 or SCG1 in the Status Register. It also states that DCO modulation can be disabled when the DISMOD bit in UCSCTL1 is set.
Below is some code for configuring the DCO based on msp430x54xUCS_2.c in slac166j.zip. I modified it a bit to turn off both SCG0 and SCG1, as well as turn off the modulation. The modified code is in bold.
__bis_SR_register(SCG0|SCG1); // Disable the FLL control loop
UCSCTL1 |= DISMOD;
UCSCTL0 = 0x0000; // Set lowest possible DCOx, MODx
UCSCTL1 = (DISMOD|DCORSEL_5); // Select DCO range 16MHz operation
UCSCTL2 = FLLD_1 + 249; // Set DCO Multiplier for 8MHz
// (N + 1) * FLLRef = Fdco
// (249 + 1) * 32768 = 8MHz
// Set FLL Div = fDCOCLK/2
UCSCTL1 &= ~DISMOD;
__bic_SR_register(SCG0|SCG1); // Enable the FLL control loop
What I am experiencing is that as I single step through this entire code snippit, the UCSCTL0 register updates by itself. This is well and proper if the FLL control loop is enabled, but is annoying if I am trying control it myself.
How do I configure the UCS so I can control it directly? Does anyone have experience doing this?
Thanks
darkwzrd