Purpose
This example demonstrates how to use the AST driver with the 32kHz oscillator crystal.
Requirements
This example can be used with SAM4L evaluation kits.
Description
Upon startup, the program uses the USART driver to display a real time counter incremented every second. The display is triggered by the interrupt controller module.
Main Files
- ast.c: Asynchronous Timer driver
- ast.h: Asynchronous Timer driver header file
- ast_example1.c: Asynchronous Timer example application
Compilation Information
This software is written for GNU GCC and IAR Embedded Workbench® for Atmel®. Other compilers may or may not work.
Usage
- Build the program and download it into the evaluation board.
- On the computer, open, and configure a terminal application (e.g., HyperTerminal on Microsoft® Windows®) with these settings:
- 115200 baud
- 8 bits of data
- No parity
- 1 stop bit
- No flow control
- Start the application.
- In the terminal window, the following text should appear:
* -- AST Example 1 in Calendar Mode --
* -- xxxxxx-xx
* -- Compiled: xxx xx xxxx xx:xx:xx --
*
* Config AST with 32 KHz oscillator.
*
* Calendar: Year:XX Month:XX Day:XX, XXhXXmXXs
- Approximately every second the time should increment.