Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > how USB interrupt excute in keil c

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



how USB interrupt excute in keil c
Moderator:
RSKV

Post Reply
Follow this topic



how USB interrupt excute in keil c

mrjun posted on 11 Apr 2012 1:46 AM PST
Senior Member
17 Forum Posts

hello,

if I use INT1,the service function define interrupt number 2 then it can jump to 0x0013 and excutes the INT1 function;

but if I want EP4 give its buffer data to external RAM when its buffer has data,how can I configure it?  I have tired the code below(reference cy3681_ez_usb_fx2_development_kit_15), but how it jumps to EP4_ISR by keil. actually I think it should jump to 0x0003 and excutes INT0.

void ISR_Ep4inout(void) interrupt 0
{
 EZUSB_IRQ_CLEAR();  //EXIF.4=USBINT 0 clear

    EPIRQ = bmBIT5;   //
 EP4_RAM();

}

here is the code I reference:

void ISR_Ep1out(void) interrupt 0
{

 BYTE count;
 BYTE i;
 
 count = EP1OUTBC;
 if(!(EP1INCS & bmBIT1))
 {
  for (i=0;i<count; i++)
  {
   EP1INBUF[i]=EP1OUTBUF[i];
  }
  EP1INBC =count;
 }

 EZUSB_IRQ_CLEAR();
 EPIRQ = bmBIT3;
}
void ISR_Ep2inout(void) interrupt 0
{
   WORD count;
   WORD  i;

   if(!(EP2468STAT & bmEP6FULL))
   {  // check EP6 FULL(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is full
      APTR1H = MSB( &EP2FIFOBUF );
      APTR1L = LSB( &EP2FIFOBUF );
     
      AUTOPTRH2 = MSB( &EP6FIFOBUF );
      AUTOPTRL2 = LSB( &EP6FIFOBUF );
     
      count = (EP2BCH << 8) + EP2BCL;
     
      // loop EP2OUT buffer data to EP6IN
      for( i = 0x0000; i < count; i++ )
      {
         // setup to transfer EP2OUT buffer to EP6IN buffer using AUTOPOINTER(s)
         EXTAUTODAT2 = EXTAUTODAT1;
      }
      EP6BCH = EP2BCH; 
      SYNCDELAY; 
      EP6BCL = EP2BCL;        // arm EP6IN
      SYNCDELAY;                   
   }

 EZUSB_IRQ_CLEAR();
 EPIRQ = bmBIT4;
}
 




Re: how USB interrupt excute in keil c

PRJI posted on 12 Apr 2012 11:38 PM PST
Cypress Employee
333 Forum Posts

 Hi


 Go through http://www.cypress.com/?id=4&rID=26700 , http://www.cypress.com/?docID=27502 and http://www.cypress.com/?id=4&rID=26812


Thanks


Prajith



Re: how USB interrupt excute in keil c

mrjun posted on 12 Apr 2012 07:01 PM PST
Senior Member
17 Forum Posts

hi, Prajith

thanks for your help, I get it

best wishes

mrjun

 



Re: how USB interrupt excute in keil c

mrjun posted on 13 Apr 2012 01:45 AM PST
Senior Member
17 Forum Posts

hi,

add a confused question:

if I use EP4 interrupt, should I configure it INT mode in file dscr.a51? HighSpeedConfigDscr--Endpoint Descriptor alone or should with FullSpeedConfigDscr?

if i should configure in dscr.a51, how  I set the Interface Descriptor's Alternate Setting Value?

I can't download the file in http://www.cypress.com/?id=4&rID=32508, because the link does not work;

but the EZ-USB® Technical Reference Manual (Rev. *D,p375,Appendix B) doesn't afford the situation I used below:

EP1OUT  default;--- not used

EP1IN   default;--not used

EP2 default;-- not used

EP4 OUT INT

EP6 Slave FIFO bulk

EP8 IN BULK

 



Re: how USB interrupt excute in keil c

mrjun posted on 13 Apr 2012 01:45 AM PST
Senior Member
17 Forum Posts

hi,

add a confused question:

if I use EP4 interrupt, should I configure it INT mode in file dscr.a51? HighSpeedConfigDscr--Endpoint Descriptor alone or should with FullSpeedConfigDscr?

if i should configure in dscr.a51, how  I set the Interface Descriptor's Alternate Setting Value?

I can't download the file in http://www.cypress.com/?id=4&rID=32508, because the link does not work;

but the EZ-USB® Technical Reference Manual (Rev. *D,p375,Appendix B) doesn't afford the situation I used below:

EP1OUT  default;--- not used

EP1IN   default;--not used

EP2 default;-- not used

EP4 OUT INT

EP6 Slave FIFO bulk

EP8 IN BULK

 



Re: how USB interrupt excute in keil c

PRJI posted on 16 Apr 2012 03:08 AM PST
Cypress Employee
333 Forum Posts

 No, You can configure it as Bulk.

Thanks

Prajith



Re: how USB interrupt excute in keil c

mrjun posted on 17 Apr 2012 06:15 PM PST
Senior Member
17 Forum Posts

hi,Prajith

Did you mean that  the setting value in Interface Descriptor and XFR type in Endpoint Descriptor in dscr.a51 do none bussiness for EPs' control? just a description?that means the setting I can not follow the descriptors in Appendix B and ignore it?

thanks

mrjun

 



Re: how USB interrupt excute in keil c

PRJI posted on 18 Apr 2012 02:35 AM PST
Cypress Employee
333 Forum Posts

 Hi,


 For using Endpoint interrupts(ISR) you are not supposed to configure Endpoints as Interrupt endpoints, configure it as Bulk endpoint (Configure EP4 as Bulk). You can use associate project available with  http://www.cypress.com/?docID=27502 as reference.


Thanks


Prajith






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20