English
Language : 

PIC24FJ128GA Datasheet, PDF (160/232 Pages) Microchip Technology – General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA FAMILY
REGISTER 18-10: ALMINSEC: ALARM MINUTES AND SECONDS VALUE REGISTER
Upper Byte:
U-0
R/W-x
—
MINTEN2
bit 15
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
Lower Byte:
U-0
R/W-x
—
SECTEN2
bit 7
R/W-x
SECTEN1
R/W-x
SECTEN0
R/W-x
R/W-x
R/W-x
R/W-x
SECONE3 SECONE2 SECONE1 SECONE0
bit 0
bit 15 Unimplemented: Read as ‘0’
bit 14-12 MINTEN2:MINTEN0: Binary Coded Decimal Value of Minute’s Tens Digit; Contains a value from 0 to 5
bit 11-8 MINONE3:MINONE0: Binary Coded Decimal Value of Minute’s Ones Digit; Contains a value from 0 to 9
bit 7
Unimplemented: Read as ‘0’
bit 6-4 SECTEN2:SECTEN0: Binary Coded Decimal Value of Second’s Tens Digit; Contains a value from 0 to 5
bit 3-0 SECONE3:SECONE0: Binary Coded Decimal Value of Second’s Ones Digit; Contains a value from 0 to 9
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
18.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 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 multi-
plied 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.
Formula box:
(Ideal frequency (32,768) – measured frequency)
* 60 = clocks per minute
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. Load the RCFGCAL register with the correct
value.
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.
DS39747C-page 158
Preliminary
© 2006 Microchip Technology Inc.