EasyManua.ls Logo

NXP Semiconductors KL25 Series - On-The-Go Operation

NXP Semiconductors KL25 Series
807 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1. Complete all steps to 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 0x1D to ENDPT0 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 TOKDNE interrupt. This indicates that one of the BDTs has been
released back to the processor and the transfer has completed. If the target device
asserts NAKs, the USB-FS continues to retry the transfer indefinitely without
processor intervention unless the ENDPT0[RETRYDIS] is 1. If the retry disable field
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.5 μs), 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.
35.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.
Chapter 35 Universal Serial Bus OTG Controller (USBOTG)
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc. 647

Table of Contents

Related product manuals