-
1. Re: A problem with ISRs
user_78878863 Oct 15, 2014 5:11 PM (in response to mahmoud.athab)What do you mean with "goes to the next ISR"? Is the same ISR called again?
How did you find about this? With the debugger? The reason might be that the interrupt trigger is level-based and not edge-based. Then it will be active as long as the button is pressed (and be executed when the interrupt-flag is cleared inside of the ISR)
-
2. Re: A problem with ISRs
mahmoud.athab Oct 15, 2014 5:58 PM (in response to mahmoud.athab)Yes I found that problem using the debugger, and what I mean by "goes to the next ISR" is that it finishes whatever I programmed the ISR to do and moves to perform the next ISR although it was not triggered. for example, when I press button 2 (tone C) the C ISR is performed. as soon as it is finished it moves directly to perform the D ISR without the intterupt being triggered, and then moves to the E ISR and so on until it returns to the C ISR and creates a loop.
all the intteurpts are rising edge based.
-
3. Re: A problem with ISRs
mahmoud.athab Oct 15, 2014 7:30 PM (in response to mahmoud.athab)No need, I found the problem, it was with the switch connections.
-
4. Re: A problem with ISRs
user_78878863 Oct 16, 2014 3:37 AM (in response to mahmoud.athab)That sounds interesting. How does a faulty switch wiring cause triggering one ISR after another?
-
5. Re: A problem with ISRs
user_14586677 Oct 16, 2014 6:19 AM (in response to mahmoud.athab)GPIO Interrupts covered here (explanation of port wide behaviour) -
http://www.cypress.com/?rID=57571
Regards, Dana.
-
6. Re: A problem with ISRs
mahmoud.athab Oct 16, 2014 3:18 PM (in response to mahmoud.athab)@hli, no idea. I connected 5 switches with a pull down resistor, but only the first switch worked as it should. I removed the pull down connections and it worked like a charm. it still is a very strange problem.
@Dana, the answer might be in your document, I'll make sure to read it.
-
7. Re: A problem with ISRs
mahmoud.athab Oct 16, 2014 3:49 PM (in response to mahmoud.athab)In the document provieded by Dana, on page 16 it mentions 2 ports configured as a rising edge and falling edge interrupts.
3. Configure P6[0] as a resistive pull-down pin, or add
an external pull-down.
4. Configure P6[1] as a resistive pull-up pin, or add an
external pull-up.
it says "or add", but what if we do both. because I configured my ports as resistive pull down and added an external pull down at the same time. could that be what caused the problem? -
8. Re: A problem with ISRs
user_14586677 Oct 16, 2014 6:06 PM (in response to mahmoud.athab)If you double up on PU's or PD's for sure you will burn more
power when switch closed.
Rare but if SW had high R when closed you might not meet noise margin,
eg. reflect a switch closure.
Just use internal, simpler.
Regards, Dana.
-
9. Re: A problem with ISRs
mahmoud.athab Oct 18, 2014 1:37 AM (in response to mahmoud.athab)Well, trust me Dana when I tell you that the lesson is well learned and won't be forgotten. Thank u.
-
10. Re: A problem with ISRs
user_14586677 Oct 18, 2014 1:50 PM (in response to mahmoud.athab)Glad the forum was able to help.
Regards, Dana.