English
Language : 

PIC24FJ256GB106-I Datasheet, PDF (245/328 Pages) Microchip Technology – 64/80/100-Pin, 16-Bit Flash Microcontrollers with USB On-The-Go (OTG)
PIC24FJ256GB110 FAMILY
REGISTER 19-10: ALMINSEC: ALARM MINUTES AND SECONDS VALUE REGISTER
U-0
—
bit 15
R/W-x
MINTEN2
R/W-x
MINTEN1
R/W-x
MINTEN0
R/W-x
MINONE3
R/W-x
MINONE2
R/W-x
MINONE1
R/W-x
MINONE0
bit 8
U-0
—
bit 7
R/W-x
SECTEN2
R/W-x
SECTEN1
R/W-x
SECTEN0
R/W-x
SECONE3
R/W-x
SECONE2
R/W-x
SECONE1
R/W-x
SECONE0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 15
bit 14-12
bit 11-8
bit 7
bit 6-4
bit 3-0
Unimplemented: Read as ‘0’
MINTEN2:MINTEN0: Binary Coded Decimal Value of Minute’s Tens Digit; Contains a value from 0 to 5
MINONE3:MINONE0: Binary Coded Decimal Value of Minute’s Ones Digit; Contains a value from 0 to 9
Unimplemented: Read as ‘0’
SECTEN2:SECTEN0: Binary Coded Decimal Value of Second’s Tens Digit; Contains a value from 0 to 5
SECONE3:SECONE0: Binary Coded Decimal Value of Second’s Ones Digit; Contains a value from 0 to 9
19.2 Calibration
The real-time crystal input can be calibrated using the
periodic auto-adjust feature. When properly calibrated,
the RTCC can provide an error of less than 3 seconds
per month. This is accomplished by finding the number
of error clock pulses for one minute and storing the
value into the lower half of the RCFGCAL register. The
8-bit signed value loaded into the lower half of
RCFGCAL is multiplied by four and will be either added
or subtracted from the RTCC timer, once every minute.
Refer to the steps below for RTCC calibration:
1. Using another timer resource on the device, the
user must find the error of the 32.768 kHz
crystal.
2. Once the error is known, it must be converted to
the number of error clock pulses per minute and
loaded into the RCFGCAL register.
EQUATION 19-1: RTCC CALIBRATION
Error (clocks per minute) =(Ideal Frequency† –
Measured Frequency) * 60
† Ideal frequency = 32,768 Hz
3. a) If the oscillator is faster then ideal (negative
result form step 2), the RCFGCAL register value
needs to be negative. This causes the specified
number of clock pulses to be subtracted from
the timer counter once every minute.
b) If the oscillator is slower then ideal (positive
result from step 2) the RCFGCAL register value
needs to be positive. This causes the specified
number of clock pulses to be subtracted from
the timer counter once every minute.
4. Divide the number of error clocks per minute by
4 to get the correct CAL value and load the
RCFGCAL register with the correct value.
(Each 1-bit increment in CAL adds or subtracts
4 pulses).
Writes to the lower half of the RCFGCAL register
should only occur when the timer is turned off, or
immediately after the rising edge of the seconds pulse.
Note:
It is up to the user to include in the error
value the initial error of the crystal, drift
due to temperature and drift due to crystal
aging.
© 2008 Microchip Technology Inc.
Preliminary
DS39897B-page 243