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.

MSP430FR6047: Issue with HSPLL Unlock Error

Part Number: MSP430FR6047


Tool/software:

Hi,everyone

We are developing a flow meter based on the example code for our custom board. The code was working perfectly until yesterday, when the host PC suddenly reported the following error:

Error: HSPLL|24|HSPLL detected that the PLL has unlocked.

  1. We suspected an issue with the USSXTAL (ultrasonic crystal oscillator). Oscilloscope showed no activity on the crystal.Replaced the crystal, but the problem persisted.

  2. Comparison with EVM Board:We checked the EVM430FR6047 board (which works correctly) and observed the same behavior—no oscillation detected on USSXTAL—yet the EVM board does not report any PLL-related errors.This inconsistency is puzzling.

  3. Following a forum suggestion,https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/934436/evm430-fr6047-error-hspll-detected-that-the-pll-has-unlocked/3458382?tisearch=e2e-sitesearch&keymatch=HSPLL%252525252520detected%252525252520that%252525252520the%252525252520PLL%252525252520has%252525252520unlocked#3458382 .we loaded the HSPLL module example code to test PLL lock functionality.The LED blinked normally, and the PLL locked successfully without errors.However, when running the water demo, the PLL unlock error reappeared.

What are some possible reasons? I feel very confused.

We would greatly appreciate any insights or suggestions to resolve this issue.

  • Hi,

    Inappropriate parameter setting could cause USS library reporting this issue. When running the water demo, could you try with the original water meter demo project without any modification? 

    And you should observe USSXTAL oscillation on the boards, the USSXT should oscillates when the excitation pulses generate. 

    Best regards,

    Cash Hao 

  • Hi Hao,

    It's great to hear from you again. Regarding our custom board, the USSXTAL uses a crystal oscillator instead of a ceramic resonator. For this, I have modified the following settings in uss_userconfig.h:

    #define USS_HSPLL_USSXTAL_SETTLING_USEC 4000
    #define USS_HSPLL_TOLERANCE_PERCENT 5
    #define USS_HSPLL_INPUT_CLK_TYPE USS_HSPLL_input_clock_type_crystal

    I have two questions:

    1. According to the user manual, if a crystal oscillator is used, the HSPLLUSSXTCTL.OSCTYPE bit in the HSPLLUSSXTCTL register should be set to 0. Does the above code automatically implement this change, or do I need to manually modify the register value?

    2. Does the USSXTAL only operate when transmitting waveforms? If so, I observed a brief high-frequency signal on the oscilloscope. Does this indicate that the USSXTAL is functioning correctly?

    .

    Looking forward to your clarification.

  • Hi,

    1. It does not require additional manually modification on the register value. 

    2. Yes, the USSXT is not operating all the time to save power. It only operates when the USS module working. You can zoom in to check on the high frequency signal on the oscilloscope. You should get an 8MHz signal there.

    Best regards,

    Cash Hao

  • "I'd like to share the latest progress with you. I've replaced the crystal oscillator with a ceramic resonator (model AWSCR-8.00CV-T) for the USSXT to align with the EVM board configuration. The host computer is now reporting no errors.

    However, I'm puzzled by one finding: While the datasheet indicates that HSPLL supports crystal oscillators as clock sources, why is the crystal oscillator unusable in the water_demo application? Even after modifying the configuration files, it still doesn't work."

  • Hi,

    Actually, the MCU do support using a crystal oscillator. I would assume maybe it is related to the crystal itself and the load cap values causing some unexpected issue. 

    Best regards,

    Cash Hao

  • Hi,

    I believe the issue has been identified. I flashed the HSPLL example code from the following link:
    https://dev.ti.com/tirex/explore/node?node=A__ACQ2..dUrB7EMaOXgN0m8Q__msp430ware__IOGqZri__LATEST

    As mentioned earlier, the code runs normally. I checked the output pin of the crystal oscillator and observed an 8MHz waveform, confirming that the oscillator circuit is functioning correctly.

    However, after flashing the official code and modifying the USSXT type in userconfig.h, the oscillator output pin no longer shows the 8MHz waveform.

    I suspect that the HSPLL initialization configuration in Water_Demo differs from the example code. Could this be a bug? It appears that Water_Demo does not support using the crystal oscillator as USSXT, even after modifying the USSXT type in userconfig.h.

    This is the initialization statement in the hspll example code

    void HSPLL_init(void)
    {
        // Configure USSXT Oscillator
        HSPLLUSSXTLCTL = OSCTYPE__CRYSTAL |  USSXTEN;
    
        // Set up timer to wait in LPM for crystal stabilization time = 4096 clocks for crystal resonator.
        // For 8MHz XTAL, 4096 clocks = 512us. Using VLO = 9.4kHz, wait 5 timer clock cycles = 532us.
    
        TA4CCR0 = 5;
        TA4CCTL0 = CCIE;                        // Enable Interrupt
        TA4CTL = TASSEL__ACLK | TACLR | MC__UP; // Timer sourced from ACLK (VLO), clear timer
        __bis_SR_register(LPM3_bits | GIE);     // Enter LPM3 w/interrupt
        __no_operation();                       // For debug
    
        // Check if oscillator is stable
        while((HSPLLUSSXTLCTL & OSCSTATE) == 0);
    
        // Output oscillator on pin
        HSPLLUSSXTLCTL &= ~XTOUTOFF;
    
        // Init PLL
        // Use the PLLM setting to get 80MHz output from our 8MHz input
        // Equation: PLL output clock frequency x 2 = input clock frequency x (PLLM+1)
        // Input clock frequency = 8MHz
        // Desired PLL output clock frequency = 80MHz
        // PLLM = 19
        HSPLLCTL = PLLM4 | PLLM1 | PLLM0 | PLLINFREQ; //PLLM = 19, PLL input frequency > 6MHz
    
        // Power up the UUPS to start the PLL
        UUPSCTL |= USSPWRUP;
    
        // Wait for UUPS to power up
        while((UUPSCTL & UPSTATE_3) != UPSTATE_3);
    
        // Wait for PLL to lock
        while(!(HSPLLCTL & PLL_LOCK));
    }

  • Hi,

    I would suggest to compare the HSPLLCTL register value and other related registers in debug mode between the HSPLL example code and water demo code. It should tell us if there are any differences in the configuration. 

    Best regards,

    Cash Hao

**Attention** This is a public forum