# GPIO Interrupts

**URL:** <https://forum.sierrawireless.com/t/gpio-interrupts/4897>\
**Category:** Open AT\
**Created:** [February 15, 2011, 10:38am UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897 "2011-02-15T10:38:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenFT01](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@BenFT01](https://forum.sierrawireless.com/u/BenFT01)\
**Post date:** [February 15, 2011, 10:38am UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/1 "2011-02-15T10:38:55Z")

</div>

Hi Folks,  
I’m looking at the possibility of using a GPIO input to detect regular pulses. Polling would take too much resources, so I want to use interrupts.  
AT+WIPC to set the pin up as an interrupt.  
adl\_ioEventSubscribe to wait on GPIO triggered events.  
The ADL interface for this (adl\_ioxxxxx), talks about Events being created, it also takes about polling speed - PollingTimerType. Does it just poll in the firmware? It says you can miss the parameter out, is it a straight interrupt then? I guess you can use polling if the pin does not have interrupt capability.  
If this is the case are the chances of using this to detect pulses highly unlikely? I anticipate the GSM tasks will take priority most of the time so there would be frequent lost pulses, whether its polling or interrupting.  
Can any users out there share some experience on this?

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [February 15, 2011, 12:29pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/2 "2011-02-15T12:29:54Z")

</div>

What frequency are your regular pulses?

Have a look at the TCU service in the ADL user guide for another option.

---

<div class="post-metadata">

**Author:** ![BenFT01](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@BenFT01](https://forum.sierrawireless.com/u/BenFT01)\
**Post date:** [February 15, 2011, 2:13pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/3 "2011-02-15T14:13:57Z")

</div>

Ideally up to 20 a second, but I doubt its possible.  
Will check out the TCU interface. THanks.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [February 15, 2011, 2:36pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/4 "2011-02-15T14:36:36Z")

</div>

Look at the “IRQ Measure” and “Signal Replica” examples…

---

<div class="post-metadata">

**Author:** ![BenFT01](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@BenFT01](https://forum.sierrawireless.com/u/BenFT01)\
**Post date:** [February 15, 2011, 2:54pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/5 "2011-02-15T14:54:33Z")

</div>

Thanks awneil

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [February 15, 2011, 3:17pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/6 "2011-02-15T15:17:24Z")

</div>

> [@BenFT01](#):
>
> Ideally up to 20 a second, but I doubt its possible.  
> Will check out the TCU interface. THanks.

20Hz shouldn’t be too much of a problem (50ms per pulse). I believe the polling runs on the 18.5ms tick (might be wrong), so you’d be sampling at more than double your input frequency. TCU can easily handle that rate.

---

<div class="post-metadata">

**Author:** ![BenFT01](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@BenFT01](https://forum.sierrawireless.com/u/BenFT01)\
**Post date:** [February 15, 2011, 4:10pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/7 "2011-02-15T16:10:40Z")

</div>

Thanks Tom. Pleased to hear that. I’ll have a look at the examples and give it a test.

---

<div class="post-metadata">

**Author:** ![BenFT01](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@BenFT01](https://forum.sierrawireless.com/u/BenFT01)\
**Post date:** [February 25, 2011, 4:26pm UTC](https://forum.sierrawireless.com/t/gpio-interrupts/4897/8 "2011-02-25T16:26:13Z")

</div>

OK, I’m using the irq\_measure example code bits and it seems to be working. 🙂

Is there a way to tell if my interrupts overrun, i.e. if another interrupt comes in before I have been able to process the first?
