![Texas Instruments CC2533 Скачать руководство пользователя страница 196](http://html.mh-extra.com/html/texas-instruments/cc2533/cc2533_user-manual_1094592196.webp)
IN FIFO
OUT FIFO
USBMAXI-1
0
b) Double Buffering
a) Single Buffering
USBMAXO-1
0
0
0
0
0
USBMAXI -1
USBMAXO-1
USBMAXI-1
USBMAXO-1
IN FIFO
(Buffer 1)
IN FIFO
(Buffer 2)
OUT FIFO
(Buffer 2)
OUT FIFO
(Buffer 1)
M0106-02
Endpoints 1
–
5
When the IN or OUT endpoint of an endpoint number uses double buffering, the sum of
USBMAXI
and
USBMAXO
must not exceed half the FIFO size for the endpoint.
b) illustrates the IN and OUT
FIFO memory for an endpoint that uses double buffering. Notice that the second OUT buffer starts from
the middle of the memory region and grows upwards. The second IN buffer also starts from the middle of
the memory region but grows downwards.
To configure an endpoint as IN-only, set
USBMAXO
to 0, and to configure an endpoint as OUT-only, set
USBMAXI
to 0.
For unused endpoints, both
USBMAXO
and
USBMAXI
should be set to 0.
Table 21-2. FIFO Sizes for EP 1
–
5
EP Number
FIFO Size (in Bytes)
1
32
2
64
3
128
4
256
5
512
Figure 21-2. IN/OUT FIFOs
21.7.2 Double Buffering
To enable faster transfer and reduce the need for retransmissions, double buffering can be used. This
allows two packets to be buffered in the FIFO in each direction. This is highly recommended for
isochronous endpoints, which are expected to transfer one data packet every USB frame without any
retransmission. For an isochronous endpoint, one data packet is sent/received every USB frame.
However, the data packet may be sent/received at any time during the USB frame period, and there is a
chance that two data packets may be sent/received at a few-microseconds interval. For isochronous
endpoints, an incoming packet is lost if there is no buffer available, and a zero-length data packet is sent if
there is no data packet ready for transmission when the USB host requests data. Double buffering is not
as critical for bulk and interrupt endpoints as it is for isochronous endpoints, because packets are not lost.
Double buffering, however, may improve the effective data rate for bulk endpoints.
To enable double buffering for an IN endpoint,
USBCSIH.IN_DBL_BUF
must be set to 1. To enable
double buffering for an OUT endpoint, set
USBCSOH.OUT_DBL_BUF
to 1.
196
USB Controller
SWRU191C
–
April 2009
–
Revised January 2012
Copyright
©
2009
–
2012, Texas Instruments Incorporated