nrf54L15 clock output accuracy using GRTC Clock output

Greetings,

We are using a nrf54L15 and trying to use the GRTC Clock output functionality as described in 8.10.4 of the datasheet.
We need the most accurate clock output possible, since we need to provide it to external sensors.
The code is as follows:
int main(void)
{
	/* Give control of p1.08 to GRTC */
	nrf_gpio_pin_control_select(PIN_NUM, NRF_GPIO_PIN_SEL_GRTC);

	/* Set divider to 500 (250 * 2), so we get 32000 kHz out */
	uint8_t grtc_div = 250;
	nrfy_grtc_clkout_divider_set(NRF_GRTC, grtc_div);

	nrfy_grtc_clkout_set(NRF_GRTC, NRF_GRTC_CLKOUT_FAST, true);
	k_sleep(K_FOREVER);
	return 0;
}
The entire sample is in the following ZIP file:
I build using:
 west build -b nrf54l15dk/nrf54l15/cpuapp
---------------------------------
I am measuring the output PIN with an oscilloscope, and I see that the clock is not as accurate as we would imagine it to be.
The BOM of the v0.9.1 DK says that the 32mHz crystal has an accuracy of +-10 ppm. We would then expect the clock output of the GRTC to also have +-10ppm. Is this assumption incorrect?
TEST 1 
grtc_div = 2
EXPECTED CLOCK - 1 mHz
MEASURED CLOCK - 1.0043mHz

TEST 2
grtc_div = 250
EXPECTED CLOCK - 32 kHz
MEASURED CLOCK - 32.152 kHz


TEST 3
Instead of using GRTC we use a PWM peripheral to get a 32kHz clock
EXPECTED CLOCK - 32 kHz
MEASURED CLOCK - 32.132 kHz


------------------------------------------------
Is this kind of error expected? 
Are we doing something wrong?

We are very confused why this is happening. We expected that we would be able to get a +-10ppm 32kHz clock output, but this is not the case.
Thank you and best regards,
Tjaž
Parents
  • In your code you are using the "fast clock" output. This will use either the HF oscillator (which is inaccurate) in case HFXO is turned off, or HFXO in case it is turned on.

    You should use LFCLK as output instead. Assuming you run GRTC from LFXO, the accuracy should follow that one, which should be +-10ppm or whatever accuracy your external LF crystal has. Note that that will give you a 32 kHz clock output and devisor is not used here.

Reply
  • In your code you are using the "fast clock" output. This will use either the HF oscillator (which is inaccurate) in case HFXO is turned off, or HFXO in case it is turned on.

    You should use LFCLK as output instead. Assuming you run GRTC from LFXO, the accuracy should follow that one, which should be +-10ppm or whatever accuracy your external LF crystal has. Note that that will give you a 32 kHz clock output and devisor is not used here.

Children
No Data
Related