This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CY768013A - Interrupt coding problem

Hi frnds,

I am working on Cypress EZ-USB CY768013A while analyzing the code i found many interrupts with same interrupt number as " interrupt 0 " , though this EZ Cypress usb chip has AUTOVECTOR facility, I would like to know how all these interrupt functions are executed with same Interrupt number in EZ CYPRESS USB chip ???


void ISR_Sudav(void) interrupt 0
{
   printf("Data\n");
   GotSUD = TRUE;            // Set flag
   EZUSB_IRQ_CLEAR();
   USBIRQ = bmSUDAV;         // Clear SUDAV IRQ
}

// Setup Token Interrupt Handler
void ISR_Sutok(void) interrupt 0
{
   printf("Token\n");
   EZUSB_IRQ_CLEAR();
   USBIRQ = bmSUTOK;         // Clear SUTOK IRQ
}

void ISR_Sof(void) interrupt 0
{
   printf("SOF\n");
   EZUSB_IRQ_CLEAR();
   USBIRQ = bmSOF;            // Clear SOF IRQ
}

void ISR_Ures(void) interrupt 0
{
        printf("Ureq\n");
   if (EZUSB_HIGHSPEED())
   {
          pConfigDscr = pHighSpeedConfigDscr;
      pOtherConfigDscr = pFullSpeedConfigDscr;
   }
   else
   {
      pConfigDscr = pFullSpeedConfigDscr;
      pOtherConfigDscr = pHighSpeedConfigDscr;
   }

   EZUSB_IRQ_CLEAR();
   USBIRQ = bmURES;         // Clear URES IRQ
}

void ISR_Susp(void) interrupt 0
{
   printf("Sup");
   Sleep = TRUE;
   EZUSB_IRQ_CLEAR();
   USBIRQ = bmSUSP;
}

Parents
  • its definately not interrupt 0. The irq address is 0x0043 if i recall correctly.
    Of course you have to enable autovectoring in your code. You may check the jumptable.a51 and the documentation from Cypress to find out how that will work.
    Cypress as plenty of examples and a very good
    technical reference manual.

    Thomas

Reply
  • its definately not interrupt 0. The irq address is 0x0043 if i recall correctly.
    Of course you have to enable autovectoring in your code. You may check the jumptable.a51 and the documentation from Cypress to find out how that will work.
    Cypress as plenty of examples and a very good
    technical reference manual.

    Thomas

Children
  • Hi Thomas,

    Thanks for u valuable suggestions, but what I am using is a sample code from cypress , where they have disabled AutoVector of interrupts, with

    #pragma NOIV

    how to enable this?? is it,

    #pragma IV ???

    This is the link to NON AUTOVECTOR

    http://www.keil.com/support/man/docs/c51/c51_nointvector.htm

    you have also mentioned jumptable.a51, but i dont find such file anywhere, but i have got dscr.a51 file which only defines USB paramaters in assembly.

    Please tell me how to enable vector table and how to to run this code..

    Rajesh

  • Hi Thomas,

    please tell me, which interrupt number i have to mention after my interrupt function code??

    ex:

    void ISR_DATAREV(void ) interrupt ?

    Rajesh

  • "they have disabled AutoVector of interrupts, with
    #pragma NOIV"

    No: that has nothing to do with Auto-Vectoring!

    That is a standard Keil feature that controls vector generation for any 8051 processor.

    Quite possibly, they need to use that to disable Keil's standard vector generation so that their own proprietary Auto-Vector generation can work.

    This will be specific to the Cypress chips, so you need to study the Cypress documentation about this!

  • well if your code uses NOIV the interruptno will not be used so any no will do it. This only means that keil does not generate any interupt entery code.
    The usb interupt is then handled by jumptable.a51. (i am not sure of the name) just search in the library. Usually thats part of ezusb.lib but you can include it to your own projects too.
    I can not tell you the righ way for you because i never did use that lib but use my own way.
    Anyway the docs will tell you the right way Andi is right.
    BTW:
    you know that ezusb.lib has to be compiled for your chip?

    Thomas