TCXO activation for timers

Hi,

I am using a NRF9160. I would like to use nrfx_timer with a base frequency of 32MHz with the TXCO as clock source.

I saw in the documentation that timers use the base frequency of 16MHz with the XTAL as clock source.

How can I make this change?

Parents Reply Children
  • My problem is that I want to run 1PPS and LTE at the same time. But after a few tries, I found that the modem crashes after a few minutes.
    And I saw that in the documentation, pps can not work at the same time as LTE.
    But I noticed that by activating 1PPS at regular intervals (every 10s for example), the modem does not crash. During the period when 1PPS is not activated, I simulate 1PPS with the help of timers. Which works.
    The problem is that after a few minutes, the simulated 1PPS is less and less accurate.
    I saw that there is this functionality in the gnss library: nrf_modem_gnss_timing_source_set(NRF_MODEM_GNSS_TIMING_SOURCE_TCXO).
    So it is possible to use the TCXO when the 1PPS is not there anymore by calling this function.

    Is it possible to have an example of code that has the same behavior as this function?

  • Hi,

     

    jp52800 said:
    modem crashes after a few minutes.

    Can you elaborate on what you're seeing here? Are you seeing that a function does not work simultaneously, or are you observing a modem assertion? The latter is quite critical.

    jp52800 said:
    But I noticed that by activating 1PPS at regular intervals (every 10s for example), the modem does not crash. During the period when 1PPS is not activated, I simulate 1PPS with the help of timers. Which works.
    The problem is that after a few minutes, the simulated 1PPS is less and less accurate.

    How much of a drift are you seeing?

    If you do not enable the HFCLK (ie. the device runs on internal 64 MHz RC oscillator), you will see a high drift. Here's a method of requesting the HFCLK:

    https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/samples/cellular/at_client/src/main.c#L16-L24

     

    Could you try this and see if this improves the overall drift?

     

    Kind regards,

    Håkon

  • Hi,

    The nrf_modem_fault_handler function reports error 0x011 NRF_MODEM_FAULT_PANIC. I have to turn off the modem and reset it.

    After a minute, there is 18 ms of drift. But now, I have just enabled the HFCLK and the drift is now 12µs!

    I saw that we can also change the precision of the 32MHz clock with CLOCK_CONTROL_NRF_K32SRC_ACCURACY.

    The function allows to enable the XTAL. How to enable the TCXO? Do I have to set bit0 to 0 of the HFXOSRC register? Is it already enabled by default?

    Kind regards,

  • Hi,

     

    1 ppm = 1 us drift over 1 second, so 12 us over 60s = 0.2 ppm drift.

    jp52800 said:
    I saw that we can also change the precision of the 32MHz clock with CLOCK_CONTROL_NRF_K32SRC_ACCURACY.

    This is for the LFCLK, and not the HFCLK.

    Your HFCLK is now sourced from the TCXO.

    jp52800 said:
    The nrf_modem_fault_handler function reports error 0x011 NRF_MODEM_FAULT_PANIC. I have to turn off the modem and reset it.

    Which modem fw are you using? There has been active fixes in mfw v1.3.x, so if you are using an older version; you should upgrade.

     

    Kind regards,

    Håkon

  • Hi,

    Thanks for all this information.

    The modem version used is 1.3.6. I think it's the latest version.

    Kind regards,

Related