This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF24LE1

Hello! I use a 32kHz quartz resonator and I want to interrupt the program after 1 second with a watchdog timer. But when writing to it, 128 I get not 1 but 1.25 seconds. What am I doing wrong?

hal_clklf_set_source(HAL_CLKLF_XOSC32K); // Synthesize 32 KHz from crystal 32K clock - for Wdog!
while(!(CLKLFCTRL & 0x40U)){};

hal_wdog_init(128);

for(;;)

Parents Reply
  • Can you use a scope to precisely measure your timing period? This will give you a better idea of what is going on in terms of actual magnitude. There seems to be a fair amount of slop in your numbers with what you've been saying.

    If you are getting 1.25 seconds at 128, then your clock is running 20% slow. Using 96 as your divider is 0.75 correction, meaning you should be running a tad fast (0.94sec)

    The effects of incorrect loading on a crystal can come in many forms, from slight shifts, to more extreme results depending on how the waveform is affected.

Children
No Data
Related