nRF54L: 32kHz timer access?

With the transition of the RTC peripheral on the nRF52, nRF53, etc series to the GRTC peripheral on the nRF54L, it appears there is no longer any low-power counter that can tick at 32768 Hz?

From what I can tell, the GRTC is forced to the 1Mhz tick rate, and the TIMER peripheral only runs off the HFCLK.

 The GRTC documentation mentions an internal 32768 Hz timer, but there is no way to query its value?

It seems odd to have a 32kHz crystal driving the low power timing on the SoC, but no way to use it as a counter directly.

Parents
  • Hi Jordan,

    From what I understand it looks like there is a 32.768 kHz hardware clock on the nRF54L, but it's entirely internal and cannot be exposed as a software-readable counter and one must use the GRTC at its fixed 1 MHz tick rate for low-power timing purposes. I will anyhow verify this internally and get back to you.

    Please expect a slight delay owing to the summer holidays here in Norway. Thank you for understanding.

    Regards,

    Priyanka

  • Hi Jordan,

    Reading SYSCOUNTER in GRTC gives you the time at 1 MHz resolution. This is based on the internal 32.768 kHz counter, so it would be equivalent to reading the 32.768 kHz, except you get more resolution, that you could discard in software.

    -Priyanka

  • Hi Priyanka

    So the problem is that they're not equivalent. 1 MHz is not a clean multiple of 32768 Hz, so there will always be rounding errors when attempting to convert from one to the other, and extra software overhead from needing to perform a conversion in the first place.

    Trying to convert the Zephyr tick rate set by the GRTC (31250 Hz) to the same timebase as used in previous Nordic products (32768 Hz) is similarly problematic.

  • Hi Jordan,

    Yes, I understand the issue. You will need to use some Software for the same. I have anyhow asked this internally to experts. In case I hear updates from someone with more expertise in this area, I will get back to you. 

    -Priyanka

  • You can change the time base from 31250 Hz to 1 MHz if you don't like it. Is there any particular reason you need to convert to/from the time base (32768 Hz) of previous Nordic products?

  • Presumably there is some reason why the time base is not 1 MHz by default?
    Otherwise you are just defaulting to a less accurate time base for no reason?

    The reason for the 32768 Hz timer is that it forms the basis of timestamping for our generic sensor logging libraries. It has several nice properties (see below), and up until now has been possible to access directly on SoC's from every manufacturer we have used. This is not something we can update without invalidating all historically logged data, and introducing the same problem in reverse on the devices that do expose the 32768 Hz timer.

    1. Easy conversion from seconds fractions to seconds (just bitmask the bottom bits)
    2. Every SoC has the option for a low power 32768 Hz crystal, so portable.

Reply
  • Presumably there is some reason why the time base is not 1 MHz by default?
    Otherwise you are just defaulting to a less accurate time base for no reason?

    The reason for the 32768 Hz timer is that it forms the basis of timestamping for our generic sensor logging libraries. It has several nice properties (see below), and up until now has been possible to access directly on SoC's from every manufacturer we have used. This is not something we can update without invalidating all historically logged data, and introducing the same problem in reverse on the devices that do expose the 32768 Hz timer.

    1. Easy conversion from seconds fractions to seconds (just bitmask the bottom bits)
    2. Every SoC has the option for a low power 32768 Hz crystal, so portable.

Children
No Data
Related