-96-
v5.8
Programming
21.2. Real time Clock - RTC
Waspmote Plug & Sense! has a built in Real Time Clock – RTC, which keeps it informed of the time. This allows to program and
perform time-related actions such as:
“Sleep for 1h 20 min and 15sec, then wake up and perform the following action”
Or even programs to perform actions at absolute intervals, e.g.:
“Wake on the 5th of each month at 00:20 and perform the following action”
All RTC programming and control is done through the I2C bus.
Alarms:
Alarms can be programmed in the RTC specifying day/hour/minute/second. That allows total control about when the mote
wakes up to capture sensor values and perform actions programmed on it. This allows Waspmote Plug & Sense! to be in the
saving energy mode (Deep Sleep) and makes it wake up just at the required moment.
As well as relative alarms, periodic alarms can be programmed by giving a time measurement, so that the node reprograms its
alarm automatically each time one is triggered.
Waspmote Plug & Sense! can keep the RTC time correctly even if the ON / OFF button is switched to OFF position.
RTC module has an internal compensation mechanism for the oscillation variations produced in the quartz crystal by changes
in temperature (Temperature Compensated Crystal Oscillator – TCXO).
Most RTCs on the market have a variation of ± 20ppm which is equivalent to a 1.7s loss of accuracy per day (10.34min/year),
however, the model use din Waspmote Plug & Sense! has a loss of just ± 2ppm, which matchs to variation of 0.16s per day (1min/
year).
As shown, variations in accuracy are near to zero at room temperature and minimal when moved to the ends of the temperature
scale.
Figure : Uncompensated variation curve
Figure : Compensated variation curve
Source: Maxim-ic.com