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

Typical Application Implementation

Depending on the USB operating mode and target application power supply, the AT90USB82/162 requires different hardware typical implementations.

Figure 75. Operating modes versus frequency and power-supply

 

VCC (V)

Max

 

Operating Frequency (MHz)

 

 

5.5

 

 

4.5

 

16 MHz

 

 

 

USB compliant,

 

 

with internal regulator

 

3.6

 

8 MHz

3.4

USB compliant,

 

 

 

 

without internal regulator

 

3.0

 

 

2.7

USB not operational

 

 

2 MHz

VCC min

 

 

 

0

 

 

Device mode

Bus Powered device

Figure 76. Typical Bus powered application with 5V I/O

VCC

 

UCAP

 

1µF

VBUS

UVCC

UDM

D+

UDP

D-

UVSS

UVSS

 

 

VSS

XTAL1 XTAL2

180

7707A–AVR–01/07

Figure 77. Typical Bus powered application with 3V I/O

VCC

 

UCAP

 

1µF

VBUS

UVCC

UDM

D+

UDP

D-

UVSS

UVSS

 

 

VSS

XTAL1 XTAL2

Serial resistors on USB Data lines should have 22 Ohms value (+/-5%).

Ucap capacitor should have 1µF (+/- 10%) value for correct operation.

181

7707A–AVR–01/07

General Operating

Modes

Introduction

The USB controller is disabled and reset after a hardware reset generated by:

Power on reset

External reset

Watchdog reset

Brown out reset

debugWIRE reset

But another available and optionnal reset source is :

USB End Of Reset

In this case, the USB controller is reset, but not disabled (so that the device remains attached).

Power-on and reset The next diagram explains the USB controller main states on power-on:

Figure 78. USB controller states after reset

Clockstopped

USBE=0

<anyother

FRZCLK=1

state>

 

Macrooff

 

 

 

Reset

HWRESET

 

 

(exceptedfromEOR)

USBE=1

USBE=0

 

USBE=0

 

Dev ice

HW RESETfrom EOR

When the USB controller is in reset state:

• USBE is not set

• the USB controller clock is stopped in order to minimize the power consumption (FRZCLK=1),

• the USB controller is disabled,

• USB is in the suspend mode,

• the Device USB controllers internal state is reset.

• The DPACC bit and the DPADD10:0 field can be set by software. The DPRAM is not

 

cleared.

 

• The SPDCONF bits can be set by software.

 

After setting USBE, the USB Controller enters in the Device state.

 

The USB Controller can at any time be ‘stopped’ by clearing USBE. In fact, clearing USBE acts

 

as an hardware reset on the USB macro.

Interrupts

Two interrupts vectors are assigned to USB controller.

182

 

 

7707A–AVR–01/07

Figure 79. USB Interrupt System

USB General

USB Device Interrupt Vector

Interrupt

USB Endpoint/Pipe

Interrupt Vector

Endpoint

Interrupt

The macro distinguishes between USB General events in opposition with USB Endpoints events that are relevant with data transfers relatives to each endpoint.

Figure 80. USB General interrupt vector sources

UPRSMI

UDINT.6

UPRSME

UDIEN.6

EORSMI

UDINT.5

EORSME

UDIEN.5

WAKEUPI

UDINT.4

WAKEUPE

UDIEN.4

EORSTI

UDINT.3

EORSTE

UDIEN.3

SOFI

UDINT.2

SOFE

UDIEN.2

SUSPI

UDINT.0

SUSPE

UDIEN.0

USB General

Interrupt Vector

Asynchronous Interrupt source

(allows the CPU to wake up from power down mode)

Each of these interupts are time-relative events that will be detected only if the USB clock is enabled (FRZCLK bit set), except for the WAKEUP interrupt that will trigger each time a state change is detected on the data lines.

This asynchronous interrupt WAKEUP allows to wake-up a device that is in power-down mode, generally after that the USB has entered the Suspend state.

183

7707A–AVR–01/07

Figure 81. USB Endpoint Interrupt vector sources

Endpoint 4

Endpoint 3

Endpoint 2

Endpoint 1

 

 

Endpoint 0

OVERFI

 

 

UESTAX.6

 

 

UNDERFI

FLERRE

 

UESTAX.5

 

UEIENX.7

 

 

 

NAKINI

 

 

UEINTX.6

NAKINE

 

 

 

 

UEIENX.6

 

NAKOUTI

 

 

UEINTX.4

TXSTPE

 

 

 

 

UEIENX.4

 

RXSTPI

 

EPINT

UEINTX.3

 

TXOUTE

UEINT.X

 

 

 

 

UEIENX.3

 

RXOUTI

 

 

UEINTX.2

RXOUTE

 

 

 

 

UEIENX.2

 

STALLEDI

 

 

UEINTX.1

STALLEDE

 

 

 

 

UEIENX.1

 

TXINI

 

 

UEINTX.0

TXINE

 

 

 

 

UEIENX.0

 

USB Endpoint

Interrupt Vector

Each endpoint has 8 interrupts sources associated with flags, and each source can be enabled or not to trigger the corresponding endpoint interrupt.

If, for an endpoint, at least one of the sources is enabled to trigger interrupt, the corresponding event(s) will make the program branch to the USB Endpoint Interrupt vector. The user may determine the source (endpoint) of the interrupt by reading the UEINT register, and then handle the event detected by polling the different flags.

184

7707A–AVR–01/07

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