Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AVR / datasheets / atmega_128.pdf
Скачиваний:
49
Добавлен:
20.03.2015
Размер:
3.56 Mб
Скачать

ATmega128

Boundary-scan Chain

The Boundary-scan chain has the capability of driving and observing the logic levels on the digital I/O pins, as well as the boundary between digital and analog logic for analog circuitry having off-chip connection.

Scanning the Digital Port Pins Figure 124 shows the Boundary-scan Cell for a bi-directional port pin with pull-up function. The cell consists of a standard Boundary-scan cell for the Pull-up Enable – PUExn

– function, and a bi-directional pin cell that combines the three signals Output Control – OCxn, Output Data – ODxn, and Input Data – IDxn, into only a two-stage Shift Register. The port and pin indexes are not used in the following description

The Boundary-scan logic is not included in the figures in the Data Sheet. Figure 125 shows a simple digital Port Pin as described in the section “I/O Ports” on page 63. The Boundary-scan details from Figure 124 replaces the dashed box in Figure 125.

When no alternate port function is present, the Input Data – ID corresponds to the PINxn Register value (but ID has no synchronizer), Output Data corresponds to the PORT Register, Output Control corresponds to the Data Direction – DD Register, and the Pullup Enable – PUExn – corresponds to logic expression PUD · DDxn · PORTxn.

Digital alternate port functions are connected outside the dotted box in Figure 125 to make the scan chain read the actual pin value. For Analog function, there is a direct connection from the external pin to the analog circuit, and a scan chain is inserted on the interface between the digital logic and the analog circuitry.

Figure 124. Boundary-scan Cell for Bi-directional Port Pin with Pull-Up Function.

Pullup Enable (PUE)

Output Control (OC)

ShiftDR

To Next Cell

FF2

0

 

D

Q

1

 

FF1

0

 

D

Q

1

 

EXTEST Vcc

0 LD2 1

D Q

G

LD1

0

 

 

D Q

1

 

G

 

 

 

Output Data (OD)

0

FF0

LD0

0

 

0

 

Port Pin (PXn)

1

 

1

D Q

D Q

 

 

 

1

G

 

 

 

 

Input Data (ID)

From Last Cell

ClockDR

UpdateDR

259

2467K–AVR–04/04

Figure 125. General Port Pin Schematic diagram

See Boundary-Scan description for details!

Boundary-scan and the Twowire Interface

PUExn

 

 

 

 

PUD

 

 

 

 

Q

D

 

 

 

 

 

DDxn

 

 

 

 

 

Q CLR

 

 

 

 

 

 

RESET

WDx

 

OCxn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RDx

 

Pxn

 

 

Q

D

 

BUS

 

 

 

DATA

ODxn

 

 

PORTxn

 

 

 

 

 

 

 

 

Q CLR

 

 

 

IDxn

 

 

RESET

WPx

 

 

 

 

 

 

SLEEP

 

 

 

 

RRx

 

SYNCHRONIZER

 

RPx

 

 

 

 

 

 

 

D

Q

D

Q

 

 

 

 

 

PINxn

 

 

 

L

Q

 

Q

 

 

 

 

 

 

 

 

CLK I/O

 

PUD:

PULLUP DISABLE

WDx:

WRITE DDRx

PUExn:

PULLUP ENABLE for pin Pxn

RDx:

READ DDRx

OCxn:

OUTPUT CONTROL for pin Pxn

WPx:

WRITE PORTx

ODxn:

OUTPUT DATA to pin Pxn

RRx:

READ PORTx REGISTER

IDxn:

INPUT DATA from pin Pxn

RPx:

READ PORTx PIN

SLEEP:

SLEEP CONTROL

CLK I/O :

I/O CLOCK

The two Two-wire Interface pins SCL and SDA have one additional control signal in the scan-chain; Two-wire Interface Enable – TWIEN. As shown in Figure 126, the TWIEN signal enables a tri-state buffer with slew-rate control in parallel with the ordinary digital port pins. A general scan cell as shown in Figure 130 is attached to the TWIEN signal.

Notes: 1. A separate scan chain for the 50 ns spike filter on the input is not provided. The ordinary scan support for digital port pins suffice for connectivity tests. The only reason for having TWIEN in the scan path, is to be able to disconnect the slew-rate control buffer when doing boundary-scan.

2.Make sure the OC and TWIEN signals are not asserted simultaneously, as this will lead to drive contention.

260 ATmega128

2467K–AVR–04/04

ATmega128

Figure 126. Additional Scan Signal for the Two-wire Interface

PUExn

Pxn

SRC

OCxn

ODxn

TWIEN

Slew-rate limited

IDxn

Scanning the RESET Pin The RESET pin accepts 5V active low logic for standard Reset operation, and 12V active high logic for High Voltage Parallel programming. An observe-only cell as shown in Figure 127 is inserted both for the 5V Reset signal; RSTT, and the 12V Reset signal; RSTHV.

