Datasheet

2010-2014 Microchip Technology Inc. DS20005010F-page 29
MCP7940N
5.6 Digital Trimming
The MCP7940N features digital trimming to correct for
inaccuracies of the external crystal or clock source, up
to roughly ±129 PPM when CRSTRIM = 0. In addition
to compensating for intrinsic inaccuracies in the clock,
this feature can also be used to correct for error due to
temperature variation. This can enable the user to
achieve high levels of accuracy across a wide tempera-
ture operating range.
Digital trimming consists of the MCP7940N periodically
adding or subtracting clock cycles, resulting in small
adjustments in the internal timing. The adjustment
occurs once per minute when CRSTRIM = 0. The SIGN
bit specifies whether to add cycles or to subtract them.
The TRIMVAL<6:0> bits are used to specify by how
many clock cycles to adjust. Each step in the
TRIMVAL<6:0> value equates to adding or subtracting
two clock pulses to or from the 32.768 kHz clock signal.
This results in a correction of roughly 1.017 PPM per
step when CRSTRIM = 0. Setting TRIMVAL<6:0> to
0x00 disables digital trimming.
Digital trimming also occurs while operating off the
backup supply.
REGISTER 5-15: OSCTRIM: OSCILLATOR DIGITAL TRIM REGISTER (ADDRESS 0x08)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SIGN TRIMVAL6 TRIMVAL5 TRIMVAL4 TRIMVAL3 TRIMVAL2 TRIMVAL1 TRIMVAL0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is clear x = Bit is unknown
bit 7 SIGN: Trim Sign bit
1 = Add clocks to correct for slow time
0 = Subtract clocks to correct for fast time
bit 6-0 TRIMVAL<6:0>: Oscillator Trim Value bits
When CRSTRIM =
0:
1111111 = Add or subtract 254 clock cycles every minute
1111110 = Add or subtract 252 clock cycles every minute
0000010 = Add or subtract 4 clock cycles every minute
0000001 = Add or subtract 2 clock cycles every minute
0000000 = Disable digital trimming
When CRSTRIM =
1:
1111111 = Add or subtract 254 clock cycles 128 times per second
1111110 = Add or subtract 252 clock cycles 128 times per second
0000010 = Add or subtract 4 clock cycles 128 times per second
0000001 = Add or subtract 2 clock cycles 128 times per second
0000000 = Disable digital trimming