212
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P [DATASHEET]
8285E–AVR–02/2013
At the TMS input, apply the sequence 1, 0, 0 at the rising edges of TCK to enter the Shift Data Register – Shift-
DR state. While in this state, upload the selected Data Register (selected by the present JTAG instruction in the
JTAG Instruction Register) from the TDI input at the rising edge of TCK. In order to remain in the Shift-DR state,
the TMS input must be held low during input of all bits except the MSB. The MSB of the data is shifted in when
this state is left by setting TMS high. While the Data Register is shifted in from the TDI pin, the parallel inputs to
the Data Register captured in the Capture-DR state is shifted out on the TDO pin
Apply the TMS sequence 1, 1, 0 to re-enter the Run-Test/Idle state. If the selected Data Register has a latched
parallel-output, the latching takes place in the Update-DR state. The Exit-DR, Pause-DR, and Exit2-DR states are
only used for navigating the state machine
As shown in the state diagram, the Run-Test/Idle state need not be entered between selecting JTAG instruction
and using Data Registers, and some JTAG instructions may select certain functions to be performed in the Run-
Test/Idle, making it unsuitable as an Idle state.
Note:
Independent of the initial state of the TAP Controller, the Test-Logic-Reset state can always be entered by holding TMS
high for five TCK clock periods.
24.5
Using the Boundary-scan Chain
24.6
Using the On-chip Debug System
A scan chain on the interface between the internal AVR CPU and the internal peripheral units
Break Point unit
Communication interface between the CPU and JTAG system
All read or modify/write operations needed for implementing the Debugger are done by applying AVR instructions
via the internal AVR CPU Scan Chain. The CPU sends the result to an I/O memory mapped location which is part
of the communication interface between the CPU and the JTAG system.
The Break Point Unit implements Break on Change of Program Flow, Single Step Break, two Program Memory
Break Points, and two combined Break Points. Together, the four Break Points can be configured as either:
4 single Program Memory Break Points
3 Single Program Memory Break Point + 1 single Data Memory Break Point
2 single Program Memory Break Points + 2 single Data Memory Break Points
2 single Program Memory Break Points + 1 Program Memory Break Point with mask (“range Break Point”)
2 single Program Memory Break Points + 1 Data Memory Break Point with mask (“range Break Point”)
A debugger, like the AVR Studio, may however use one or more of these resources for its internal purpose, leaving
less flexibility to the end-user.
The JTAGEN Fuse must be programmed to enable the JTAG Test Access Port. In addition, the OCDEN Fuse must
be programmed and no Lock bits must be set for the On-chip debug system to work. As a security feature, the On-
chip debug system is disabled when either of the LB1 or LB2 Lock bits are set. Otherwise, the On-chip debug sys-
tem would have provided a back-door into a secured device.
The AVR Studio enables the user to fully control execution of programs on an AVR device with On-chip Debug
capability, AVR In-Circuit Emulator, or the built-in AVR Instruction Set Simulator. AVR Studio supports source