Xmega IEC60730 Class B Library  1.0
 All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
classb_freq.c File Reference

Detailed Description

CPU frequency test.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@a.nosp@m.tmel.nosp@m..com

Copyright (C) 2012 Atmel Corporation. All rights reserved.

Definition in file classb_freq.c.

#include "avr_compiler.h"
#include "classb_freq.h"
+ Include dependency graph for classb_freq.c:

Go to the source code of this file.

Functions

void classb_freq_setup_timer ()
 This sets up the TC that is used in the frequency test. This configures the period, prescaler and overflow interrupt.
void classb_freq_callback ()
 This is called back from the RTC interrupt.
 ISR (CLASSB_TEST_TC_OVF_vect)
 TC overflow interrupt. This counts the number of TC overflows and the error handler is called if the configurable maximum is exceeded. The purpose of the latter is to detect RTC failure: the TC is reset in the RTC interrupt. If the RTC interrupt is too slow, the number of TC overflows will exceed the limit. Note that if the TC frequency increased abruptly, the error would probably be detected here.