Figure 127. Observe-only Cell

 

 

 

 

 

 

 

To

 

 

 

 

 

 

next

 

 

ShiftDR

 

cell

From system pin

 

 

 

 

 

To system logic

 

 

 

 

 

 

 

 

 

 

 

 

FF1

 

 

 

 

0

 

 

 

 

 

 

 

 

1

 

D

Q

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

From ClockDR

previous

cell

Scanning the Clock Pins The AVR devices have many clock options selectable by fuses. These are: Internal RC Oscillator, External RC, External Clock, (High Frequency) Crystal Oscillator, Low-fre- quency Crystal Oscillator, and Ceramic Resonator.

Figure 128 shows how each Oscillator with external connection is supported in the scan chain. The Enable signal is supported with a general boundary-scan cell, while the Oscillator/Clock output is attached to an observe-only cell. In addition to the main clock, the Timer Oscillator is scanned in the same way. The output from the internal RC Oscillator is not scanned, as this Oscillator does not have external connections.

261

2467K–AVR–04/04

Figure 128. Boundary-scan Cells for Oscillators and Clock Options

XTAL1/TOSC1 XTAL2/TOSC2

 

 

 

 

 

 

 

To

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Next

 

 

 

Oscillator

 

 

 

 

 

 

To

 

ShiftDR

 

Cell

 

EXTEST

 

 

 

 

 

next

From Digital Logic

 

 

 

 

 

 

 

 

 

0

 

 

 

 

ShiftDR

 

cell

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE

OUTPUT

 

 

 

 

 

 

 

To System Logic

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

1

 

 

 

 

 

FF1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D

Q

 

 

 

D

Q

 

 

 

 

 

 

0

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

G

 

 

 

 

 

 

 

1

 

D

Q

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

From ClockDR

UpdateDR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

From ClockDR

 

 

 

Previous

 

 

 

 

 

 

 

 

 

 

 

 

 

Cell

 

 

 

 

 

 

 

 

 

 

Previous

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cell

 

 

 

Table 103 summaries the scan registers for the external clock pin XTAL1, oscillators with XTAL1/XTAL2 connections as well as 32 kHz Timer Oscillator.

Table 103. Scan Signals for the Oscillators(1)(2)(3)

 

Scanned Clock

 

Scanned Clock Line

Enable signal

Line

Clock Option

when not Used

 

 

 

 

EXTCLKEN

EXTCLK (XTAL1)

External Clock

0

 

 

 

 

OSCON

OSCCK

External Crystal

0

 

 

External Ceramic Resonator

 

 

 

 

 

RCOSCEN

RCCK

External RC

1

 

 

 

 

OSC32EN

OSC32CK

Low Freq. External Crystal

0

 

 

 

 

TOSKON

TOSCK

32 kHz Timer Oscillator

0

 

 

 

 

Notes: 1. Do not enable more than one clock source as main clock at a time.

2. Scanning an Oscillator output gives unpredictable results as there is a frequency drift between the Internal Oscillator and the JTAG TCK clock. If possible, scanning an external clock is preferred.

 

3. The clock configuration is programmed by fuses. As a fuse is not changed run-time,

 

the clock configuration is considered fixed for a given application. The user is advised

 

to scan the same clock option as to be used in the final system. The enable signals

 

are supported in the scan chain because the system logic can disable clock options

 

in sleep modes, thereby disconnecting the Oscillator pins from the scan path if not

 

provided. The INTCAP fuses are not supported in the scan-chain, so the boundary

 

scan chain can not make a XTAL Oscillator requiring internal capacitors to run unless

 

the fuse is correctly programmed.

Scanning the Analog

The relevant Comparator signals regarding Boundary-scan are shown in Figure 129.

Comparator

The Boundary-scan cell from Figure 130 is attached to each of these signals. The sig-

 

nals are described in Table 104.

 

The Comparator need not be used for pure connectivity testing, since all analog inputs

 

are shared with a digital port pin as well.

262 ATmega128

2467K–AVR–04/04

ATmega128

Figure 129. Analog comparator

BANDGAP

REFERENCE

ACBG

ACO

AC_IDLE

ACME

ADCEN

ADC MULTIPLEXER

OUTPUT

Figure 130. General Boundary-scan Cell used for Signals for Comparator and ADC

 

 

 

 

 

 

 

To

 

 

 

 

 

 

 

 

 

 

 

 

Next

 

 

 

 

 

 

 

 

ShiftDR

Cell

 

EXTEST

 

From Digital Logic/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

From Analog Ciruitry

 

 

 

 

 

 

 

 

 

To Analog Circuitry/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

1

 

 

To Digital Logic

 

 

 

D

Q

 

 

D Q

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

G

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

From ClockDR UpdateDR

Previous

Cell

263

2467K–AVR–04/04

Соседние файлы в папке datasheets