English
Language : 

K60P100M100SF2RM Datasheet, PDF (1270/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
On-The-Go Operation
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.
45.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.
1270
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
Freescale Semiconductor, Inc.