# External Triggered Measurements using the GPIO port

**URL:** <https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266>\
**Category:** LimeSDR\
**Created:** [19 January 2018 22:41 UTC](https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266 "2018-01-19T22:41:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/lucas/32/1246_2.png) [@Lucas](https://discourse.myriadrf.org/u/Lucas)\
**Post date:** [19 January 2018 22:41 UTC](https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266/1 "2018-01-19T22:41:11Z")

</div>

Hello! Have anyone tried this? I’m trying to do some triggered measurements (like an oscilloscope) with the LimeSDR.  
Using the gpio examples in C++ in LimeSuite and wrote an extremely simple code:

```
Using GPIO0 in input mode:
// Device setting etc..

```

`while(!(gpio_val&1)) { if (LMS_GPIORead(device, &gpio_val, 1)!=0) error(); } std::cout << "Triggered!" << std::endl;}`

`// Read samples and DSP....`

The trigger signal is a square pulse of amplitude 3.3V and has a duration of 10 uS.  
The system works…sometimes. I can make some triggered measurements but two or more trigger pulses with a time span \< 1s must be sended to the LimeSDR. And I don’t know if this can be improved.

I know the code is very simple and maybe there’s a better aproach to resolve this. But the fact that many pulses must be sended to the GPIO0 port makes me think that there is a hardware issue. Maybe an impedance mismatch between the trigger source and the GPIO impedance? Pulse Duration? Parameters in the FPGA to be controlled?

Thanks in advance.  
Lucas.

---

<div class="post-metadata">

**Author:** ![Lucas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/lucas/32/1246_2.png) [@Lucas](https://discourse.myriadrf.org/u/Lucas)\
**Post date:** [23 January 2018 19:04 UTC](https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266/2 "2018-01-23T19:04:43Z")

</div>

Anyone? =(  
@Zack, @IgnasJ, @andrewback, @ricardas

---

<div class="post-metadata">

**Author:** ![IgnasJ](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@IgnasJ](https://discourse.myriadrf.org/u/IgnasJ)\
**Post date:** [24 January 2018 07:16 UTC](https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266/3 "2018-01-24T07:16:19Z")

</div>

LMS\_GPIORead() reads the current state of the GPIO pins. It takes time to send command to board and get a response and if pulse occurs between reads it won’t be detected.

---

<div class="post-metadata">

**Author:** ![Lucas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/lucas/32/1246_2.png) [@Lucas](https://discourse.myriadrf.org/u/Lucas)\
**Post date:** [24 January 2018 17:32 UTC](https://discourse.myriadrf.org/t/external-triggered-measurements-using-the-gpio-port/2266/4 "2018-01-24T17:32:14Z")

</div>

Thanks @IgnasJ for the answer!
