How can I know what type of interrupts happend?

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

cross mob
Anonymous
Not applicable

In my application,I set one IO pin both edges interrupt. in interrupt service function, how can I know whether the interrupt is raising interrupt or falling interrupt?

   

Or can I connect my signal to two pins, one for raising detection, the other for falling detection?

0 Likes
1 Reply
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

In the ISR you can check the current state of the pin, which gives you the type of the edge (provided its not a fast signal).

   

You could also detect your signal to two IO-pins, and then have two ISRs. Or you connect it to one pins, and add two edge detector components (http://www.cypress.com/documentation/component-datasheets/edge-detector ) to this pin.

0 Likes