Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to adjust Hardware RTC clock

1,195 bytes added, 13:10, 13 November 2013
m
Rectify systematic error using PMIC RTC registers
=== Rectify systematic error using PMIC RTC registers ===
Using as a reference +3.6 seconds/day, now its time to compensated this delayed drift configuring PMIC RTC registers. These registers are:*RTC_CTRL_REG: Used to enable RTC compensation.**I2c bus: I2C1**Address: 0x4b**Register: 0x29*RTC_COMP_LSB_REG: Less significant bit of COM_REG value in 16 bit [http://en.wikipedia.org/wiki/Two%27s_complement Two's complement].**I2c bus: I2C1**Address: 0x4b**Register: 0x2c*RTC_COMP_MSB_REG: Most significant bit of COM_REG value in 16 bit [http://en.wikipedia.org/wiki/Two%27s_complement Two's complement].**I2c bus: I2C1**Address: 0x4b**Register: 0x2d   A compensation mechanism accounts for inaccuracy in the 32-kHz oscillator. In the compensation procedure, the external processor calculates the drift of the 32-kHz oscillator and then loads the compensation registers (RTC_COMP_LSB_REG and RTC_COMP_MSB_REG) with the drift compensation value calculated during the measurement. If the RTC_CTRL_REG[2] AUTO_COMP bit is enabled, the COMP_REG value (in twos complement) is added to the RTC 32-kHz counter each hour and 1 second. When COMP_REG is added to the RTC 32-kHz counter, the duration of the current second becomes [(32,768 – COMP_REG)/32,768] seconds; therefore, it is possible to compensate the RTC with 1/32,768-second time unit accuracy each hour.
4,199
edits