7 on-the-go operation, 1 otg dual role a device operation, 7 on-the-go operation -36 – Freescale Semiconductor ColdFire MCF52210 User Manual

Page 264: 1 otg dual role a device operation -36

Advertising
background image

Universal Serial Bus, OTG Capable Controller

MCF52211 ColdFire® Integrated Microcontroller Reference Manual, Rev. 2

15-36

Freescale Semiconductor

To send a Full speed bulk data transfer to a target device:

1. Complete all steps discover a connected device and to configure a connected device. Write the

ADDR register with the address of the target device. Typically, there is only one other device on
the USB bus in host mode so it is expected that the address is 0x01 and should remain constant.

2.

Write the

ENDPT0 to 0x1D register to enable transmit and receive transfers with handshaking

enabled.

3. Setup the Even TX EP0 BDT to transfer up to 64 bytes.

4. Set the USB device address of the target device in the address register (ADDR[6:0]).

5. Write the TOKEN register with an OUT token to the desired endpoint. The write to this register

triggers the USB-FS transmit state machines to begin transmitting the TOKEN and the data.

6. Setup the Odd TX EP0 BDT to transfer up to 64 bytes.

7. Write the TOKEN register with an OUT token as in step 4. Two Tokens can be queued at a time to

allow the packets to be double buffered to achieve maximum throughput.

8. Wait for the TOK_DNE interrupt. This indicates one of the BDTs has been released back to the

microprocessor and that the transfer has completed. If the target device asserts NAKs, the USB-FS
continues to retry the transfer indefinitely without processor intervention unless the RETRY_DIS
retry disable bit is set in the EP0 control register. If the retry disable bit is set, the handshake (ACK,
NAK, STALL, or ERROR (0xf)) is returned in the BDT PID field. If a stall interrupt occurs, the
pending packet must be dequeued and the error condition in the target device cleared. If a RESET
interrupt occurs (SE0 for more than 2.5us), the target has detached.

9. After the TOK_DNE interrupt occurs, the BDTs can be examined and the next data packet queued

by returning to step 2.

15.7

On-The-Go Operation

The USB-OTG core provides sensors and controls to enable On-The-Go (OTG) operation. These sensors
are used by the OTG API software to implement the Host Negotiation Protocol (HNP) and Session
Request Protocol (SRP). API calls are provided to give access the OTG protocol control signals, and
include the OTG capabilities in the device application. The following state machines show the OTG
operations involved with HNP and SRP protocols from either end of the USB cable.

15.7.1

OTG Dual Role A Device Operation

A device is considered the A device because of the type of cable attached. If the USB Type A connector
or the USB Type Mini A connector is plugged into the device, he is considered the A device.

A dual role A device operates as the following flow diagram and state description table illustrates.

Advertising
This manual is related to the following products: