English
Language : 

ATMEGA165P Datasheet, PDF (231/365 Pages) ATMEL Corporation – 8-bit AVR Microcontroller with 16K Bytes In-System Programmable Flash
Figure 22-2. TAP Controller State Diagram
1
Test-Logic-Reset
0
0
Run-Test/Idle 1
Select-DR Scan 1
0
1 Capture-DR
0
Shift-DR
0
1
Exit1-DR
1
0
Pause-DR
0
1
0
Exit2-DR
1
Update-DR
1
0
ATmega165P
Select-IR Scan 1
0
1 Capture-IR
0
Shift-IR
0
1
Exit1-IR
1
0
Pause-IR
0
1
0
Exit2-IR
1
Update-IR
1
0
22.3 TAP Controller
The TAP controller is a 16-state finite state machine that controls the operation of the Boundary-
scan circuitry, JTAG programming circuitry, or On-chip Debug system. The state transitions
depicted in Figure 22-2 depend on the signal present on TMS (shown adjacent to each state
transition) at the time of the rising edge at TCK. The initial state after a Power-on Reset is Test-
Logic-Reset.
As a definition in this document, the LSB is shifted in and out first for all Shift Registers.
Assuming Run-Test/Idle is the present state, a typical scenario for using the JTAG interface is:
• At the TMS input, apply the sequence 1, 1, 0, 0 at the rising edges of TCK to enter the Shift
Instruction Register – Shift-IR state. While in this state, shift the four bits of the JTAG
instructions into the JTAG Instruction Register from the TDI input at the rising edge of TCK.
The TMS input must be held low during input of the 3 LSBs in order to remain in the Shift-IR
state. The MSB of the instruction is shifted in when this state is left by setting TMS high. While
the instruction is shifted in from the TDI pin, the captured IR-state 0x01 is shifted out on the
TDO pin. The JTAG Instruction selects a particular Data Register as path between TDI and
TDO and controls the circuitry surrounding the selected Data Register.
8018A–AVR–03/06
231