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.

MSP430F5438A: Clock Start-up Clarification

Part Number: MSP430F5438A

Hi Team,

As a follow on to  RE: MSP430F5438A: 1% of boards built will have the application code stall :

Previously the code started up the clock twice - once in bootstrap loader and once in main code. The clock startup in bootstrap loader has been removed, now relying on the default condition of 1MHz operation to run the processor.

The example code does not indicate that you need to wait for anything to stabilize before execution, is that correct?

The code is not running the FLL or internal oscillators, is the below setup correct and in the proper order for best operation?

After running at 1MHz to checksum the memory it jumps to the main application  where it sets power and clocking below :

 

WDTCTL = WDTPW + WDTHOLD;                   // Stop watchdog timer

 

__disable_interrupt();                 // Disable global interrupts

     

     /* ------   move up to full power --------      */

    SetVCoreUp (0x01);

    SetVCoreUp (0x02);

    SetVCoreUp (0x03);

 

            /*   ---  Set up XT2 for 12 mhz   -----      */ 

         P5SEL   |=  BIT2+BIT3;                     // Port select XT2

         UCSCTL6 &= ~XT2OFF;                       //  Enable XT2 

         

                                                   // set drive strength [01] for 12mhz

         UCSCTL6 &= ~(XT2DRIVE1);                 //  turn off drive bit 1

         UCSCTL6 |=   XT2DRIVE0 ;                //   turn on  drive bit 0

                     

          /*    ---------  Set up XT1  for 32khz    --------*/

         P5SEL   |=  BIT4+BIT5;                  // Select XT1

         UCSCTL6 &= ~(XT1OFF);                  //  XT1 On

        

                                                   // set drive strength [00] for 32khz

         UCSCTL6 &= ~(XT1DRIVE1);                 //  turn off drive bit 1

         UCSCTL6 &= ~(XT1DRIVE0);                //   turn off drive bit 1  

              

       /*    ------ Loop until XT1,XT2 & DCO stabilizes -------   */ 

  {

    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);

                                            // Clear XT2,XT1,DCO fault flags

    SFRIFG1 &= ~OFIFG;                      // Clear fault flags

  }while (SFRIFG1&OFIFG);                   // Test oscillator fault flag  

       /*   -----     Set clock sources -------         */ 

        UCSCTL4 = 0X0055;  //Aclk= Xt1, SMclk = Xt2,  Mclk = XT2clk    

        UCSCTL1 |=  DISMOD  ;  // turn off modulation  

/*  ----      and  continue on ---------  */  

Thanks and let me know!!
Reed

  • Hey Reed,

    Obviously I can't test the code, but overall it looks good to me!  Looks like they've merged several of the code examples which is good, and used the UCS_8.c as the base and followed it's flow, which I also think is best. http://dev.ti.com/tirex/explore/node?node=APlALh6aA3ZIkW3pN4VrDQ__IOGqZri__LATEST 

    At start-up, the 1MHz DCO will be there.  And since they are running directly off the XT2 crystal, they don't need the FLL.  FLL is mainly used for stablizing a higher frequency DCO frequency from a lower frequency crystal.  Like, having and accurated 12MHz DCO clock with only a 32MHz crystal.   Shouldn't be required when running off the higher frequency crystal.  

    Thanks,

    JD

     

**Attention** This is a public forum