
EP1OUTBC
Meaning:
Endpoint 1-0UT Byte Count.
Location:
EP1OUTBC[6:0]
Write:
After successfully receiving an OUT transfer over Endpoint 1,
the SIE ACKS the
transfer, updates this register with the received byte count, and asserts the
OUT1DAV interrupt request (page 51).
Read:
The CPU reads this register after receiving an OUT1DAV interrupt request to
determine how many bytes to read from the EP1OUTFIFO (page 14).
POR:
EP1OUTBC=0
Chip Reset:
EP1OUTBC=0
Bus Reset:
EP1OUTBC=0
Pwr Down:
No read or write
Programming Notes:
EP1OUT is a double-buffered endpoint, meaning that there are two FIFOS and byte count
registers. Double buffering allows USB data simultaneously to move into one FIFO while the
CPU reads data from the other. This improves bandwidth performance in many systems. See the
OUT1DAVIRQ bit discussion (page 51) for a description of how the double buffering works for
an OUT endpoint.
The double buffering is invisible to the programmer because the OUT1DAVIRQ flag logic
accommodates the double buffering. For example, assume that both buffers are available and
therefore OUT1DAVIRQ=0. When an OUT packet arrives, OUT1DAVIRQ makes a 0-1
transition to indicate availability of the first packet. For a single-buffered endpoint, if another
OUT packet arrived over EP1-OUT before the CPU had time to drain the FIFO, the SIE would
respond with a NAK handshake to indicate that the endpoint was not available to accept data.
However with the double buffered endpoint, the second OUT packet is accepted and ACK’d
because the second buffer is available for data. If a third OUT packet arrives before either FIFO
is drained, the SIE NAKS the transfer to indicate that both FIFOS are full.
13