Keil Logo


Information in this article applies to:

  • C51 Version 5.50a
  • C51 Version 6.00


I can't get my EZ-USB application to work when I program it into an external EPROM device. Weird problems occur that I can't figure out. What's wrong?


The Cypress EZ-USB development board provides you a way to easily get started with USB. However, because of the large number of different configuration options, you may have some difficulty getting your own applications and hardware to work.

Following are a few tips that may help:

  1. Include the STARTUP.A51 from the \c51\lib directory in your project. You may need to modify this file to initialize your XDATA.
  2. Modify the startup code to include the configuration for Ports A, B, and C. Since these ports control the RD and WR lines, if they are incorrectly configured, your external XDATA probably won't work. Since the startup code clears XDATA and the init code initializes your global variables (even the ones in XDATA), the RD and WR lines must be setup beforehand. Don't initialize these ports in your main C function.
  3. Reserve the space in XDATA that is used for the USB registers. Make sure that you don't accidentally place variables in this memory area. These XDATA registers are used by the EZ-USB chip for the USB buffers. You can reserve ALL of this space with the following code:
    unsigned char code USB_1 [0x4C0] _at_ 0x1B40;
    unsigned char code USB_2 [0x4C0] _at_ 0x7B40;

Last Reviewed: Saturday, July 9, 2005

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.