Microchip Technology XMEGA Manual
Microchip Technology XMEGA Manual

Microchip Technology XMEGA Manual

Internal rc oscillator calibration

Advertisement

Quick Links

XMEGA Internal RC Oscillator Calibration

Features

Calibration of Internal RC Oscillator Frequency with +/-1% Accuracy
Support for all XMEGA
Calibration Using AVR
Calibration at any Operating Voltage and Temperature
Firmware Description and Example for use During Production Programming

Introduction

This application note describes a fast and accurate way of calibrating the internal RC oscillators on
®
XMEGA
devices. An easily adaptable calibration firmware example is available through Atmel
which can be used with any XMEGA with one or more tunable internal RC oscillators and a JTAG
interface. The routine is based on using an AVR programming tool for generating a reference clock signal
at a known frequency and comparing this to the frequency of the internal RC oscillator.
The internal RC oscillator frequency can be calibrated to within +/-1% of the frequency specified in the
device data sheet. This feature offers great flexibility and significant cost savings compared to using an
external oscillator.
The factory calibration is performed at a fixed operating voltage and temperature, typically at 3V and
85°C. As the frequency of internal RC oscillators are affected by both operating voltage and temperature,
it may be desired to perform a secondary calibration in conditions matching the specific application
environment. This secondary calibration can be performed to gain higher accuracy than the standard
calibration offers, to match a specific operating voltage and/or temperature.
The calibration method described in this application note only takes a fraction of a second longer than
reading the factory calibration byte from the signature row and writing it back to the to the device memory.
Thus, the overall programming time is almost unaffected when performing calibration during the
programming step in production.
In some systems it may be more beneficial to perform run-time oscillator calibration. This may be
desirable in applications that need an accurate system clock over the entire temperature range and
independent of operating voltage. In that case a 32.768 kHz watch crystal may offer a reliable and cost
efficient solution.
©
2018 Microchip Technology Inc.
®
Devices with Tunable Internal RC Oscillators via JTAG Interface
®
Programming Tools
Application Note
AN2644
®
START ,
DS00002644A-page 1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XMEGA and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Microchip Technology XMEGA

  • Page 1: Features

    An easily adaptable calibration firmware example is available through Atmel START , which can be used with any XMEGA with one or more tunable internal RC oscillators and a JTAG interface. The routine is based on using an AVR programming tool for generating a reference clock signal at a known frequency and comparing this to the frequency of the internal RC oscillator.
  • Page 2: Table Of Contents

    The Microchip Web Site....................13 Customer Change Notification Service................13 Customer Support......................13 Microchip Devices Code Protection Feature..............13 Legal Notice........................14 Trademarks........................14 Quality Management System Certified by DNV.............15 Worldwide Sales and Service..................16 Application Note DS00002644A-page 2 © 2018 Microchip Technology Inc.
  • Page 3: Theory Of Operation - Internal Rc Oscillators

    Each oscillator option has a status flag that can be read from software to check that the oscillator is ready. After Reset the XMEGA starts running from the internal 2 MHz calibrated RC oscillator. An overview of the available clock selection options is presented in the data sheets.
  • Page 4: Runtime Calibration Using A 32.768 Khz Reference Clock

    The two built-in DFLLs in all XMEGA devices can be used to improve the accuracy of the 2 MHz and 32 MHz internal oscillators. The reference clock sources can be selected to be the internal 32.768 kHz RC oscillator or an external 32.768 kHz watch crystal.
  • Page 5 DFLL will decrement or increment the corresponding DFLL Calibration register value by one to adjust the oscillator frequency slightly. For details refer to the XMEGA manual. Knowing the fundamental characteristics of the RC oscillators, it is possible to make an efficient calibration routine that calibrates the RC oscillator to a given frequency at any operating voltage and at any temperature with an accuracy of +/-1%.
  • Page 6: Calibration Firmware Implementation

    The signal should have a nominal frequency of approximately 32 kHz. The XMEGA device should enable its internal pull-up resistor on the TDI line, and the programming tool should enable a pull-up resistor on the TDO line. Unfortunately, the programming tool is in many cases behind level converters, so the device should set the TDO line high to ensure that noise is unlikely to corrupt the calibration.
  • Page 7: Algorithm For Determining The Oscillator Calibration Value

    RC oscillator. The 16-bit Timer/Counter C0 (TCC0) is recommended since it is present on most XMEGA devices with tunable RC oscillators. The idea is to capture the frequency of the C-clock using the XMEGA Event System and compare the frequency to predefined limits. The exact frequency of the C-clock is assumed to be known by the application, and by adjusting the RC32KCAL calibration value the frequency of the internal RC oscillator can be tuned according to the C-clock.
  • Page 8 Precision within step size +/- 1%? by two Captured Save value in frequency < EEPROM nom. value Send Increase Decrease Handshake RC32KCAL RC32KCAL signal with step size with step size Return Application Note DS00002644A-page 8 © 2018 Microchip Technology Inc.
  • Page 9: Measuring The Calibration Clock Frequency

    Note:  Run atprogram without arguments to display documentation and available options. The atprogram ® tool can be accessed directly from the installation path of Atmel Studio 7.0 in the folder atbackend. Application Note DS00002644A-page 9 © 2018 Microchip Technology Inc.
  • Page 10: Performing Calibration

    Note:  Run atprogram without arguments to display documentation and available options. The atprogram tool can also be accessed directly from the installation path of Atmel Studio 7.0 in the folder atbackend. Application Note DS00002644A-page 10 © 2018 Microchip Technology Inc.
  • Page 11: Get Source Code From Atmel | Start

    BROWSE EXAMPLES button on the Atmel | START front page. Atmel | START web page: http://microchip.com/start Example Code • XMEGA Internal RC Oscillator Calibration – http://start.atmel.com/#example/Atmel:xmega_internal_rc_oscillator_calibration: 1.0.0::Application:XMEGA_Internal_RC_Oscillator_Calibration: Press User guide in Atmel | START for details and information about example projects. The User guide button can be found in the example browser, and by clicking the project name in the dashboard view within the Atmel | START project configurator.
  • Page 12: Revision History

    AN2644 Revision History Revision History Doc. Rev. Date Comments 02/2018 Initial document release. Application Note DS00002644A-page 12 © 2018 Microchip Technology Inc.
  • Page 13: The Microchip Web Site

    Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. Application Note DS00002644A-page 13 © 2018 Microchip Technology Inc.
  • Page 14: Legal Notice

    SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
  • Page 15: Quality Management System Certified By Dnv

    AN2644 © 2018, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. ISBN: 978-1-5224-2679-0 Quality Management System Certified by DNV ISO/TS 16949 Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California ®...
  • Page 16: Worldwide Sales And Service

    New York, NY Sweden - Stockholm Tel: 631-435-6000 Tel: 46-8-5090-4654 San Jose, CA UK - Wokingham Tel: 408-735-9110 Tel: 44-118-921-5800 Tel: 408-436-4270 Fax: 44-118-921-5820 Canada - Toronto Tel: 905-695-1980 Fax: 905-695-2078 Application Note DS00002644A-page 16 © 2018 Microchip Technology Inc.

Table of Contents