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
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
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.
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ž