3 Measuring the Calibration Clock Frequency

In order for the calibration routine to provide an accurate result, the exact frequency of the calibration clock signal should be measured externally and provided to the calibration firmware. A basic way to accomplish this would be to connect an oscilloscope to the calibration clock line and simply include the measured value in the firmware source code.

The calibration clock signal should be transmitted on the JTAG TDI pin during calibration. To measure its frequency, simply initiate a calibration session with the tool to be used after connecting the JTAG interface to the target device. The calibration firmware is not required to run on the target device. The clock signal should then be available on the TDI line sufficiently long enough to be captured by an oscilloscope or other measurement device. The frequency of the calibration clock signal should be in the 32 kHz range.

If the calibration firmware is not running on the target device, the calibration command should return an error message, which can be ignored at this time.

A calibration sequence can be initiated in the following way:
  1. Connect the selected programming tool to the target device using the JTAG interface.
  2. Connect the programming tool to the computer running Atmel Studio 7.0 and power up the target device.
  3. In Atmel Studio, open the command line by selecting Tools → Command Prompt.
  4. In the command prompt, run the following command to initiate the calibration:

    atprogram -t [tool] -d [device] calibrate

    Example: atprogram -t atmelice -d atxmega128a1u calibrate

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.