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.

MSP430FR2433: How to set XT1DRIVE when using an external quartz ?

Part Number: MSP430FR2433

Hi,

We use an external quartz (32.768K) in our design based on a MSP430FR2433. I try to set the current provided to the quartz, after leaving LPM3 or LPM4 mode, but I don't understand when to do it.

In SLAU445I:

1.4.3.4 Wake up from LPM4.5
Do the following steps after a wakeup from LPM4.5:
[...]
If a crystal oscillator is needed after a wakeup from LPM4.5 then configure the corresponding pins and start the oscillator after you cleared the LOCKLPM5 bit.

=> I understand I have to configure XT1DRIVE after clearing LOCKLPM5 bit

But, in CSCTL6 Register description of XT1DRIVE:

Initially, it starts with the highest supply current for reliable and quick startup. If needed, user software can reduce the drive strength.

=> I understand I have to configure XT1DRIVE after the initialization code (provided below):

The configuration of these bits is retained during LPM3.5 until LOCKLPM5 is cleared, but not the register bits itself; therefore, reconfiguration is required after wakeup from LPM3.5 and before clearing LOCKLPM5.

=> I understand I have to set XT1DRIVE before clearing LOCKLPM5 bit DisappointedCry

I tried to configure it before and after clearing LOCKLPM5 but I don't see differences in clock regularity (when using Timer0), even if I set the most constrained value XT1DRIVE_0 (3.7pF is not adapted to our hardware). So I think I missed one point, but don't see what.

Thanks,

Sylvain

Note: XT1 initialization code;

    // Initialize XT1 32kHz crystal so that RTC can use it
    P2SEL0 |= QUARTZ_32K_PINP2;         // set XT1 pin as second function
    do
    {
        CSCTL7 &= ~(XT1OFFG | DCOFFG);  // Clear XT1 and DCO fault flag
        SFRIFG1 &= ~OFIFG;
    } while (SFRIFG1 & OFIFG);          // Test oscillator fault flag

  • Hello Sylvain,

    Are you utilizing LPM3 and LPM4 modes or LPM3.5 and LPM4.5 modes? 

    The big difference is, in the LPMx.5 modes, the core is shut off and thus there is no power to registers, so all those setting will be lost and reset when coming out of LPMx.5. Coming out of LPMx.5 is like a BOR has happened. At that point, it just like turning on the device for the first time. Where this gets tricky is if you want to keep a an RTC running (LPM3.5) and thus need XTAL on XT1 stable thorough the process. 

    The notes in the register is for the typical situation of waking up for the first time.

    For proper procedure of setting up your device after a wakeup form LPM3.5, please follow the sequence outlined in section 1.4.3.3 Wake up form LPM3.5 in the device User Guide. 

  • Hi, sorry for the late answer, emergency to managed on another project... :(

    I indeed made a mistake between the various modes, I don't use the LPMX.5 modes.

    Regards,
    Sylvain

**Attention** This is a public forum