Datasheet
239
ATmega169A/PA/329A/PA/649A/P/3290A/PA/6490A/P [DATASHEET]
8284E–AVR–02/2013
25. JTAG Interface and On-chip Debug System
25.1 Features
• JTAG (IEEE std. 1149.1 Compliant) interface
• Boundary-scan capabilities according to the IEEE std. 1149.1 (JTAG) standard
• Debugger access to:
– All internal peripheral units
– Internal and external RAM
– The internal register file
–Program counter
– EEPROM and flash memories
• Extensive on-chip debug support for break conditions, including:
– AVR break instruction
– Break on change of program memory flow
– Single step break
– Program memory break points on single address or address range
– Data memory break points on single address or address range
• Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
• On-chip debugging supported by the Atmel AVR Studio
®
25.2 Overview
The AVR IEEE std. 1149.1 compliant JTAG interface can be used for
• Testing PCBs by using the JTAG Boundary-scan capability
• Programming the non-volatile memories, Fuses and Lock bits
• On-chip debugging
A brief description is given in the following sections. Detailed descriptions for Programming via the JTAG interface,
and using the Boundary-scan Chain can be found in the sections ”Programming via the JTAG Interface” on page
312 and ”IEEE 1149.1 (JTAG) Boundary-scan” on page 245, respectively. The On-chip Debug support is consid-
ered being private JTAG instructions, and distributed within Atmel and to selected third party vendors only.
Figure 25-1 on page 240 shows a block diagram of the JTAG interface and the On-chip Debug system. The TAP
Controller is a state machine controlled by the TCK and TMS signals. The TAP Controller selects either the JTAG
Instruction Register or one of several Data Registers as the scan chain (Shift Register) between the TDI – input
and TDO – output. The Instruction Register holds JTAG instructions controlling the behavior of a Data Register.
The ID-Register, Bypass Register, and the Boundary-scan Chain are the Data Registers used for board-level test-
ing. The JTAG Programming Interface (actually consisting of several physical and virtual Data Registers) is used
for serial programming via the JTAG interface. The Internal Scan Chain and Break Point Scan Chain are used for
On-chip debugging only.
25.3 TAP – Test Access Port
The JTAG interface is accessed through four of the AVR’s pins. In JTAG terminology, these pins constitute the
Test Access Port – TAP. These pins are:
• TMS: Test mode select. This pin is used for navigating through the TAP-controller state machine
• TCK: Test Clock. JTAG operation is synchronous to TCK
• TDI: Test Data In. Serial input data to be shifted in to the Instruction Register or Data Register (Scan Chains)
• TDO: Test Data Out. Serial output data from Instruction Register or Data Register
The IEEE std. 1149.1 also specifies an optional TAP signal; TRST – Test ReSeT – which is not provided.