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

When the USB device controller is in full-speed mode, setting DETACH will disconnect the pull-up on the D+ . Then, clearing DETACH will connect the pull-up on the D+.

Figure 85. Detach a device in Full-speed:

UVREF UVREF

 

D +

D +

 

D -

D -

 

Detach, then

 

EN=1

Attach

EN=1

Remote Wake-up

STALL request

The “Remote Wake-up” (or “upstream resume”) request is the only operation allowed to be sent by the device on its own initiative. Anyway, to do that, the device should first have received a DEVICE_REMOTE_WAKEUP request from the host.

First, the USB controller must have detected the “suspend” state of the line: the remote wake-up can only be sent if the SUSPI bit is set.

The firmware has then the ability to set RMWKUP to send the “upstream resume” stream. This will automatically be done by the controller after 5ms of inactivity on the USB line.

When the controller starts to send the “upstream resume”, the UPRSMI flag is set and interrupt is triggered (if enabled). If SUSPI was set, SUSPI is cleared by hardware.

RMWKUP is automatically cleared by hardware at the end of the “upstream resume”.

After that, if the controller detects a good “End Of Resume” signal from the host, an EORSMI interrupt is triggered (if enabled).

For each endpoint, the STALL management is performed using 2 bits:

STALLRQ (enable stall request)

STALLRQC (disable stall request)

STALLEDI (stall sent interrupt)

To send a STALL handshake at the next request, the STALLRQ request bit has to be set. All following requests will be handshak’ed with a STALL until the STALLRQC bit is set.

Setting STALLRQC automatically clears the STALLRQ bit. The STALLRQC bit is also immediately cleared by hardware after being set by software. Thus, the firmware will never read this bit as set.

Each time the STALL handshake is sent, the STALLEDI flag is set by the USB controller and the EPINTx interrupt will be triggered (if enabled).

Special consideration for Control Endpoints

The incoming packets will be discarded (RXOUTI and RWAL will not be set).

The host will then send a command to reset the STALL: the firmware just has to set the STALLRQC bit and to reset the endpoint.

A SETUP request is always ACK’ed.

If a STALL request is set for a Control Endpoint and if a SETUP request occurs, the SETUP request has to be ACK’ed and the STALLRQ request and STALLEDI sent flags are automatically reset (RXSETUPI set, TXIN cleared, STALLED cleared, TXINI cleared...).

195

7707A–AVR–01/07

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