Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Interrupt problem (beginner)

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



Interrupt problem (beginner)
Moderator:
ANCY

Post Reply
Follow this topic



Interrupt problem (beginner)

Paja posted on 02 Feb 2012 8:45 AM PST
Member
4 Forum Posts

I am beginner with PSoC 5 and I started with a simple project.

I want to toggle a diode (Pin_2 on the schematics) with a push-button (Pin_1 on the schematics). In order to do that I am using GlitchFilter to debounce the push button.

Everything works just fine when I step through the program with a debugger, but as soon as I run the program, it stops working. It enters the interrupt just once and then stops working. It looks like interrupt routine do not respond. And there is no difference if interrupt is triggered as "rising edge" or "derived", it does the some thing.

I hope that some of you can see what the problem is.

Here are design, and code for main.c and isr_1.c (interrupt routine).

Thanx in advance.




Re: Interrupt problem (beginner)

Bob Marlowe posted on 02 Feb 2012 09:20 AM PST
Top Contributor
1768 Forum Posts

There is a function named ISR_Clearpending(). Have a look at the API and try, this may hewlp you.

 

Happy interrupts

Bob



Re: Interrupt problem (beginner)

Paja posted on 02 Feb 2012 09:29 AM PST
Member
4 Forum Posts

Thanx for a fast reply.

I'll definitely try it.



Re: Interrupt problem (beginner)

Gautam Das posted on 03 Feb 2012 10:40 PM PST
Cypress Employee
742 Forum Posts

Hi Paja,

 

Which kit are you using to test this project?

If you are using CY8CKIT-001 or CY8CKIT-050, then the switch available on board (SW1 and SW2) are push-to-ground.

Hence, configure the input pin's Drive Mode as Resistive Pull Up.

 

 

If you are using CY8CKIT-014, the switch is configured as push-to-Vcc. Hence, the drive mode for the pin should be set as Resistive Pull down.

If configured this way, the pins will not be floating.

Secondly, the header file of the pin you are intending to toggle should be included in the isr. Use the macro

#include "Pin_2.h" in the isr_1.c file



Re: Interrupt problem (beginner)

Gautam Das posted on 03 Feb 2012 10:50 PM PST
Cypress Employee
742 Forum Posts

I created a project similar to the one you have stated and tested it on PSoC5 using CY8CKIT-001.

The output LED toggled upon every switch press (SW1).

 

The working project is attached for your reference.



Re: Interrupt problem (beginner)

Paja posted on 04 Feb 2012 04:23 AM PST
Member
4 Forum Posts

 Hi dasq.

Thank you very much for help. The kit I use have a push button connected to +Vcc (I can see it in a data sheet).

I will try your project today.

Thanks once again.



Re: Interrupt problem (beginner)

Gautam Das posted on 04 Feb 2012 04:40 AM PST
Cypress Employee
742 Forum Posts

Hi Paja,

 

Then just modify the drive mode of the input pin in the project to Resistive Pull Down.

Tha should get the project working.

All the best !



Re: Interrupt problem (beginner)

Paja posted on 04 Feb 2012 05:36 AM PST
Member
4 Forum Posts

Hi dasq.

It works.

Thank you very much.






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