
11
If the CPU writes the HXFR register late enough in a frame that the ensuing transfer would
collide with the frame marker, the SIE automatically defers sending the packet until after it
generates the next frame marker.
Note:
A USB host transfers data over BULK and INTERRUPT endpoints using identical
methods. The only difference between these two transfer types is
when
the packets are
scheduled, a function of the controlling firmware. This document refers to BULK transfers with
the understanding that any BULK discussion also applies for INTERRUPT transfers.
About MAX3421E Data Toggles
USB protocol tags every data packet with one of two PIDs (Packet ID’s) called DATA0 and
DATA1. These PIDs help detect USB errors. Associated with every endpoint is a
data toggle
value, which determines which DATA PIDs to use. The first data packet (after reset) to or from
an endpoint is sent using the DATA0 PID. When both sides, the sending and receiving ends,
agree that the data is accurate (by generating/receiving the ACK handshake), they both
complement their toggle values. Therefore, consecutive data packets sent to or received from an
endpoint normally will have
toggling
PID values—DATA0, DATA1, DATA0, etc.
The MAX3421E provides four bits to maintain the data toggles. After a data transfer to an
endpoint, the SIE updates bits RCVTOGRD and SNDTOGRD (page
values for the selected endpoint. The CPU reads and stores these bits to re-initialize the toggle
value for the same endpoint when necessary. To initialize the toggle state before transferring to
an endpoint, the CPU sets one of the bit pairs SNDTOG1-SNDTOG0 for OUT data, or
RCVTOG1-RCVTOG0 for IN data (page
). Only one of these bit pairs should be set at a time.
The CPU does not need to initialize an endpoint’s toggle value for multiple
consecutive
transfers
to the
same
endpoint. The MAX3421E updates the data toggle value as it performs transfers to
the endpoint. Only when the CPU
switches
endpoints does it need to restore the data toggle bits
to the values that it saved for the endpoint.