Cypress Notes

Cypress Notes

Notes related to Cypress Semiconductor parts.

These notes relate to the Cypress Semiconductor C USB Development kit. Byte Craft Limited supplies the compiler for this tool. For more information, see “Cypress C”.

FAQ

. Issues
.1. Using the keyboard.c example, the keyboard LEDs never light up. What's wrong?
. Debugging
.1. I'm having trouble with CYDB in the Cypress C USB Development Kit. I can run my code, but I can't trace through the listing file. What's wrong?

Issues

.1. Using the keyboard.c example, the keyboard LEDs never light up. What's wrong?
.1.

Using the keyboard.c example, the keyboard LEDs never light up. What's wrong?

Thanks to a bug report from a Cypress C user, we know of an edge case where this behaviour occurs. If you're using a USB 2.0-enabled machine, with a high speed hub, add the following line to keyboard.c:

         /* Check toggle bit */         if( !(EP_A0_COUNTER&DATATOGGLE) )              goto USB_control_write;

Add this statement to line 1108 of keyboard.c, following a similar test of the DATAVALID bit.

Debugging

.1. I'm having trouble with CYDB in the Cypress C USB Development Kit. I can run my code, but I can't trace through the listing file. What's wrong?
.1.

I'm having trouble with CYDB in the Cypress C USB Development Kit. I can run my code, but I can't trace through the listing file. What's wrong?

Add the following line to the top of your source file and recompile:

#pragma option INSTRUCTIONTIMING;

CYDB needs this information (the length in cycles of each instruction) to be present in the listing file.

Some Cypress C distributions ship with a reference design for a Combination Interface Mouse. The files in question are not Byte Craft Limited files. We have identified some problems with the files as shipped, and offer the following information:

Problems with the reference design distribution:

  • When the reference design files are extracted, they are read-only. They must be changed to read/write files, using attrib at the command line or the Windows Explorer (select all the files, then right-click and choose Properties).

  • The Byte Craft project file (.BCP) contains a working directory in E: and will not likely work.

  • The reference design application was originally built with Cypress C 1.10, and will only compile cleanly using this version.

To fix these problems:

  1. Obtain Cypress C 1.10 from Byte Craft Limited by emailing support@bytecraft.com

  2. If you have Cypress C currently installed, check the shortcuts under Start|Programs|Byte Craft. If the shortcuts are named Cypress C and Cypress C Tutorial, Cypress C 1.10 installation will overwrite them.

    Rename these shortcuts to include a Cypress C version number. The way to do this depends upon your version of Windows: consult your Windows documentation for more details.

  3. Extract all files from the CyC110.zip archive that you receive to a temporary directory, ensuring that the ZIP file folders are preserved during the extraction.

  4. Run setup.exe from temp\Install (where temp is the path to the temporary directory chosen in the last step.

  5. Follow the instructions given in the setup program, except for the installation folder. Change this to

    X:\Program Files\Byte Craft\CyC110\

    where X is replaced by the drive you wish to install the program on. This ensures you do not overwrite your current Cypress C installation.

  6. Start the Byte Craft IDE

  7. Create a new project and set up the items as seen below:


    New project General properties. Note the Library path.


    New project Compiler properties. This uses the Cypress C V1.10 compiler.

  8. Open the file combi.c and compile it.


    Compiling combi.c