
Chapter 1. Introducing EZ-USB FX2 Page 1-5
• STALL means that something unforeseen went wrong (probably as a result of miscommu-
nication or lack of cooperation between the host and device software). A device sends the
STALL handshake to indicate that it doesn’t understand a device request, that something
went wrong on the peripheral end, or that the host tried to access a resource that wasn’t
there. It’s like HALT, but better, because USB provides a way to recover from a stall.
• NYET (“Not Yet”) has the same meaning as ACK — the data was received error-free —
but also indicates that the endpoint is not yet ready to receive another OUT transfer. NYET
PIDs occur only in high speed mode.
A PRE (Preamble) PID precedes a low-speed (1.5 Mbits/sec) USB transmission. The FX2 sup-
ports full-speed (12 Mbits/sec) and high-speed (480 Mbits/sec) USB transfers only.
1.6.1 Receiving Data from the Host
To send data to a USB peripheral, the host issues an OUT token followed by the data. If the periph-
eral has space for the data and accepts it without error, it returns an ACK to the host. If it is busy, it
sends a NAK. If it finds an error, it sends back nothing. For the latter two cases, the host re-sends
the data at a later time.
1.6.2 Sending Data to the Host
A USB device never spontaneously sends data to the host. Either FX2 firmware or external
logic can load data into an FX2 endpoint buffer and ‘arm’ it for transfer at any time. However, the
data is not transmitted to the host until the host issues an IN request to the FX2 endpoint. If the
host never sends the IN token, the data remains in the FX2 endpoint buffer indefinitely.
1.7 USB Frames
The USB host provides a time base to all USB devices by transmitting an SOF (“Start of Frame”)
packet every millisecond. SOF packets include an 11-bit number which increments once per
frame; the current frame number [0-2047] may be read from internal FX2 registers at any time.
At high speed (480 Mbits/sec), each one-millisecond frame is divided into eight 125-microsecond
microframes,
each of which is preceded by an SOF packet. The frame number still increments only
once per millisecond, so each of those SOF packets contains the same frame number. To keep
track of the current microframe number [0-7], the FX2 provides a readable microframe counter.
The FX2 can generate an interrupt request whenever it receives an SOF (once every millisecond
at full speed, or once every 125 microseconds at high speed). This SOF interrupt can be used, for
example, to service isochronous endpoint data.
Commentaires sur ces manuels