6.1.4 Debug Options

When debugging an Atmel AVR device using Atmel Studio, the 'Tool' tab in the project properties view contains some important configuration options. The options which need further explanation are:

  • Target clock frequency

    Target clock frequency: Accurately setting the target clock frequency is vital to achieve reliable debugging of Atmel megaAVR devices over the JTAG interface. This setting should reflect the lowest operating frequency of your AVR target device in the application being debugged. See the special considerations section for more information.

    Debug sessions on debugWIRE target devices are clocked by the target device itself, and thus no frequency setting is required. The Atmel AVR JTAGICE mkII will automatically select the correct baud rate for communicating at the start of a debug session.

    When debugging using the aWire interface the JTAGICE mkII will automatically tune the baud to the optimal value and no user settings are required.

    Atmel AVR XMEGA target devices will be clocked at maximum speed for JTAG and a constant 1MHz clock for PDI. No synchronization is required for XMEGA devices so the clock is not configurable.

  • Preserve EEPROM

    Select this option to avoid erasing the EEPROM during reprogramming of the target before a debug session.

  • Always activate external reset when reprogramming device

    If your target application disables the JTAG interface, the external reset must be pulled low during programming. Selecting this option avoids repeatedly being asked whether to use the external reset.