# Basic RTC Project 1.4

## Purpose

This basic example shows how to use the Real-Time Clock (RTC) peripheral available on the newest Atmel AT91 microcontrollers. The RTC enables easy time and date management and allows the user to monitor events like a configurable alarm, second change, calendar change, and so on.

## Hardware Requirements

This project works on the following Atmel evaluation kits:

- AT91SAM7L-EK
- AT91SAM7L-STK
- AT91SAM9RL-EK

## Description

Upon startup, the program displays the currently set time and date (00:00:00, 2007-Jan-01 at reset) and a menu to perform the following:

- Set the time
- Set the date
- Set a time alarm
- Clear the alarm notification (only if it has been triggered)

Setting the time, date and time alarm is done by using the 'i', 'j', 'k' and 'l' keys to either move the selection from left to right ('j' and 'l') or increase/decrease the currently selected value ('i' and 'k'). Pressing enter validates the current selection; the display is updated accordingly.

It is possible to make the time alarm only match the second, minute or hour value; or any combination of the three. To disable matching for one value, select it, and increase/decrease the value until it appears as 'XX': this indicates matching is disabled.

## Usage

1. Build the program and download it inside the evaluation board. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User Guide, depending on your chosen solution.
2. On the computer, open the DBGU port with a terminal application (e.g. HyperTerminal on Microsoft Windows).

- Settings: 115200 bauds, 8 bits, 1 stop bit, no parity, no flow control.

3. Start the application.
4. The program will output the following on the DBGU:

   > `-- Basic RTC Project 1.4 --
   > Time: 00:10:47
   > Date: Mon, 2007-Jan-01
   > Menu:
   > t - Set time
   > d - Set date
   > i - Set time alarm
   > `

5. Press one of the keys listed in the menu to perform the corresponding action.

###### Atmel Corporation ©2008