Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Drivers RTC32 Example for stk600-rc064x Documentation

Introduction

This simple example shows how to use the 32-bit Real Time Counter (RTC32).

Main Files

Device Info

All AVR XMEGA devices with a RTC32 can be used. This example have been tested with the following setup:

  • STK600 and RC064X/TQFP64 with ATxmega256A3B

Setup

The following setup is required on STK600:

  • On connector AUX: Connect 32KHz to TOSC2 in order to have a clock source for the RTC32
  • For LED output: Connect full LEDS connector to PORTD

Optional:

  • For keeping RTC32 running between reset connect PF5 (VBAT) to VTG. Or to have it running RTC32 on missing VTG connect PF5 to a external power source.

Description of the example

The example will initalize the RTC32 and use the STK600 LEDS to show the last two digits from time in binary coded decimal (BCD).

Due to the nature of the RTC32; alarms can't be given faster than every third RTC32 clock cycle. And with a RTC32 clock cycle of 1Hz the LEDS will only update every third second.

Since the RTC32 is battery backed up it can keep track of it's time in the case of reset or power off. See Setup for details on this.

Dependencies

This example depends on the following modules:

Compilation info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.