-49-
v6.3
Architecture and System
4.2. Timers
Waspmote uses a quartz oscillator which works at a frequency of
14.7456 MHz
as a system clock. In this way, every
125ns
the
microcontroller runs a low level (machine language) instruction. It must be taken into account that each line of
C++
code of a
program compiled by Waspmote includes several instructions in machine language.
Waspmote is a device prepared for operation in adverse conditions with regards to noise and electromagnetic contamination,
for this reason, to ensure stable communication at all times with the different modules connected through a serial line to the
UARTs (XBee, GPRS, USB) a maximum transmission speed of 115200bps has been set for XBee, GRPS and USB, so that the success
rate in received bits is 100%.
4.2.1. Watchdog
The Atmega 1281 microcontroller has an internal Enhanced Watchdog Time – WDT. The WDT
precisely
counts the clock cycles
generated by a
128KHz oscillator.
The WDT generates an interruption signal when the counter reaches the set value. This
interruption signal can be used to wake the microcontroller from the
Sleep
mode or to generate an internal alarm when it is
running ON the mode, which is very useful when developing programs with timed interruptions.
The WDT allows the microcontroller to wake up from a low consumption Sleep mode by generating an interruption. For this
reason, this clock is used as a time-based alarm associated with the microcontroller’s
Sleep
mode. This allows very precise
control of small time intervals:
16ms, 32ms, 64ms, 128ms, 256ms, 500ms, 1s, 2s, 4s, 8s
. For intervals over 8s (Deep Sleep
mode) the RTC is used.
More information about the interruptions generated by the Watchdog can be found in Energy chapter.
Related API libraries:
WaspPWR.h
,
WaspPWR.cpp
All information about their programming and operation can be found in the document:
Energy and Power Programming Guide.
All the documentation is located in the
in the Libelium website.
4.2.2. RTC
As shown in the Hardware chapter, Waspmote has a real time clock (RTC) running a 32KHz (32.786Hz) which allows to set an
absolute time.
Alarms can be programmed in the RTC specifying day/hour/minute/second. This allows total control when the mote wakes up
to capture values and perform actions programmed on it. Also, the RTC allows Waspmote to function in the maximum energy
saving modes (
Deep Sleep and Hibernate
) and to wake up just at the required moment.
The RTC allows the microcontroller to be woken from the low consumption state by generating an interruption. For this reason,
it has been associated to the microcontroller’s Deep Sleep and Hibernate modes, making it possible to put the microcontroller
to sleep, and wake it up by activating an alarm in the RTC. Sleeping intervals can go from 8s, to minutes, hours or even days.
More information about the interruptions generated by the RTC and DeepSleep and Hibernate modes can be found in the Energy
management chapter.
Related API libraries:
WaspRTC.h
,
WaspRTC.cpp
All information about the RTC programming and operation can be found in the document:
RTC Programming Guide.
All the documentation is located in the
in the Libelium website.