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.

MSP430F5310: Verification that XT1CLK oscillator is using external crystal

Part Number: MSP430F5310

Hello,

I'm using an MSP430F5310 microcontroller and I am trying to verify that the XT1CLK oscillator peripheral is indeed using the external 32.768 crystal, and not REFO.  Is there a way to do this?  I hand soldered a 40kHz crystal to the XT1 pins, and ACLK still shows 32.768kHz.  Is this right?  How can you prove out that XT1CLK is in fact using the external 32.768kHz crystal, and not an internal 32.768kHz one?

  • Hello,

    I can't think of a way currently to "prove" that ACLK is running from XT1CLK and not REFOCLK. 

    You can check the SELA bits to see what ACLK is being sourced from, either REFO or XT1CLK. 

     The only time ACLK could be running from REFO when the setting reads XT1CLK, is if there is a fault detected from XT1CLK:

      

    Hope this helps.  

    JD

  • Thank you.  I've verified what you have mentioned/recommended.  I did try using a 40kHz external crystal just to see if ACLK would clock at 40kHz instead of the 32.768kHz, but, it seems that the ACLK signal was still clocking at the 32kHz.  Which doesn't make sense as the XT1 oscillator is a Pierce Oscillator and should have started oscillating at the external crystal frequency (40kHz)....ACLK is clocking at 32kHz, but using an oscilloscope I can see that the external crystal does have a 40kHz drive signal on one of the pins.  So it would seem that the external 40kHz crystal is indeed oscillating, but then ACLK is still running at the 32.768kHz?  That makes no sense (by using SELA, XT1CLK is being used by ACLK...).  Have you by chance ever seen this happen?

  • You seem fairly thorough, but I don't see any mention in either of the posts you've made. Are you also setting P5SEL.4 correctly as required to use the pins as crystal inputs/outputs? Per the User Guide, section 5.2, "If the crystal pins (XIN, XOUT) are shared with general-purpose I/Os, XT1 remains disabled until the PxSEL bits associated with the crystal pins are set." Another thing to keep in mind, "When a 32768- Hz crystal is used for XT1CLK, the fault control logic immediately causes ACLK to be sourced by the REFOCLK, because XT1 is not stable immediately". Another register you need to watch is OFIFG in the SFRIFG1 register.

  • I do see OFIFG has been set due to the XT1 fault flag (XT1LFOFFG) being initially set right out of PUC.  If the OFIFG flag remains set, will this force the XT1 Oscillator to use REFO instead of the external crystal?

  • If either of the bits are set, it means the oscillator is not working correctly, which according to the User Guide, appears to cause ACLK to be sourced by REFOCLK. In the TI examples, they loop until both flags are cleared.

    Here's how TI sets up the external crystal for your device in Resource Explorer.

  • Thank you very much.  The missing key was in fact OFIFG still being set.  Even if the external crystal has stabilized and there are no issues with XT1, the XT1CLK won't switch over from REFO to the external crystal until OFIFG is reset.  So my issue is resolved.  Thank you very much!!

**Attention** This is a public forum