Many thanks for those who help me! (:
I got a problem here...
If i were to use 3 types of interrupts(external interrupt0, timer0 and timer1) in one single program, how should i go about writing the codes in the program?
Per, You are right, but frankly, most of the embedded code I have seen so far does not take into consideration that a signal might "get stuck". I have to admit - I don't always check that either. I do when there is functional reason to do so - a signal remaining high for too long may indicate that the machine is experiencing some mechanial failure, and then I indicate an error and stop everything to prevent somebody from being squashed...
most level triggered interrupts reset "the level" in the ISR. in such a case it is easy to check if the reset "worked" and take action if not.
The exception to the above is some derivatives requirement for a wake up interrupt, but similar detection can be done there.
THUS, even a level triggered interrupt can be detected stuck and disabled.
Erik
Erik,
you wrote
what is a wake interrupt in this context? what do you mean?
read any datasheet for modern derivative that can be woken up from sleep mode by e.g. int0. I recall none that will wake up fron an edge int, all I recall require a level int to wake up.
Ah, I understand what you meant.