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.

RTOS/MSP432P4111: LFXT Initialization in Simplelink projects

Part Number: MSP432P4111

Tool/software: TI-RTOS

Hi all,

I'm having trouble starting and using the LFXT. 

The code below shows how I setup and start the SimpleLink Power Manager.  In particular, I want BCLK to be sourced from the LFXT to ensure good timing keeping from the RTC.  I also set ACLK to run from from the LXFT.

I find that sometimes the device starts up with the  LFXTIFG flag is set and ACLK & BCLK by implication are running from REFO.  This is not what I want!

I say by implication because there is no register that indicates the current source of ACLK/BCLK.  If there is an error with LFXT the MSP432 fallbs back to REFO but leaves the registers as they were - the failover seems to be silent except for the LFXTIFG flag.

While LXFTIFG is set, P4.2 (setup to output ACLK) gives a waveform that is close to (but not quite exactly) 32768Hz with a fair bit of timing jitter.  When LXFTIFG is clear, P4.2 is dead stable and dead on 32768Hz.

I've setup a task to periodically check and clear LXFTIFG as a precaution but I'd rather the RTOS looked started up the LXFT reliably. 

Is there something wrong with my setup?  Am I missing part of the process?

Using CCS 9.01, Compiler 18.12.1.LTS, SimpleLink 2.2

#define NUMCUSTOMPERFLEVELS 1

PowerMSP432_PerfLevel customPerfLevels[NUMCUSTOMPERFLEVELS] = {
      {
      .activeState = PCM_AM_LDO_VCORE1,   // LDO rather than DCDC to reduce ADC noise
      .VCORE = 1,

      .DCORESEL = CS_DCO_FREQUENCY_48,

      .SELM = CS_DCOCLK_SELECT,
      .DIVM = CS_CLOCK_DIVIDER_1,
      .MCLK = 48000000,

      .DIVHS = CS_CLOCK_DIVIDER_1,
      .HSMCLK = 48000000,

      .SELS = CS_DCOCLK_SELECT,
      .DIVS = CS_CLOCK_DIVIDER_2,
      .SMCLK = 24000000,

      .SELA = CS_LFXTCLK_SELECT,  // Since we already use XTAL for BCLK, use it for ACLK too (rather than REFO)
      .DIVA = CS_CLOCK_DIVIDER_1,
      .ACLK = 32768,

      .SELB = CS_LFXTCLK_SELECT,  // Use XTAL so that RTC timekeeping is reasonably accurate
      .BCLK = 32768,

      .flashWaitStates = 3,
      .enableFlashBuffer = true,
    },
};

