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:

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:

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).
  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