Cypress Semiconductor FX2LP Technical Information Seite 30

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 460
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 29
EZ-USB FX2 Technical Reference Manual
Page 1-4 EZ-USB FX2 Technical Reference Manual v2.1
Figure 1-1. USB Packets
Figure 1-1 illustrates a USB OUT transfer. Host traffic is shown in solid shading, while device traf-
fic is shown crosshatched. Packet 1 is an OUT token, indicated by the OUT PID. The OUT token
signifies that data from the host is about to be transmitted over the bus. Packet 2 contains data, as
indicated by the DATA1 PID. Packet 3 is a handshake packet, sent by the device using the ACK
(acknowledge) PID to signify to the host that the device received the data error-free.
Continuing with Figure 1-1, a second transaction begins with another OUT token 4, followed by
more data 5, this time using the DATA0 PID. Finally, the device again indicates success by trans-
mitting the ACK PID in a handshake packet 6.
When operating at full speed, every OUT transfer sends the OUT data, even when the device is
busy and can’t accept the data. When operating at high speed, this slightly wasteful use of USB
bandwidth is remedied by using the new “Ping” PID. The host first sends a short PING token to an
OUT endpoint, asking if there is room for OUT data in the peripheral device. Only when the PING
is answered by an ACK does the host send the OUT token and data.
There are
two
DATA PIDs (DATA0 and DATA1) in Figure1-1 because the USB architects took
error correction very seriously. As mentioned previously, the ACK handshake is an indication to
the host that the peripheral received data without error (the CRC portion of the packet is used to
detect errors). But what if the handshake packet itself is garbled in transmission? To detect this,
each side (host and device) maintains a
data toggle
bit, which is toggled between data packet
transfers. The state of this internal toggle bit is compared with the PID that arrives with the data,
either DATA0 or DATA1. When sending data, the host or device sends alternating DATA0-DATA1
PIDs. By comparing the received Data PID with the state of its own internal toggle bit, the receiver
can detect a corrupted handshake packet.
SETUP tokens are unique to CONTROL transfers. They preface eight bytes of data from which
the peripheral decodes host Device Requests.
At full speed, SOF (Start of Frame) tokens occur once per millisecond. At high speed, each frame
contains eight SOF tokens, each denoting a 125-microsecond microframe.
Four handshake PIDs indicate the status of a USB transfer:
ACK (“Acknowledge”) means success; the data was received error-free.
NAK (“Negative Acknowledge”) means “busy, try again.” It’s tempting to assume that NAK
means “error,” but it doesn’t; a USB device indicates an error by
not responding
.
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D
A
T
A
1
Payload
Data
C
R
C
1
6
Data Packet
A
C
K
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D
A
T
A
0
Payload
Data
C
R
C
1
6
Data Packet
A
C
K
H/S Pkt
H/S Pkt
1 2 3 4 5 6
Seitenansicht 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 459 460

Kommentare zu diesen Handbüchern

Keine Kommentare