# Basic Calculator Project 1.4

## Purpose

This examples implements a very simple calculator to demonstrate how the backup modes of the AT91SAM7L microcontroller family can be used in an actual application.

## Hardware Requirements

This example requires an AT91SAM7L-EK board.

## Description

The project implements a simple calculator. It has the following particularities:

- Integer operations only (add, subtract, multiply, divide).
- Clear using the DEL key.

The point of the example is not the calculator itself, but its use of two backup modes. The first backup mode is used between each keypress. In this mode, the SLCD is still powered, which makes it completely transparent to the user while reducing power consumption. The device instantly wakes-up whenever any key is pressed.

The second backup mode is entered after 10 seconds of inactivity. The SLCD is turned off, but the backup SRAM is still powered. So, whenever the user presses the "wake-up" button, the device returns to the state it was in prior to entering backup.

## 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 SLCD should display the Atmel logo and the 0 value.
5. Use the device like a standard calculator. Traces on the DBGU show the transition between the three different operating modes (i.e. normal, backup, deep backup).

###### Atmel Corporation ©2008