Hi,

Firstly, a big thank you to all who have laboured long and hard to provide
such a good set of free tools for the MSP430 family.

Now a question...

Does anyone have experience of running an msp430F435 from a crystal on XT2?
I have a 32768Hz crystal on Xin/Xout and a 4MHz (plus caps) on XT2in/XT2out.
Using a scope on XT2out I can see that the 4MHz crystal does start up at the
correct frequency when the code is run, but MCLK never changes from the
default 32 times 32768 to 4MHz.

My code, shown below, is based on one of the TI examples (Fet440_clks2.c
from slac019.zip).

Two things in particular worry me:
1) The XT2OF (Oscillator XT2 Fault flag) is not defined in mspgcc header
file "basic_clock.h". Perhaps the hardware does not really work.
2) The User Manual (rev C) says that the XT2OF bit is read only, yet TI
example code writes to it!

// Put the MCLK out on pin 66
        P1DIR |= 0x02;
        P1SEL |= 0x02;

// Lets start the 4MHz Oscillator

        FLL_CTL1 = FLL_CTL1 & ~XT2OFF;  // clear bit = high freq xtal on

        do                              // loop until flag is clear
        {
                FLL_CTL0 = FLL_CTL0 & ~XT2OF;   // clear high freq
oscillator fault flag
                for (i = 50000; i; i--);        // delay for crystal to
start and FLL to lock
        }
        while (FLL_CTL0 & XT2OF);       // test high freq oscillator fault
flag

        FLL_CTL1 = SELM_XT2;                    // SMCLK=on, XT2CLK=on,
MCLK=XT2, SMCLK=DCO, ACLKdiv=1

Regards,

Martin.

 ###  OXFORD INSTRUMENTS   http://www.oxford-instruments.com/  ### 

Unless stated above to be non-confidential, this E-mail and any 
attachments are private and confidential and are for the addressee 
only and may not be used, copied or disclosed save to the addressee.
If you have received this E-mail in error please notify us upon receipt 
and delete it from your records. Internet communications are not secure 
and Oxford Instruments is not responsible for their abuse by third 
parties nor for any alteration or corruption in transmission. 


Reply via email to