Browse Prior Art Database

Software Method of Dynamic Clock Calibration

IP.com Disclosure Number: IPCOM000244833D
Publication Date: 2016-Jan-20
Document File: 5 page(s) / 103K

Publishing Venue

The IP.com Prior Art Database

Abstract

In this paper we present a software method of calibrating a clock (high frequency, low accuracy) generated with an external low frequency crystal. The method includes a system clock (low accuracy), reference clock, clock capture module, clock generation module, software calibration algorithm, and the software calibration algorithm to obtain the frequency of the system clock in real time, calibrate and output the configurable precise clock.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 52% of the total text.

                          Software Method of Dynamic Clock Calibration

Abstract

In this paper we present a software method of calibrating a clock (high frequency, low accuracy) generated with an external low frequency crystal.  The method includes a system clock (low accuracy), reference clock, clock capture module, clock generation module, software calibration algorithm, and the software calibration algorithm to obtain the frequency of the system clock in real time, calibrate and output the configurable precise clock. 

Background

Currently most MCUs have just one oscillator that supports the connection of either one high frequency (3-32Mhz) or one low frequency (31-40khz) external crystal.  There is a conflict when the application needs to use both low and high frequency clocks with higher accuracy, where the low frequency clock is used for RTC and the high frequency clock is used for some peripherals (such as TPM). 

One example application like glucometer is described below.

A glucometer application uses an MCU and requires one RTC and one accurate clock output (3khz) with 0.5% deviation.  If it connects to one external crystal (32.768khz) for RTC accurate clock, and uses an internal reference clock (IRC2/8/48Mhz) for the system clock, it can’t output an accurate 3khz clock due to low accuracy of IRC (1% to 3% as spec).  If it is using IRC as RTC clock source, it cannot obtain a high accuracy RTC clock for the same reason.

One solution is to use an external high frequency crystal for system or peripheral (TPM), and an external oscillator as RTC clock source, but this solution will add extra cost that is not acceptable to customers.

This solution, without adding extra cost, is to use external crystal (32.768khz) for RTC and internal clock source IRC for system, then to calibrate the interference clock IRC, and at last get an accurate output clock (3khz).

Detailed Description

Configure TPM one channel as a capture module, and it has one 16-bit timer clocked by system clock, and has the capacity of saving the timer value and generate trigger signals when capture events (rising or falling edge) occur, so it capture the rising edge of reference clock, and trigger DMA to transfer timer value to a buffer, and then calculate the system clock (TPM clock source) by accumulating multiple captured value, and then the other TPM module take the role of clock generation module to output one precise configurable clock.

The block diagram as below:

                                                           ...