We have a custom board that is using the RTC with an external 32.768kHz crystal. I would like to verify the accuracy and tune the capacitors if necessary. I want to verify that what I am doing is reasonable.
We are using Zephyr. I have set up
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
static struct k_timer mTimer;
static void on_timer(struct k_timer *timer)
{
pin_traces_auto_toggle(tp_pin_7);
// pin_traces_toggle(tp_pin_6,k_is_in_isr());
}
int main(void)
{
__ASSERT_NO_MSG(log_initialize());
__ASSERT_NO_MSG(pin_traces_initialize());
k_timer_init(&mTimer, on_timer, NULL);
k_timer_start(&mTimer, K_SECONDS(1), K_SECONDS(1));
return 0;
}
This timer will be based on the 32.768kHz crystal, correct? I am watching the GPIO signal on what we have defined as test point 7 over a long period to verify the accuracy. I get (basically) a 1 second toggle off this pin. Is it reasonable to use this for checking crystal accuracy?