2.3.1 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/isp_atmelice_interface.inc, jtag_jtagice3_interface.inc, 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/macros.inc, main.asm, and memoryMap.inc |
The root file, RC_Calibration.asm, refers to (includes) the
following files:
- A device specific file that defines
additional parameters depending on which device is selected in Atmel Studio. This
file further includes the following:
- A memory map file that defines where the code is located.
- 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.
- Redefinitions of bit and register names may also be present in the device specific file.
- 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.
- The file defining the macros used, macros.inc.
- 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.