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.

MSP430F6659: Is 20 MHz clocking possible using REF0 and DCO for MSP430F6659?

Part Number: MSP430F6659

I would like to clock(MCLK and SMCLK) my MSP430F6659 at 19.2 MHz and use the internally trimmed 32768 clock as the reference input to the DCO but when I try to set this it fails. I know about the oscillator fault flag problem in the errata but even avoiding this I cannot seem to set the clock to this level. I have used both the MSP430 Ware drivers and direct registry manipulations. Is this possible and if so can you find my error?

 
unsigned long clockValue = 0;
 #define UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ   19202
 #define UCS_MCLK_FLLREF_RATIO   586//MCLK/FLLRef Ratio

    PMM_setVCore(PMM_CORE_LEVEL_3);
    UCS_initClockSignal(UCS_FLLREF, UCS_REFOCLK_SELECT, UCS_CLOCK_DIVIDER_1);   //Set DCO FLL reference = REFO
    UCS_initClockSignal(UCS_ACLK,UCS_REFOCLK_SELECT,UCS_CLOCK_DIVIDER_1);       //Set ACLK = REFO
    UCS_initFLLSettle(UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ,UCS_MCLK_FLLREF_RATIO);   //Set Ratio and Desired MCLK Frequency  and initialize DCO
 do{                     // ---------------------------  Loop until XT1,XT2 & DCO fault flag is cleared ------------------------------
     UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);          // STEP 2.1: Clear XT2,XT1,DCO fault flags
     SFRIFG1 &= ~OFIFG;                                // STEP 2.2: Clear oscillator fault flag
 } while (SFRIFG1&OFIFG);                              // STEP 1.3: Test if oscillator fault flag has re-engaged
  SFR_clearInterrupt(SFR_OSCILLATOR_FAULT_INTERRUPT);         // Enable global oscillator fault flag
//    SFR_enableInterrupt(SFR_OSCILLATOR_FAULT_INTERRUPT);
    clockValue = UCS_getSMCLK();
    clockValue = UCS_getMCLK();
    clockValue = UCS_getACLK();

 Although clock value is reported as 19.2 the actual clock value produced is much lower.

  • Hi Bradford,

    a good starting point for you could be to look at one of our example codes (which you can find in the TI Resource Explorer, browsing for the MSP430F6659, then going to Software->Peripheral Examples-> Register Level), especially msp430f665x_ucs_03.c, which shows how to configure the DCO for 12MHZ, but you could rather easily adapt it to the desired 19.2 MHz.

    With regards to the clock being reported as 19.2MHz but you seeing it much lower, please try to route it to an output pin and measure the frequency with an oscilloscope to verify the actual frequency.

    Please let me know if the example code helped in any way. We'll further evaluate the issue from there.

    Thanks and best regards,
    Britta
  • Hi Bradford,

    did a look at the example code help to solve your issue? Please let us know if this is solved so that I can close this thread.
    Otherwise please let me know where you're currently stuck at.
    Note that I'll go ahead and close this thread if I don't hear back from you.

    Thanks and best regards,
    Britta

**Attention** This is a public forum