SAM3S8/SD8 Software Package: Working with RTT

SAM3S8/SD8 Software Package 1.2

# Working with RTT
[Working with SAM3S8/SD8 Peripherals]

Collaboration diagram for Working with RTT:

The RTT driver provides the interface to configure and use the RTT peripheral.

The Real-time Timer is used to count elapsed seconds.
This timer is clocked by the 32kHz system clock divided by a programmable 16-bit balue. To be accurate, it is better to use an external 32kHz crystal instead of the internal 32kHz RC.

To count elapsed seconds, the user could follow these few steps:

- Programming PTPRES in RTT_MR to feeding the timer with a 1Hz signal.
- Writing the bit RTTRST in RTT_MR to restart the timer with new settings.

An alarm can be set to happen on second by setting alarm value in RTT_AR. Alarm occurence can be detected by polling or interrupt.

For more accurate information, please look at the RTT section of the Datasheet.

Related files :
rtt.c
rtt.h.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines