Configuring external interrupt INT0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi, 

   

I am working on Cypress USB FX2LP controller (Cy7C68013A). I need to enable the external interrupt on INT0, as negative edge detecting. I had tried the following changes on bulkloop example on FX2LP. 

   

 

   

  PORTACFG = 0x03;            // PA0 and PA1 are INT0 and INT1

   

TCON |= 0x05;               // Detect INT0 and INT1 on fallinfg edge

   

IE  |= 0x05;    // Enable External Interrupts 0 and 1

   

After adding these lines in TD_Init() of the bulkloop example, the USB device was not getting enumerated by the EZ-USB Interface tool. 

   

Anyways, the enumeration works fine without these three lines of code in bulkloop example, and the device is detected as EZ-USB. 

   

What is wrong with the above code ? Is there anything more needed to be added to the enumeration to happen ? 

   

Thank You

   

With Regards

   

GIGIN JOSE

0 Likes
3 Replies
Anonymous
Not applicable

most probably the interrupt is constantly getting triggered and interfering the running of enumeration sequence. Are these interrupts constantly being triggered? What is the code in the ISR of these interrupts? Have you tried tying the pins to a logic level so that the interrupt doesn't get tried, if so do you still see the issue?
Regards,
Anand
 

0 Likes
Anonymous
Not applicable

 Hi Anand, 

   

 

   

There were no hardware issues on the interrupt firing, but the system worked fine once I added a seperate file "isr.c" with the interrupt handler "ISR_EXTR0". Is it necessary to add seperate file for interrupt handler. Earlier, I had added the interrupt service routine in slave.c file.

   

Thank You

   

With Regards

   

Gigin Jose 

0 Likes
Anonymous
Not applicable

Hi, 

   

 

   

Please see http://www.cypress.com/?id=4&rID=27870.

   

 

   

INT0# is an 8051 interrupt and #pragma NOIV affects only the file in which it is mentioned. So, 8051 interrupts have to be placed in a separate file, without having #pragma NOIV statement.

   

 

   

Regards,

   

Gayathri

0 Likes