File Organization

File type File path and name(s) Description
Atmel Studio solution file rc_calib.atsln Solution file that should be opened in Atmel Studio to begin working with the project
Root code file rc_calib/RC_Calibration.asm Root assembly file that includes all the other files
Device specific file rc_calib/Device specific/all.asm Uses the device setting in Atmel Studio to determine additional parameters for the device, such as the oscillator version
Interface specific files rc_calib/Interface specific/,, etc. Specify additional parameters that are specific to a tool. Only one should be included in RC_Calibration.asm and the others should be commented out.
Common files rc_calib/Common/, main.asm, and  
The root file, RC_Calibration.asm, refers to (includes) the following files:
  1. 1.A device specific file that defines additional parameters depending on which device is selected in Atmel Studio. This file further includes the following:
    1. 1.1.A memory map file that defines where the code is located.
    2. 1.2.An oscillator version number. This parameter determines the initial step size used in the binary search to account for the fact that some OSCCAL registers are 7 and some are 8 bits wide.
    3. 1.3.Redefinitions of bit and register names may also be present in the device specific file.
  2. 2.A calibration interface specific file. This file assigns the ISP or JTAG port, and pins with names (labels) used in the main code. The calibration clock frequency is specified in this file.
  3. 3.The file defining the macros used,
  4. 4.The common calibration code file, main.asm.

The calibration code is structured to make it easy to change, in order to match a desired target device and programming tool. Furthermore, the extensive use of macros ensures that the code has the smallest possible footprint. Finally, the way devices and calibration interfaces are designed ensures that support for new devices or interfaces can be implemented with minimal effort.