Freescale Semiconductor MCF52277 Reference Manual page 421

Table of Contents

Advertisement

2
NYET/ACK — NYET unless the transfer descriptor has packets remaining according
to the USB variable length protocol then ACK.
20.5.3.4.4
Control Endpoint Operation
Setup Phase
All requests to a control endpoint begin with a setup phase followed by an optional data phase and a
required status phase.
Setup packet managing:
Disable setup lockout by setting the setup lockout mode bit (USBMODE[SLOM]), once at
initialization. Setup lockout is not necessary when using the tripwire as described below.
Leaving the setup lockout mode cleared results in a potential compliance
issue.
After receiving an interrupt and inspecting EPSETUPSR to determine a setup packet was received
on a particular pipe:
1. Write 1 to clear corresponding bit in EPSETUPSR.
2. Set the setup tripwire bit (USBCMD[SUTW]).
3. Duplicate contents of dQH.SetupBuffer into local software byte array.
4. Read the USBCMD[SUTW] bit. If set, continue; if cleared, goto 2)
5. Clear the USBCMD[SUTW] bit.
6. Poll until the EPSETUPSR bit clears.
7. Process setup packet using the local software byte array copy and execute status/handshake phases.
After receiving a new setup packet, status and/or handshake phases may
remain pending from a previous control sequence. These should be flushed
and de-allocated before linking a new status and/or handshake dTD for the
most recent setup packet.
Data Phase
Following the setup phase, the DCD must create a device transfer descriptor for the data phase and prime
the transfer.
After priming the packet, the DCD must verify a new setup packet is not received by reading the
EPSETUPSR register immediately verifying that the prime had completed. A prime completes when the
associated bit in the EPPRIME register is cleared and the associated bit in the EPSR register is set. If the
EPPRIME bit goes to 0 and the EPSR bit is not set, the prime fails. This can only happen because of
improper setup of the dQH, dTD, or a setup arriving during the prime operation. If a new setup packet is
indicated after the EPPRIME bit is cleared, then the transfer descriptor can be freed and the DCD must
re-interpret the setup packet.
Freescale Semiconductor
NOTE
NOTE
MCF52277 Reference Manual, Rev. 1
Universal Serial Bus Interface – On-The-Go Module
20-63

Advertisement

Table of Contents
loading

Table of Contents