Keil Logo

µVISION: Watching the IO-Ports of a Cypress USB Controller


Information in this article applies to:

  • C51 All Versions
  • µVision All Versions

QUESTION

I am using µVision for debugging a project with a Cypress USB device (EZ-USB, FX, FX2). However, the µVision peripheral dialogs contain only standard 8051 peripherals and do not show the memory-mapped I/O ports of the Cypress USB devices. 

Is there a way to display the I/O port values?

ANSWER

Yes, you may use Watch Window of µVision which opens with the menu command View -> Watch & Call Stack Window. Now enter the I/O variables. When you are using the Cypress header file (i.e. EZRegs.h), then you can enter the I/O variables as described in the Cypress documentation (for example OUTB or PINA).

You may also replace the I/O port definitions PORTxCFG, OUTx and PINSx in this register definition file. For example, in EZRegs.h just add a struct that contains all these registers, as shown below:

struct IOports  {
  unsigned char PORTACFG;
  unsigned char PORTBCFG;
  unsigned char PORTCCFG;
  unsigned char OUTA;
  unsigned char OUTB;
  unsigned char OUTC;
  unsigned char PINSA;
  unsigned char PINSB;
  unsigned char PINSC;
};

EXTERN volatile struct IOports xdata IOports _at_ 0x7F93;   // define Cypress I/O ports

Now, you can add this single struct to the µVision Watch Window which allows to review all port values while debugging.

MORE INFORMATION

  • µVision Getting Started User's Guide, Chapter 5. Testing Programs

Last Reviewed: Wednesday, January 20, 2021


Did this article provide the answer you needed?
 
Yes
No
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.