You are here

Interruptions on PSOC5 | Cypress Semiconductor

Interruptions on PSOC5

Summary: 6 Replies, Latest post by odesus on 04 Oct 2011 06:12 PM PDT
Verified Answers: 2
Last post
Log in to post new comments.
user_18397477's picture
4 posts

Dear comunity:

I'm working with Psoc5 specifically interrupts in a single pin. When I define falling edge on input as interrupt event and I use ISR 1.50 with derived option, I realized interruption ISR_1 works on falling and rising edges. Is this normal or should work only on falling edge as I defined?

Thanks in advance.

David Ron's picture
23 posts



i tested a project with interrupt on "falling edge" on the pin and "derived" on interrupt.

As per my observation, the interrupt was obtained (LED Toggle) upon falling edge. Sometimes (like 1 in 10 times), i observed that the LED toggled upon rising edge. i strongly suspect that this may be due to switch debounce.

Make sure that the resistive pull up is enabled when using falling edge as interrupt source.

i have uploaded the project.



user_18397477's picture
4 posts

Dear David:

Thanks for your answer. Yes I have notice this, interruption serves on falling and rising edges. In fact to avoid this I have used a

code like this:





  main code of interruption




}// end of interrupt


Unfortunately interrupt  WORKS on both edges, so when you stop of pressing the button and goes high considering the code above the main code of interruption will never executed if button is not pressed. That I was wondering if this is a kind of error on API's or something like that. Lets see what a cypress engineer tell us about it. Thanks

dasg's picture
Cypress Employee
730 posts

Hi Odesus,


The PICU Interrupt can be set to Rising edge, Falling edge or on Both edge.


The project attached by David is configured for interrupt on Falling edge. The LED toggles on the Falling edge. Interrupt is not generated on the rising edge.

As mentioned by David, the Switch Debounce might result in the input pin going high > low > high instead of going high directly (The resistive pull up is enabled, hence the pin is pulled up by default).

This will inevitably result in the PICU interrupt getting triggered because of a high > low transition (falling edge).


In order to overcome the ambiguity introduced by the switch debounce, I tested the project by giving a square wave at the Pin input. The output pin was supposed to toggle on falling edge of the input signal.

The oscilloscope snap-shot is attached below:




Yellow waveform = Input signal to PICU

Blue waveform = Output pin toggle.


It can be seen that the output pin toggles only on the falling edge of the PICU input pin.


dasg's picture
Cypress Employee
730 posts

On similar grounds, the PICU was changed to Interrupt on "Rising Edge".

The snapshot below shows that output pin toggles on every rising edge of the input signal.


dasg's picture
Cypress Employee
730 posts

As a third case, when the PICU was configured for interrupt on "Both Edges", the output pin toggled on every edge of the input signal.

The oscilloscope snapshot is as shown below:


user_18397477's picture
4 posts

Many thanks for your answers!!

Yes, I have understood what is the matter with interruptions, specially using pushbuttons which can be very noisy. I've observed there are some registers which are related to interrupt flags like primask, xPSR,etc.

When I enter to my interruption I have notice despite use PIN_ClearInterrupt() function, the flag seems to be still activated so this interruption is served 2 times.

1.-Is there any way to read the status of this interrupt and clear the flag directly using ASM to remove this mask interrupt? 2.-Where is the address of this interrupt register to access directly? I mean to clear all possible interrupts associated to this pin.

On technical datasheets I have observed PIN_ClearInterupt() must clear all interrupts, but I don't know why in my case is not working.

Thanks in advance for all your comments.



Log in to post new comments.