Using the untested EZ-USB code in CY4601 USB to Serial Reference Design with Windows XP host | Cypress Semiconductor
Support & Community
Using the untested EZ-USB code in CY4601 USB to Serial Reference Design with Windows XP host
Windows XP does not receive data using the example EZ-USB code in the CY4601 USB to Serial Reference Design. Why does this problem occur?
The EZ-USB example code supplied with the CY4601 USB to Serial reference design is not officially part of the design. The EZ-USB firmware is provided as an example and has not been fully tested. It is assumed that the developer will start develpoment of their firmware with this code.
The problem seen in Windows XP while receiving data in through USB to the Virtual COM port arises because Windows XP requires that the USB to Serial design's Input Reports are always the maximum length specified in the descriptors, in this case 64 bytes. However, the example code that is shipped with the design sends input reports that are just large enough to contain the RS-232 data (plus a little extra). This usually is less then the maximum length of 64. To fix this, the following code snippet should be changed in the usb2ser.c file:
if (sendToUSB) // if we have something to send...
IN1BUF = bitTemp;
IN1BUF = Ep1Index - 2;
IN1BC = 64; //In the original file this line was: IN1BC=Ep1Index;
Note, this issue only appears to cause a problem in WinXP. Sending an input report that is less then the maximum size does not appear to cause any problems in Win2K.