User guide

80 CY3687 MoBL-USB FX2LP18 Development Kit User Guide, Doc. # 001-68582 Rev. *B
MoBL-USB Development Kit Firmware Examples
Figure 8-9. Bulk IN Data Transfer on EP6 Endpoint
Select EP4 and EP8 pairs and repeat the same procedure as mentioned above. Observe that the
data transferred on EP4 is exactly looped back to EP8.Internally the loopback is performed via a
temporary buffer (myBuffer [512]).
8.7 Bulkext Firwmare Example
8.7.1 Description
This example is exactly similar to Bulkloop example. Click on Bulkext.uv2 project located at
<Installed_directory>\<Version>\Firmware\Bulkext and open bulkext.c in Keil IDE Project window.
The only difference between Bulkloop and Bulkext example is the source and destination buffer
memory address of Bulk endpoint pairs -EP2/EP6 and EP4/EP8. In Bulkloop the endpoint FIFO are
directly used as source and destination buffers. These are internal RAM buffers residing in MoBL-
USB FX2LP18 device. In TD_poll() function the endpoint EP2 data buffer destination is defined as
external RAM memory address-0x2800 which is inturn defined as source buffer to EP6 IN endpoint
and the data is copied through AUTOPTR mechanism as shown in the following code.
if(!(EP2468STAT & bmEP2EMPTY))
{ // check EP2 EMPTY(busy) bit in EP2468STAT (SFR), core set's this bit
when FIFO is empty
if(!(EP2468STAT & bmEP6FULL))
{ // check EP6 FULL(busy) bit in EP2468STAT (SFR), core set's this
bit when FIFO is full
// Source is EP2OUT
APTR1H = MSB( &EP2FIFOBUF );
APTR1L = LSB( &EP2FIFOBUF );
// Destination is external RAM (at 0x2800)
AUTOPTRH2 = 0x28;
AUTOPTRL2 = 0x00;
count = (EP2BCH << 8) + EP2BCL;