Chapter 8. Troubleshooting

Troubleshooting Guide

Table 8.1. Troubleshooting Guide

ProblemPossible CausesSolution
JTAG debugging starts, then suddenly fails.

1. The JTAGICE mkII is not sufficiently powered

2. The JTAG Disable bit in the MCUCSR register has been inadvertently written by the application

3. Synchronization is lost.

1. If the JTAGICE mkII is powered from the USB only, it's required that the USB can deliver 500mA

2. Hold reset low to regain control and change the code so that the JTAG Disable bit is not written.

3. Power cycle the JTAGICE mkII and target board. Decreasing the communication speed between the PC and the JTAGICE mkII may be required.

After Using the JTAGICE mkII to download code to the device, the emulator no longer works

1. The JTAG ENABLE fuse has been disabled.

2. The programming interface is still active. It is not possible to use both OCD and programming at the same time

1. Program the JTAG ENABLE fuse.

2. Close the Programming interface, then enter emulation mode.

JTAGICE mkII is detected by AVR Studio or other software frontend, but it will not connect to target deviceJTAG: JTAG ENABLE Fuse is not programmed debugWIRE: DWEN Fuse is not programmedJTAG: Use an other programming interface to program the JTAG ENABLE Fuse debugWIRE: Use an other programming interface to program the DWEN Fuse
AVR Studio fails in detecting the JTAGICE mkII

1. The COM port buffer is to small

2. Synchronization is lost

3. The serial cable is not connected properly

4. Another program or device is claiming control over the COM port

1. Increase COM port buffer.

2. Power cycle the JTAGICE mkII and target board

3. Make sure the serial cable is connected properly

4. Close programs or drivers claiming control of the COM port (e.g. PDA drivers, IrDA or modems)

AVR Studio gives a message that no voltage is present

1. No power on target board

2. Vtref not connected

3. Target Voltage too low

1. Apply power to target board

2. Make sure your JTAG Connector includes the Vtref signal

3. Make sure the target power supply is able to provide enough power

OCD fuse is disabled, but using the JTAGICE mkII, OCD is still possibleThe JTAGICE mkII will automatically program the OCD fuse if it is disabled.This is correct operation.
Some IO registers are not updated correctly in AVR Studio IO viewWhen non-intrusive read back is not possible, the JTAGICE mkII will not update this location in the AVR Studio IO viewRead this IO location into a temporary register, and view it there during debugging. See the chapter Special Considerations for information about which registers affected by this.
Debugging ATmega169 with the STK500 and STK502 does not work when using external clockThe TOSC switch on the STK502 is in the TOSC positionSet the switch to the XTAL position on the STK502 board.
Sometimes after using software breakpoints, the target application "freezes" and will not run correctlyThe JTAGICE mkII debugging session was not closed properly, and BREAK instructions are still present in the flash areaMake sure that the JTAGICE mkII debugging session is closed properly, or reprogram the flash with the correct hex file
debugWIRE Emulation start out ok, then suddenly it fails.

1. The JTAGICE mkII is not sufficiently powered

2. Drivers or active capacitance is disturbing the communication over the RESET-line.

3. Synchronization is lost.

1. If the JTAGICE mkII is powered from the USB only, it's required that the USB can deliver 500mA

2. Remove all capacitance or drivers on the RESET-line. Make sure that a any pull-up resistor is larger than 10kOhm

3. Power cycle the JTAGICE mkII and target board. Decreasing the communication speed between the PC and the JTAGICE mkII may be required.

SPI programming after a debugWIRE session is not possible.When the debugWIRE Interface is enabled the SPI Interface is disabledRe-enable the SPI Interface as described in the section "Connecting to Target through the debugWIRE Interface" Use command line software to re-enable SPI interface
Neither SPI nor debugWIRE connection worksThe SPI and debugWIRE interface are disabled. DebugWIRE will not work if the lockbits are programmedConnect to target with High Voltage Programming. Enable SPI or debugWIRE and clear lockbits if using debugWIRE.
Error messages, or other strange behaviour when using debugWIRE or JTAGTarget is running outside Safe Operation Area. Maximum frequency vs. VccMake sure the target is running within the Safe Operation Area as described in the chapter Electrical Characteristics in the datasheet for the actual part. Lower the frequency and/or increase the voltage.