C51: EZ-USB STARTUP CODE
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:
Include the STARTUP.A51 from the \c51\lib directory in your
project. You may need to modify this file to initialize your
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.
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
unsigned char code USB_1 [0x4C0] _at_ 0x1B40;
unsigned char code USB_2 [0x4C0] _at_ 0x7B40;
Last Reviewed: Saturday, July 9, 2005