I've been through Nick's posts about interrupts :
Gammon Forum : Electronics : Microprocessors : Interrupts, and of course I didn't get it all.
Is it possible (if Yes, how? - big picture -, if No, why ?) to use interrupts to listen continuously to a pin and then :
-
at the first rising edge : start a counter of the pulses, send an SMS to tell about the start of the pulse, the hour taken from a RTC module, and start a timer. (pulses frequency maybe 500 Hz, but i'm not sure).
-
at the end of the timer, send a sms to tell about the counter / time from RTC. then restart the timer. and wait again for the end of it.
-
at the end of the signal (eg no edges for a while, or the counter frozen on a single value) send a sms to tell of the end of the signal / time from RTC.
The issue I'm facing is the time it takes to send an SMS. Every thing else works without interrupts, and as soon as i bring in sms functions, the counting side doesn't work anymore, stopped by these long functions.
Maybe the issue comes from my lack of knowledge about asynchronous communications also.