Internal capacitance fine-tuning of the 32MHz crystal

Hi,

I'd like to know how to tune the internal capacitance from the 32MHz crystal.

Specifically, I refered to section 4.12.1.1 Using internal capacitors in the nRF5340 datasheet, section 4.12 OSCILLATORS — Oscillator control.

The instructions explain how to read the values ​​of XOSC32MTRIM.SLOPE and XOSC32MTRIM.OFFSET from the registers and input them into the formula below. Then, input the CAPACITANCE value (7.0pF ~ 20.0pF, 0.5pF steps, obtained from devicetree &hfxo's load-capacitance-femtofarad) to obtain CAPVALUE. Finally, write CAPVALUE into the XOSC32MCAPS register at position A. Please correct me if my understanding is incorrect. Thank you.

CAPACITANCE Value

&hfxo {
    status = "okay";
    load-capacitors = "internal";
    load-capacitance-femtofarad = <7000>; // 7000 is a example
};

XOSC32MTRIM Register Address

CAPVALUE Equation

XOSC32MCAPS Register Address

Is this method feasible in application code? Or could you provide a method?

Additionally, I found the following two questions in the Q&A; I'm not sure if they are related to the question I asked.

1. Can the software adjust the internal load capacitance of the nrf5340 crystal oscillator

2. How to configure internal load capacitance for 32 MHz crystal on nRF54L (NCS 2.9.0)?

Thank you very much!

Kevin

Parents
  • Hi Kevin

    The internal load capacitors should generally be set in the .dts or .overlay file of your device. The CAPVALUEs should be set to match the external oscillator in .dts during build time, then the trimming is done in the soc.c file here: ...\zephyr\soc\nordic\nrf53\soc.c

    In short, your understanding seems to be correct here.

    Best regards,

    Simon

Reply
  • Hi Kevin

    The internal load capacitors should generally be set in the .dts or .overlay file of your device. The CAPVALUEs should be set to match the external oscillator in .dts during build time, then the trimming is done in the soc.c file here: ...\zephyr\soc\nordic\nrf53\soc.c

    In short, your understanding seems to be correct here.

    Best regards,

    Simon

Children
Related