Connecting to target through the debugWIRE Interface

A minimum of 3 wires is required for communication between AVR Dragon and the target board with the debugWIRE interface. These Signals are RESET, VTref and GND.

 

 

Important!

This interface uses only 1 pin, (RESET pin) for communication with the target. To enable the debugWIRE interface on an AVR Device, the debugWIRE Enable fuse (DWEN) must be programmed, (DWEN=0). AVR devices with debugWIRE interface are shipped with the DWEN fuse un-programmed from the factory. The debugWIRE interface itself cannot enable this fuse. The DWEN fuse can be programmed through ISP mode, which requires connection to a 6-pin header. For this reason it is recommended to place the full 6-pin ISP connector on your target board to simplify emulation and programming.

 

 

NOTE: When the DWEN fuse is set, the ISP Interface normal functionality is disabled. This because the debugWIRE must have control over the RESET pin. When DWEN is set it is no longer possible to use ISP. Use debugWIRE or High Voltage programming to disable the DWEN fuse.

 

Note

If using this connection from AVR Dragon  on a STK500, be sure to de-attach the RESET jumper on the STK500.  And connect to the correct ISP header for the actual AVR device, guided by the colour code in the STK500 silk-print.

 

AVR Dragon debugWIRE connector

                        

 

Connecting AVR Dragon probe to 6-pins ISP header using a 6-pin cable

When DWEN fuse is programmed, there is only need for GND, VTref and RESET line for using the debugWIRE interface. However to ease the task of changing between ISP mode and debugWIRE mode, it is recommended to do debugWIRE with all six lines connected. The AVR Dragon will automatically tristate all unused ISP pins when running debugWIRE.

 

 

Re-enabling the ISP interface

By following the description below, the ISP Interface is re-enabled.

 

  1. Connect the AVR Dragon to the target with ISP (6-pin connection) as described above.

  2. Load a project and Start a debug session using the "Start Debugging" command (found under the Debug pulldown-menu in AVR Studio)

  3. Open "AVR Dragon Options"  (found under the Debug pulldown-menu in AVR Studio) and select the "Connections" tab.

  4. Click on the button "disable DebugWIRE" as shown in the figure below. And click "Yes" in the next message box.

 

 

 

 

Note: Some precautions regarding the RESET line must be taken to ensure proper communication over the debugWIRE interface. If there is a pull-up on the RESET line, this resistor must be larger than 10Kohm, and there should be no capacitive load. The pull-up resistor is not required for debugWIRE functionality. Other logic connected to the RESET line should be removed.

 

Note

It's not possible to use the debugWIRE Interface if the lockbits on the target AVR are programmed. Always be sure that the lockbits are cleared before programming the DWEN fuse and never set the lockbits while the DWEN fuse is programmed. If both the debugWIRE enable fuse (DWEN) and lockbits are set, one can use High Voltage Programming to do a chip erase, hence clear the lockbits. When the lockbits are cleared the debugWIRE Interface will be re-enabled.

 

Note

The ISP Interface is only capable of reading fuses, signature and do a chip erase when the DWEN fuse is unprogrammed.