In assisted GPS systems it is not uncommon to have available a stable external frequency reference that can be used to help measure the offset in the reference clock which is being used as a reference frequency for the GPS chip.
The external clock is provided to the chip on a pin called CNTIN, GPS_CAL, etc. This pin drives a frequency counter within the chip that allows the chip to calculate the frequency ratio between the CNT_IN signal and the reference clock. This, combined with knowledge of the nominal value of each clock, allows the software to calibrate errors in the reference clock.
To utilize this feature the application must select a frequency plan from the CNT_IN group portion of GL_FREQ_PLAN.
The HAL should implement the following callbacks:
The GLCT invokes the callback several times during the calibration process to communicate with the HAL regarding the status of the CNT_IN signal. The library will engage the frequency counter and request the CNT_IN signal whenever it determines a new calibration is needed. Most commonly this will occur right before a new position request begins.
The following diagram shows the interactions between library and application for the CNT_IN calibration
Advanced Users
If desired the application can also force a frequency calibration at any time. One reason to do this would be to get an advanced start on the frequency calibration while the application retrieves assistance data.
The procedure for this is
The following diagram shows the "Application Initiated" interactions between library and application for the CNT_IN calibration and simultaneous assistance data delivery.
Note: The library to application interactions are identical to the case of a library-initiated use of CNT_IN.
Frequency Synchronization in Android
For information on integrating frequency synchronization in Android, see TCXO Calibration in Android 4750/4751.