ksdesigns
 Senior Member
 Joined: 25/06/2011 Location: United StatesPosts: 143 |
| Posted: 05:49pm 25 Dec 2011 |
|
|
|
The internal rtcc is not that good yet need to add a calibration to the setup menu .
but if you are using that dallas part you could use the INT pin out of the DS3231 and run it to pin7 (D10) on the DuinoMite and use that to take it out of sleep also it has a 10k pullup on it .
ken
29.3.10 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 0.66 seconds per month. Calibration has the ability to eliminate an error of up to 260 ppm.
The calibration is accomplished by finding the number of error clock pulses and writing this value into the calibration bit fields (RTCCON<9:0>). This 10-bit signed value will be either added or subtracted from the RTCC timer once every minute. Use the following procedure 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, as shown in Equation 29-1.
Equation 29-1: Calculating Error Clocks Per Minute
3. Based on the result from step 2, the following options are available:
a) If the oscillator is faster than ideal (negative result from step 2), the calibration bit fields (RTCCON<9:0>) 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 than ideal (positive result from step 2), the calibration bit fields (RTCCON<9:0>) value needs to be positive. This causes the specified number of clock pulses to be added to the timer counter once every minute.
4. Load the calibration bit fields (RTCCON<9:0>) with the correct value.
Writes to the calibration bit fields (RTCCON<9:0>) should only occur when the timer is turned off, or immediately after the rising edge of the seconds pulse (except when the seconds bit fields (RTCTIME<14:8>) are 0x00, due to the possibility of the auto-adjust event). |