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.

5xx Parts: Disabling FLL Hardware and Modulator

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

 

  • Hmmm... I cannot confirm that. When SCG0 is set, there is no automatic modification of UCSCTL0 in my appliaction. Maybe it takes some cycles until the FLL is really inactive... did you check the behaviour once your app is running?
    Johannes

  • Hi Johannes.

    Thanks for the reply. I'm glad its working for someone at least! [:)] Most likely I'm just doing it wrong.

    I added a while (1) { temp = UCSCTL0; } before the following lines

      UCSCTL1 &= ~DISMOD;
      __bic_SR_register(SCG0|SCG1);                 // Enable the FLL control loop

    and UCSCTL0 still changes all the time after running in the while loop. When I force the value to zero using the debugger, the debugger reports back a non-zero value. The value of "temp" is also nonzero.

     

    So other people can follow along, I decided to post the code I am playing with. It's pretty much a cut and paste from the msp430x54x_UCS_2.c sample code:

     

    volatile uint16 temp;
    void main(void) {
      WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
      P1DIR |= BIT0;                            // P1.0 output
      P11DIR |= 0x07;                           // ACLK, MCLK, SMCLK set out to pins
      P11SEL |= 0x07;                           // P11.0,1,2 for debugging purposes.

      UCSCTL3 |= SELREF_2;                      // Set DCO FLL reference = REFO
      UCSCTL4 |= SELA_2;                        // Set ACLK = REFO

      __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
      while (1){
      temp = UCSCTL0;
      }


    }

  • Just loaded your code on one of my boards (F5419 Rev L). And the result (I think you will not like to hear that [:)] : The temp variable stays at 0. Maybe your Debugger is the problem? Try this one and see if the _NOP() gets reaches (place a breakpoint at the _NOP())

      while (1)
      {
      temp = UCSCTL0;
     
      if (temp != 0) break;
      }
     _NOP();

    In case that does not work, too: To help you out of frustration: I have my problems with the FLL, too. [:S] (See other posting)

    Regards,
    Johannes

  • Well it sounds like I am doing it right then. I am using an old experimental part from a year back (X430F5438) while I am waiting for some real MSP430F5438s to arrive, so maybe that's the issue.

    I'll give an update when I get some samples of the real chips.

  • As an FYI for everyone, I tried this out again with a 5529 today and it worked ok. It must have been an issue with the old experimental part.

**Attention** This is a public forum