Information Technology Reference
In-Depth Information
host-to-device packet), IN (device-to-host packet), or SOF (start-of-frame
marker).
The data packet contains any data the host or device is sending in the trans-
action. For control transfers, the transfer stage and the request determine
who sends the data. For other transfers, the endpoint's direction determines
who sends the data. The PID contains the data-toggle value, as explained
below.
The handshake packet is sent by the receiver of the data packet. The PID
contains a code to indicate whether the data was received without error. A
code of ACK means success, NAK means busy, and STALL means either
that the device doesn't support a received request in a control transfer or that
the endpoint's Halt feature is set. High-speed bulk OUT endpoints can also
return a NYET handshake code, which means that the endpoint accepted
the data in the current transaction but isn't yet ready for more data.
The Data Toggle
The data toggle is a data-sequencing value that guards against lost or dupli-
cated data. If you're debugging a device where it appears that the proper data
is transmitting on the bus but the receiver is discarding the data, chances are
good that the device isn't sending or expecting the correct data toggle.
Each endpoint maintains its own data-toggle value, which alternates
between DATA0 and DATA1. Devices typically store the value in a register
bit. When the host configures a device on power up or attachment, the host
and device each set their data toggles to DATA0. On detecting an incoming
data packet, the host or device compares the state of its data toggle with the
data toggle in the received data packet. If the values match, the data packet's
receiver toggles its value for the next transaction and returns an ACK. On
receiving the ACK, the data packet's sender toggles its value for the next
transaction.
The next received packet should contain a data toggle of DATA1, and again
the receiver toggles its bit and returns an ACK. In additional transactions,
the data toggle continues to alternate between DATA0 and DATA1. An
exception is control transfers, where the Status stage always uses DATA1.
Search WWH ::




Custom Search