
Specification
NET2270 USB Interface Controller
______________________________________________________________________________
NetChip Technology, Inc., 2003
335 Pioneer Way, Mountain View, California 94041
TEL (650) 526-1490
FAX (650) 526-1494
http://www.netchip.com
Rev 3.6, April 17, 2003
40
5.7
Packet Buffers
The NET2270 contains one 2-Kbyte bank of memory that is allocated to the endpoint packet buffers. The
configuration of each endpoint buffer is selected by the Buffer Configuration field of the LOCCTL configuration
register. Available configurations for endpoints A and B are:
•
512 bytes, double-buffered (total of 1K bytes)
•
1024 bytes, single-buffered
•
1024 bytes double-buffered
The total size of all of the endpoint A and B buffers cannot exceed 2 Kbytes. Endpoints 0 and C each have a 128
byte buffer, configured as two 64-byte buffers. Data is stored in the buffers in 32-bit words, so each entry contains
between 1 and 4 bytes.
If a write to a full buffer is detected, the data is ignored. If a read from an empty buffer is detected, undefined data
is presented on the data bus.
5.7.1 IN Endpoint Buffers
IN packet data is written by the local CPU or DMA into one of the IN endpoint buffers. Once the buffer data has
been validated, it is returned to the USB host in response to an IN token. The NET2270 will not send more than
EP_MAXPKT bytes per packet. Once a packet has been written into a double-buffered buffer and validated, the
local CPU can continue loading data for the next packet. The NET2270 will automatically divide the data flow into
individual packets with a maximum size determined by the associated EP_MAXPKT register. This allows USB
transactions to overlap with loading of data from the local bus.
If the buffer data hasn’t been validated, the NET2270 responds to an IN token with a NAK handshake. There are
several methods for validating the data in the IN buffer:
•
For large amounts of data, the local bus controller can write data to the buffer as long as there is space
available. When there are at least EP_MAXPKT bytes in the buffer, the NET2270 will respond to an IN
token with a packet of data. If the entire data transfer is a multiple of EP_MAXPKT bytes, then nothing
else needs to be done to validate the buffer data. If a zero length packet needs to be sent to the host, the
local CPU can write a zero to the EP_TRANSFER register without writing any additional data to the
buffer.
•
For moderate amounts of data (between EP_MAXPKT and 16 Mbytes), a counter (EP_TRANSFER) is
used. This counter is initialized to the total transfer byte count before any data is written to the buffer. The
counter is decremented as data is written to the buffer. When the counter reaches zero, the remaining data
in the buffer is validated. If 16-bit transfers are being utilized on the local bus, excess bytes in the last
word are automatically ignored. If the last packet of a transfer has EP_MAXPKT bytes, then the
NET2270 will respond to the next IN token with a zero length packet.
•
For small amounts of data (character oriented applications), the data is first written to the buffer. Then a
zero is written to the EP_TRANSFER register, thus causing the data to be validated.
•
For a DMA write terminated with an EOT, the buffer data is validated if the DMA Buffer Valid bit in the
DMAREQ register is set. This causes a short or zero-length packet to be transmitted in response to the
next IN token.
Up to 2 short (less than EP_MAXPKT bytes) packets can be stored in a double-buffered packet buffer.