EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
73
EZ-USB Development Kit Firmware Examples
// disable IBN for all endpoints
IBNIE = 0x00;
EZUSB_IRQ_CLEAR(); // clear the global USB IRQ
// Find the EP with its IBN bit set
for (i=0;i<8;i++)
{
if (IBNIRQ & (1 << i))
{
IbnFlag |= (1 << i); // set the appropriate IBN flag bit
IBNIRQ |= (1 << i); // clear the IBN IRQ for this endpoint
}
}
NAKIRQ |= bmBIT0; // clear the global IBN IRQ
// re-enable IBN interrupt for any endpoints that don't already have
// an IBN pending in IbnFlag
IBNIE = (bmEP6IBN | bmEP8IBN) & ~IbnFlag;
}
8.3.2
Building Firmware Example Code for EZ-USB RAM and EEPROM
Click on
Build
Target
at the top right corner of the IDE. The firmware example builds successfully
since the total code bytes of
IBN
firmware example is less than the 4-k code limit Keil µVision2 IDE
provided along with the kit. The output of the
Build
Target
is
ibn.hex
and
ibn.iic
files.
8.3.3
Method to Download Firmware Image to EZ-USB Internal RAM and External
EEPROM
Refer to the sections
Method to Download Firmware Image to EZ-USB Internal RAM Memory on
and
Method to Download Firmware Image to External I2C EEPROM on page 69
and follow
a similar procedure to download
ibn.hex
to either the RAM memory or
ibn.iic
to large EEPROM
using Cyconsole/CyControlCenter. After download, the firmware re-enumerates with the PC using its
internal VID/PID-0x04B4/0x1004.
8.3.4
Binding Cypress USB Driver for the Downloaded Firmware Image
The
IBN
project uses vendor-class (0xFF) with VID/PID-0x04B4/1004.This example should bind with
the Cypress generic USB driver, cyusb.sys, and the driver information file,
cyusbfx1_fx2lp.inf
, which
contains the relevant VID/PID of this example. Follow the procedure outlined in
USB Driver to EZ-USB Development Board on page 45
to manually bind the driver using the Win-
dows Hardware Wizard.
8.3.5
Testing the IBN Firmware Functionality
Following are the detailed steps to test the functionality
1. After the board enumerates, use CyConsole to send 512 bytes from EP2 to EP6. The data
received should be the same as the data sent. 512 bytes of user-defined data can be sent from
the host to Endpoint 2 using CyConsole. For example, select Endpoint 2 OUT in the pipe window
near the
Bulk
Trans
button of the
EZ-USB interface
window, enter the length as 512 and Hex-
Bytes 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 endpoints 4 and 8 can also be tested. Since EP2 and EP4 are double-buffered, they can
only contain two packets of data.
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...