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.

CC2340R5: HFXT load capacitance

Part Number: CC2340R5

Tool/software:

HFXT:

Datasheet states adjustable load capacitors are integrated on chip.

Reference design LP-EM-CC2340R5-RGE external capacitors are not mounted.  So far so good.

However, I can't find any documentation on how to adjust these internal caps.  I assume this is all automated, although I wonder how... 

Please confirm.

  • Hi,

    I'm not sure if it is documented, but I've used this code snippet previously:

    static void AdjustLoadCap(void)
    {
        // Q1 and Q2 values are 6 bits. it has been mentioned before that Q1 should be set same as Q2.
        const uint8_t Val_Q1 = loadCAP_VAL;
        const uint8_t Val_Q2 = loadCAP_VAL;
    
        // clear previous trims for Q1 and Q2
        HWREG(CKMD_BASE + CKMD_O_HFXTTARG) &= ~(CKMD_HFXTTARG_Q1CAP_M |
                                                  CKMD_HFXTTARG_Q2CAP_M);
    
        // set values for Q1 and Q2
        HWREG(CKMD_BASE + CKMD_O_HFXTTARG) |=
                ((Val_Q1 << CKMD_HFXTTARG_Q1CAP_S) & CKMD_HFXTTARG_Q1CAP_M) |
                ((Val_Q2 << CKMD_HFXTTARG_Q2CAP_S) & CKMD_HFXTTARG_Q2CAP_M);
    
        // enable the HFXO
        HWREG(CKMD_BASE + CKMD_O_HFXTCTL) |= CKMD_HFXTCTL_EN;
    
        // wait for the HFXO to be ready
        while ( (HWREG(CKMD_BASE + CKMD_O_AMPSTAT) & CKMD_AMPSTAT_STATE_M)
                !=
                CKMD_AMPSTAT_STATE_SETTLED);
    
        // Enable tracking loop with HFXT as reference. This will automatically
        // calibrate LFOSC against HFXT whenever HFXT is enabled; usually after
        // waking up from standby.
        // This is needed to ensure fast HFXT startup and a reasonably accurate
        // LFOSC frequency.
        HWREG(CKMD_BASE + CKMD_O_HFTRACKCTL) |= CKMD_HFTRACKCTL_EN_M | CKMD_HFTRACKCTL_REFCLK_HFXT;
    
    }


    Thanks,
    Toby

  • Interesting.  These registers appear in the TRM but they lack details in order to use them properly.

    Just came across this post: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1368142/cc2340r5-hfxt-external-capacitor-value

    I understand we have to loop through all the possibilities to find the best one.

    Brute force configuration.

    Thanks for the hint.