EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
77
EZ-USB Development Kit Firmware Examples
near
Bulk
Trans
button of
EZ-USB interface
window, enter the length as 512 and HexBytes as
5, and then press the
Bulk
Trans
button.
2. This data can be read back from Endpoint 6 using CyConsole. For example, select Endpoint 6 IN
in the pipe, enter the length as 512, and then press the Bulk Trans button. Similarly, loopback
using endpoint 4 and 8 can also be tested. Because EP2 and EP4 are double-buffered, they can
contain only two packets of data. After sending a packet to these endpoints when both the buffers
are full, the endpoints NAK the transfer because there is no space available. This asserts the
PING-NAK interrupt of the NAKing endpoint.
3. The ISRs that handle the PING-NAK interrupt. (ISR_Ep2pingnak and ISR_Ep4pingnak) discards
the previous data that is stored in one of the endpoint buffers by rearming the endpoint. There-
fore, the endpoints can receive the data that is currently sent by the host because there is space
in one of its buffers.
4. The above can be tested by continuously sending data to EP2 and EP4 without reading the data
out of EP6 or EP8. Because the PING-NAK ISR rearms the endpoints, you can continuously
transmit data to EP2 and EP4 and the transfer always succeeds. The data present in the buffers
of EP2 and EP4 at any point of time will be the latest two packets of data sent from the host.
Note:
For EZ-USB FX1 the above steps can be repeated with data transfer length of 64 bytes
instead of 512 bytes.
8.5
Bulkloop Example
8.5.1
Description
This project illustrates the configuration of FX2LP to accept bulk data from the host and loop it back
to the host. Click on
bulkloop.Uv2
at
<Installed_directory>\<Version>\Firm-
ware\Bulkloop
and observe the source code. Four endpoints are configured in the
TD_init()
func-
tion of
bulkloop.c
to handle bulk transfer: two OUT endpoints and two IN endpoints. The four
endpoints defined in the descriptor file have to be configured in this function. This is done by the fol-
lowing statements
EP2CFG = 0xA2;
SYNCDELAY;
EP4CFG = 0xA0;
SYNCDELAY;
EP6CFG = 0xE2;
SYNCDELAY;
EP8CFG = 0xE0
The key characteristics of each endpoint are as follows:
■
Endpoint 2 - OUT, Bulk, double-buffered
■
Endpoint 4 - OUT, Bulk, double-buffered
■
Endpoint 6 - IN, Bulk, double-buffered
■
Endpoint 8 - IN, Bulk, double-buffered
After configuration, the OUT endpoints are 'armed' to accept data from the host. An OUT endpoint is
said to be armed if it is ready to accept data from the host. Each endpoint is configured as double-
buffered.
SYNCDELAY;
EP2BCL = 0x80;// arm EP2OUT by writing byte count
w/skip.
SYNCDELAY;
EP2BCL = 0x80;
SYNCDELAY;
Summary of Contents for CY3674
Page 18: ...18 EZ USB Development Kit User Guide Doc 001 66390 Rev D Getting Started...
Page 34: ...34 EZ USB Development Kit User Guide Doc 001 66390 Rev D Development Kit Contents...
Page 54: ...54 EZ USB Development Kit User Guide Doc 001 66390 Rev D Cypress USB Drivers for EZ USB Kits...
Page 110: ...110 EZ USB Development Kit User Guide Doc 001 66390 Rev D Resources...
Page 113: ...EZ USB Development Kit User Guide Doc 001 66390 Rev D 113 A 2 Board Layout...