The JTAG interface consists of a 4-wire Test Access Port (TAP) controller that is compliant with the IEEE® 1149.1 standard. The IEEE standard was developed to provide an industry-standard way to efficiently test circuit board connectivity (Boundary Scan). Atmel AVR devices have extended this functionality to include full Programming and On-Chip Debugging support.

Figure 1. JTAG Interface Basics

When designing an application PCB which includes an AVR with the JTAG interface, it is recommended to use the pinout as shown in Figure 2. The Atmel AVR ONE! ships with both 100-mil and 50-mil adapters supporting this pinout.

Figure 2. JTAG Header Pinout

Table 1. JTAG Pin Description
Name Pin Description
TCK 1 Test Clock (clock signal from the AVR ONE! into the target device)
TMS 5 Test Mode Select (control signal from the AVR ONE! into the target device)
TDI 9 Test Data In (data transmitted from the AVR ONE into the target device)
TDO 3 Test Data Out (data transmitted from the target device into the AVR ONE!)
nTRST 8 Test Reset (optional, only on some AVR devices). Used to reset the JTAG TAP controller.
nSRST 6 Source Reset (optional) Used to reset the target device. Connecting this pin is recommended since it allows the AVR ONE! to hold the target device in a reset state, which can be essential to debugging in certain scenarios.
VTref 4 Target voltage reference. The AVR ONE! samples the target voltage on this pin in order to power the level converters correctly. The AVR ONE! draws less than 1mA from this pin.
GND 2, 10 Ground. Both must be connected to ensure that the AVR ONE! and the target device share the same ground reference.

Tip: remember to include a decoupling capacitor between pin 4 and GND.

The JTAG interface allows for several devices to be connected to a single interface in a daisy-chain configuration. The target devices must all be powered by the same supply voltage, share a common ground node, and must be connected as shown in Figure 3.

Figure 3. JTAG Daisy-chain

When connecting devices in a daisy-chain, the following points must be considered:

Daisy chaining example: TDI -> ATmega1280 -> ATxmega128A1 -> ATUC3A0512 -> TDO.

In order to connect to the Atmel AVR XMEGA device, the daisy chain settings are:

Devices before: 1

Devices after: 1

Instruction bits before: 4 (AVR devices have 4 IR bits)

Instruction bits before: 5 (AVR UC3 devices have 5 IR bits)