Atmel Xplained Evaluation Board ATXMEGAA3BU-XPLD ATXMEGAA3BU-XPLD Data Sheet

Product codes
ATXMEGAA3BU-XPLD
Page of 15
 
10 
AVR1934 
8413A-AVR-09/11 
3 Demo application 
The demo application consists of different applications selectable from a list when the 
device is started: 
Table 3-1. 
Available applications 
Application name 
Source file 
Header file 
Time zone application 
timezone.c timezone.h 
Date time application 
date_time.c date_time.h 
Production date application 
production_date.c production_date.h 
Temperature application 
ntc_sensor.c ntc_sensor.h 
Light sensor application 
lightsensor.c lightsensor.h 
Backlight toggling 
-- -- 
3.1 Time zone application 
When the XMEGA-A3BU Xplained 
board is powered on for the first time, 
the user is prompted to supply it with 
the current time zone from a list of 
hours from UTC -12 to UTC +12, as 
well as minute offsets. The new time 
zone settings are stored in EEPROM. As the UNIX timestamps generated by the RTC 
is in Coordinated Universal Time (UTC), this info will be used to display the time as 
local time. The time zone application is available in the date and time application 
available from the main menu, and is located in 
timezone.c
 and 
timezone.h
 
together with other time zone functionality. When the time zone application is started, 
it is not possible to return to the main menu before a time zone is selected. 
3.2 Date and time application 
The date time application presents the user with a menu with the following options: 
•  “Show date&time” – display local date and time in the selected time zone 
•  “Set date” – Set the date 
•  “Set time”  - Set local time 
•  “Set timezone” – Set time zone hour and minute offset 
The menu uses the menu system, and all strings and options are defined at the top of 
date_time.c.
 This function handles calling the correct application based on the 
user’s choice in the menu. If the back 
button is pressed, the user will return 
to the main menu. 
The “Show date&time” application 
shows the current local date and time, 
computed from the RTC UNIX 
timestamp. Note that this time will not be completely accurate, due to inaccuracies in 
the RTC.  
 
Figure 4 Date&time menu 
Figure 3 Timezone selection