The AVR Dragon supports several hardware interfaces as described in the sections that follow.
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.
When designing an application PCB which includes an AVR with the JTAG interface, it is recommended to use the pinout as shown in Figure 4.2, “JTAG header pinout”. The AVR Dragon JTAG header support this pinout.
Table 4.1. JTAG pin description
Name | Pin | Description |
---|---|---|
TCK | 1 | Test Clock (clock signal from the AVR Dragon into the target device) |
TMS | 5 | Test Mode Select (control signal from the AVR Dragon into the target device) |
TDI | 9 | Test Data In (data transmitted from the AVR Dragon into the target device) |
TDO | 3 | Test Data Out (data transmitted from the target device into the AVR Dragon) |
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 Dragon to hold the target device in a reset state, which can be essential to debugging in certain scenarios - for example if the JTD bit is set by the application firmware, disbling the JTAG interface. The nSRST pin has a internal pullup resistor in the AVR Dragon. |
VTref | 4 | Target voltage reference. The AVR Dragon samples the target voltage on this pin in order to power the level converters correctly. The AVR Dragon draws less than 1mA from this pin. |
GND | 2, 10 | Ground. Both must be connected to ensure that the AVR Dragon and the target device share the same ground reference. |
Tip: remember to include a decoupling capacitor between pins 4 and 2.
Note: The AVR Dragon cannot be powered by the target. Vsupply (pin 7) should be left as NOT CONNECTED.
When external circuitry shares the JTAG debug lines on the target application, series resistors should be used to avoid driver contention, as shown in Figure 4.1, “JTAG interface basics”. The value of the resistors should be chosen so that the external circuitry and the AVR do not exceed their maximum ratings (i.e. sink or source too much current). 1k is a commonly used value.
It is recommended to disconnect any analog filters on these lines (which should be on the 'outside' of the resistors) during a JTAG session, since these elements are discharged by the JTAG signals, possibly causing false logic levels influenced by the residual voltage in the capacitor. If the filters cannot be disconnected, it is then recommended to apply target Vcc directly to the capacitor during a session to hold the voltage stable. Be sure to use a large enough resistor between the capacitor and the JTAG line when doing this!
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 4.3, “JTAG daisy-chain”.
When connecting devices in a daisy-chain, the following points must be considered:
All devices must share a common ground, connected to GND on the AVR Dragon probe
All devices must be operating on the same target voltage. VTref on the AVR Dragon probe must be connected to this voltage.
TMS and TCK are connected in parallel; TDI and TDO are connected in a serial chain.
NSRST on the AVR Dragon probe must be connected to RESET on the devices if any one of the devices in the chain disables its JTAG port.
"Devices before" refers to the number of JTAG devices that the TDI signal has to pass through in the daisy chain before reaching the target device. Similarly "devices after" is the number of devices that the signal has to pass through after the target device before reaching the AVR Dragon TDO pin.
"Instruction bits before" and "after" refers to the sum total of all JTAG devices' instruction register lengths which are connected before and after the target device in the daisy chain.
Note that when changing the daisy-chain settings from the programming dialog, the dialog must be closed and re-opened before the settings take effect.
The total IR length (instruction bits before + instruction bits after) is limited to a maximum or 32 bits.
Daisy chaining example: TDI -> ATmega1280 -> ATxmega128A1 -> ATUC3A0512 -> TDO
In order to connect to the 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 (AVR32 devices have 5 IR bits)
aWire is a single-pin interface for programming and debugging of low-pin-count AVR32 devices using the RESET pin. All features of the OCD system available through the JTAG interface can also be accessed using aWire.
When designing an application PCB which includes an AVR with the aWire interface, the pinout shown in Figure 4.4, “aWire header pinout” should be used. While future aWire capable tools will support this pinout, the AVR Dragon requires that the 10-pin "squid" cable be used to map to this pinout.