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

Calculating ppm offset between the 32khz and the 16mhz clocks

I am trying to build a run time test routine that will return the ppm offset between the 32khz and the 16mhz clocks.

Can i use PPI to hook 10 clocks 32khz ticks to capture the value of a 16mhz time?

Can you instrurct me how to do that?

I need to get 20ppm resolution, so i need to count 16mhz ticks in between 10 32khz ticks.

Parents Reply
  • The way I read your code, you should only be affected by the compare-compare jitter as the timer is started and stopped by compare events via PPI. You could perhaps let the test run for a longer time to get a more exact average.

    If the accuracy you have measured is correct, then there could be an issue with your LF oscillator. Are you using a crystal or the internal RC? If you use the internal RC, then  you should calibrate it regularly. If you are using a crystal, then you need to make sure that you have proper load capacitors.

Children
No Data
Related