The CMU in Geckos have built in HW support for calibrating oscillators at run-time. It can compare the HFCLK against a selected reference clock (CALCLK). The basic principle of the calibration is that it counts how a given number of cycles of one clock compares to the number of cycles another clock goes through in the same amount of time.


For example, let's say the HFCLK is supposed to be twice as fast as the CALCLK selection. If the HFCLK goes through 100 cycles and CALCLK goes through 55 cycles in this same time frame, the CALCLK should be slowed down slightly. 


Please refer to Application Note AN0004 for more information about CALCLK as well as some software examples.


Something to note is that there is currently a typo in AN0004 in the equation it gives for CALCLKcounter. Please refer to the below picture showing the correct equation.



  • Knowledge Base Articles
  • 32-bit MCUs