const PowerMSP432_ConfigV1 PowerMSP432_config =
{
    .policyInitFxn = &PowerMSP432_initPolicy,
    .policyFxn = &PowerMSP432_sleepPolicy,

    // The performance levels defined in PowerMSP432.c take indices 0..3. Our custom level takes index 4
    .initialPerfLevel = 4,

    .enablePolicy = false,  
    .enablePerf = true,
    .enableParking = true,

    .customPerfLevels = customPerfLevels,
    .numCustom = NUMCUSTOMPERFLEVELS,

    .useExtendedPerf = true,

   // Don't use HFXT
.configurePinHFXT = false, .HFXTFREQ = CS_48MHZ, .bypassHFXT = false, .configurePinLFXT = true, .LFXTDRIVE = CS_LFXT_DRIVE3, .bypassLFXT = false,
// Don't use the interrupt .enableInterruptsCS = false, .priorityInterruptsCS = CS_INTERRUPT_PRIORITY, .isrCS = CS_HWI, };

 

main()
{
  Power_init(); 

  // Other startup stuff

  BIOS_start();
}

  • Hello,

        I will ask for my colleague to comment , but the power configuration allows for enabling the CS interrupt and defining the callback.  I believe this is the intended feature for dealing with crystal oscillator faults.

       I would recommend focusing on the crystal oscillator circuit and using a simple example to troubleshoot and make sure that the HW is working properly. 

    (1) Is the drive strength to high?

    (2) Are the loading capacitors the correct value?

    (3) Is the crystal close to the microcontroller?  Are good routing practices followed.

    (4)  Does the crystal fail to startup only or does it also fail during the application (due to noise or some other EM event)?

    Regards,

    Chris

  • G'Day Chris,

    (1) Yes, CS.CSCTL2.LFXTDRIVE = 3 (which is as configured by the .LFXTDRIVE field of PowerMSP432_config above).  This is the power up default setting for the device, so I guess its a "safe" setting.  The datasheet is not very clear about how to set this.  Once we adjust our load capacitors (see point 2) we get the most accurate clock rate (as measured at P4.2, setup to output ACLK) with a drive of 3.  Gets worse if drive is lower even though the info from the datasheet (attached below) seems to say any setting from 1..3 should work.

    Do you have any advice on how to set this?  Is it possible to overdrive the oscillator by setting the drive strength too high? Any other traps for young players?

    (2) Using the calculation in note 6, page 53 of the datasheet (SLASEA0B).

    We have a 6pF oscillator and 8pF capacitors, which (assuming Clfxin = Clfxout = 2pF per datasheet) gives a effective load capacitance of 10 x 10 / (10+10) = 5pF.

    Close, slightly low. 

    Increasing the caps to 10pF (for an effective load capacitance of 6pF) seems to improve frequency accuracy (with drive strength of 3).  Will do some tests and see if it helps with the startup problems.

    (3) Yes, I think so.   The layout is below.  There is 5mm from the middle of the oscillator to the middle of the pads. You can see vias through to ATE pads on the bottom of the PCB.  For what its worth, there is a reasonably solid ground plane under the micro, and a metal can over the micro and the oscillator.

    (4) The failures we have observed have all been at startup. 

    Cheers

    Julian

  • Just expanding a little on my questions in (1) above about how to set LFXTDRIVE.

    Have you done any characterization on this (using say your MSP-EXP432P4111 Launchpad)?

    Is setting LFXTDRIVE = 3 good for the life of a product? 

    Is it likely to age the crystal faster than a lower setting? 

    How much of a problem is overdriving? 

    Would you start up the device with 3, then drop to a lower setting at some time later?

    Cheers

    Julian

  • Hi Chris,

    I work with Julian, and have some additional information/questions.

    I think the crystal we have chosen is perhaps not ideal for this microcontroller at the default drive strength. It is the ABS07-120-32.768kHz-T, and it has a recommended drive of 100nW, with a maximum of 500nW. At a drive strength of 3, I suspect we are overdriving it.

    Looking at the MSP-EXP432P4111, it uses the FC-135R 10ppm 12.5pf crystal with 22pf capacitors. The SMD package is identical to our part, and I am quite prepared to switch to it. My question is, looking at the datasheet for the FC-135R the level of drive is 0.5 µW (1.0 µW Max.).

    The MSP432P4111 datasheet has the drive strengths as 0=100nA, 1=120nA, 2=150nA and 3=170nA (all at 3V Vcc). Is it as simple as 0=300nW, 1=360nW, 2=450nW and 3=510nW, or at 3.3V, 330nW, 396nW, 495nW and 561nW respectively?

    Seiko-Epson specifies 500nW, 1000nW max for this crystal. All of the examples use a drive strength of 3, should we stick with that or use 2 instead? 

    Regards,

    Josh

  • Hello,

        It is possible to overdrive the crystal.  Do you see an appreciable decrease in oscillator faults using the lower setting?   It is possible that the lower setting will increase the startup time.   Ideally the load capacitors would be between the device and the crystal, but I cannot say that is exactly the cause of your specific issue.  

    Is the board relatively clean?  Any residue such as flux or residue from no-clean flux still present?  

    http://www.ti.com/lit/an/slaa848/slaa848.pdf

    http://www.ti.com/lit/an/slaa322d/slaa322d.pdf

    The earlier questions are valid.  The lifetime of the crystal would be impacted if overdriven.  I do not see any issues with starting with a higher current and then switching to a slower current to improve startup time and reliability.  

    Regards,
    Chris

**Attention** This is a public forum