Datasheet
8−18
SLLS535E − April 2008TUSB6250
8.10.3 IEPBCNLX_n: Input Endpoint X-Buffer Byte-Count Low-Byte Register (n = 1
to 4) (XDATA at F012, F022, F032, F042)
The IEPBCNLX_n register contains the lower 8-bit value in the X-buffer that is used to specify the amount of
data to be transmitted in a data packet to the USB host.
76543210
C7 C6 C5 C4 C3 C2 C1 C0
R/W R/W R/W R/W R/W R/W R/W R/W
BIT
NAME RESET FUNCTION
7−0 C[7:0] 00h X-buffer byte-count: low byte
8.10.4 IEPBCNHX_n: Input Endpoint X-Buffer Byte-Count High-Byte Register (n = 1 to
4) (XDATA at F013, F023, F033, F043)
The IEPBCNHX_n register contains the NAK bit and the higher 3-bit value in the X-buffer that is used to specify
the amount of data to be transmitted in a data packet to the USB host.
76543210
NAK RSV RSV RSV RSV C10 C9 C8
R/W R/O R/O R/O R/O R/W R/W R/W
BIT
NAME RESET FUNCTION
2−0 C[10:8] 0 X-buffer byte count higher 3 bits. These bits in combination with C[7:0] provide the byte count of a given
transaction (count = 0 to 2047).
6−3 RSV 0 Reserved = 0
7 NAK 0 NAK bit is used as flow control handshake for X-buffer.
NAK = 0 This bit is cleared to 0 by the firmware to indicate that the endpoint data buffer contains a
valid packet for Host-IN request.
NAK = 1 This bit is set to 1 by the TUSB6250 hardware to indicate that the endpoint data buffer is empty
(TUSB6250 NAKs the Host-IN request).
Following is the procedure to be used by the firmware when using the NAK bit for flow-control handshake. For
the purpose of illustration, it is assumed that the double buffer (DBUF) is enabled. If DBUF is not enabled, the
X-buffer is always used regardless of the value of the data packet PID of the coming in-transfer.
1. The first in-transfer comes when the in-endpoint buffer is empty (data payload not ready for the in-transfer
received) and NAK =1. The TUSB6250 responds to the in-transfer with a NAK handshake and starts
preparing the data payload required for this in-transfer.
2. The MCU is alerted with a NAK interrupt to the current in-endpoint. The firmware loads the data into either
the X-buffer or Y-buffer depending on the following conditions:
− If DBUF = 1, TOGLE = 0, and the data PID = DATA0:
The firmware loads the data into the X-buffer of the endpoint data buffer (4K bytes EDB) and updates
the X-buffer byte-count information in IEPBCNLX_n and IEPBCNHX_n registers.
− If DBUF = 1, TOGLE = 1 and the data PID = DATA1:
The firmware loads the data into the Y-buffer of the endpoint data buffer (4K byte EDB) and updates
the Y-buffer byte-count information in the IEPBCNLY_n and IEPBCNHY_n registers.
3. The firmware then clears the NAK bit to 0 to indicate to the TUSB6250 hardware that a valid data packet
with the specified byte count is ready to be transmitted to the USB host.
4. The TUSB6250 hardware sends the data packet in the specified length on the USB host sending the next
IN-request with a valid IN-token.