Designer Reference Manual USB08 Evaluation Board
76 Universal Serial Bus (USB) Interface MOTOROLA
Universal Serial Bu s (USB) Interface
4.7.1 Receiving Data
If data for endpoint 2 arrives, the interrupt handler calls handleOUT2().
The number of received bytes is noted in bits RPSIZ3RPSIZ0 with the
allowed values in the range of 08.
The received data bytes are transferred from the USB endpoint data
registers UE2D0UE2D7 to the buffer RxBuffer. This is a software ring
buffer, which can be filled by the interrupt service routine isrUSB() and
be read out by means of getUSB().
If the ring buffer is full, handleOUT2() waits until RxBuff er is able to store
data again. In this case, the USB module answers further transmission
attempts of the host with a NAK handshake.
NOTE: In a real application, you should not leave the buffer unserviced over a
longer period of time.
4.7.2 Transmission of Data
The transmit data for EP1 is placed by the user progr am, via the funct ion
putUSB(), into the send buffer TxBuffer. This is (just like RxBuffer) a ring
buffer, which blocks the application as soon as the buffer is about to
overflow.
The host polls all interrupt end points cyclically, taking into account a
guaranteed maximum latency time. That polling interval can be specified
in the endpoint descriptor. For low-speed USB devices with interrupt
endpoints the shortest specified polling interval is 10ms. That means,
Bit 7654321Bit 0
Read: R2SEQ TXACK TXNAK TXSTL RP2SIZ3 RP2SIZ2 RP2SIZ1 RP 2SIZ0
Write:
Reset:00000UUUU
= Unimplemented U = Unaffected
Figure 4-10. USB Status Register 1 (USR1)