ARM Technical Support Knowledge Articles


Applies to: C51 C Compiler


Information in this article applies to:


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 c51lib 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;

Article last edited on: 2005-07-09 11:08:12

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential