CN / EN
文档反馈
感谢关注汇顶文档,期待您的宝贵建议!
感谢您的反馈,祝您愉快!
无匹配项 共计114个匹配页面
文档中心 > GR533x Datasheet/ System/ Clocks/ Clock Calibration Copy URL

Clock Calibration

Introduction

The device provides a clock calibration module, which calibrates inaccurate clocks by using accurate clocks. One of these two clocks should be accurate, the other is to be calibrated. When a high-speed clock is used to calibrate a low-speed clock, the frequency difference between the two clocks should be large enough to obtain reasonable calibration results. When high-speed clock is calibrated with a low-speed clock, errors are inevitable in the result due to frequency limitations.

Main Features

  • Slow clock calibration through HFXO_32M
  • HFRC_192M calibration
  • Custom calibration interval

Functional Description

Architecture

As shown in the figure below, the fast clock is used to sample the slow clock, generating a rise edge, which is used to enable the counter. By reading the result of sampling, the relationship of the two clocks can be calculated. The relationship of the fast clock (ffast) and the slow clock (fslow) can be calculated by the following equation:



图 38 Clock calibration block diagram

The device provides two sets of registers for clock calibration, they both work the same way. The SL Calib registers are used to calibrate the kHz clock (low-frequency clock) such as LFXO_32K, LFRC_32K or RNG_32K from RNG_OSC with high-frequency clock (HFXO_32M). The HS Calib registers are used to calibrate the HFRC_192M clock with low-frequency clock such as LFXO_32K, LFRC_32K or XO 31.25 kHz from HFXO_32M.

Normally, it is recommended to use XO 31.25 kHz as slow clock source to calibrate HFRC_192M in order to get better calibration results. When using XO 31.25 kHz for calibration, HFXO_32M needs to be turned on. When using LFXO_32K or LFRC_32K as the low-speed clock source to calibrate HFRC_192M, LFXO_32K and LFRC_32K clock sources need to be calibrated by using the HFXO_32M clock sources first, so as to ensure that LFXO_32K or LFRC_32K as the reference clock source is valid.

Programming

The following operation flow applies to two sets of register:

  1. Select a slow clock source. The SL_CLK_SEL register refers to the slow clock to be calibrated. The HS_CLK_SEL register refers to the slow clock used to be referenced.
  2. Set the number of clock cycles of the slow clock to be calibrated (SL_CLK_CNT.COUNT or HS_CLK_CNT.COUNT = x, where final N = x + 1).
  3. Enable the calibration module (SL_CLK_CTRL.EN or HS_CLK_CTRL.EN = 1).
  4. Wait the module finishing counting (SL_CLK_STAT. DONE or HS_CLK_STAT.DONE = 1).
  5. Read the number of reference fast clock cycles (SL_CLK_CNT0. VAL or HS_CLK_CNT0.VAL) for calculation.


  6. Disable the module (SL_CLK_CTRL.EN or HS_CLK_CTRL.EN = 0).

扫描关注

打开微信,使用“扫一扫”即可关注。