# LimeMini 2.2 GPIO

**URL:** <https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012>\
**Category:** LimeSDR\
**Created:** [3 August 2023 12:50 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012 "2023-08-03T12:50:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![oe1rsa](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/oe1rsa/32/4714_2.png) [@oe1rsa](https://discourse.myriadrf.org/u/oe1rsa)\
**Post date:** [3 August 2023 12:50 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/1 "2023-08-03T12:50:50Z")

</div>

I have written a small testing app to control the GPIO Pins of the Lime Mini. This works as advertised for the Lime Mini 1.0, but the Lime 2 seems to be different. I have not yet soldered the GPIO header on the Lime Mini 2, but from looking at the schematics I can see that there are already LEDs connected to the various GPIO pins. However none of the LEDs can be lit by poking into the registers, as is working for the Lime 1.

What do I miss here? In particular I am interested in the interworking of GPIO with the TX/RX Led for using it as a PTT switch for an external PA.

Any hints appreciated!

---

<div class="post-metadata">

**Author:** ![andrewback](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@andrewback](https://discourse.myriadrf.org/u/andrewback)\
**Post date:** [3 August 2023 18:13 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/2 "2023-08-03T18:13:37Z")

</div>

See:

[https://limesdr-mini.myriadrf.org/documentation/board-description#gpio-connectors](https://limesdr-mini.myriadrf.org/documentation/board-description#gpio-connectors)

---

<div class="post-metadata">

**Author:** ![oe1rsa](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/oe1rsa/32/4714_2.png) [@oe1rsa](https://discourse.myriadrf.org/u/oe1rsa)\
**Post date:** [3 August 2023 19:01 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/3 "2023-08-03T19:01:02Z")

</div>

Ok, thank you. I already knew this page. However what I do not understand: If I set GPIO7 to a high value, why will the red LED not light up? Do I need to do something special to either have the GPIO connected to the RX/TX or beeing able to “manually” control the pins? Why will opening the solder bridge change things? Is this something the start up code is managing?  
I also tried to light the LEDs by using LimeSuiteGUI with bord controls, But no I was not able to turn the LEDs on or off although in the schematics I can see they are wirded to the GPIOs,

---

<div class="post-metadata">

**Author:** ![andrewback](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@andrewback](https://discourse.myriadrf.org/u/andrewback)\
**Post date:** [4 August 2023 12:48 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/4 "2023-08-04T12:48:34Z")

</div>

Possibly, but my memory is vague and @Zack could clarify.

---

<div class="post-metadata">

**Author:** ![VytautasB](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@VytautasB](https://discourse.myriadrf.org/u/VytautasB)\
**Post date:** [4 August 2023 13:59 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/5 "2023-08-04T13:59:53Z")

</div>

If you want to use GPIO header I suggest you to use GPIO[3:0] pins because they are not shared with LEDs and there shouldn’t be any difference on controlling them on both v1 and v2 boards.

As you already spotted there are slight differences between v1 and v2 versions. In v2 version GPIO[7:4] are shared with LEDs and current FPGA gateware uses them to indicate status. In order to control GPIO[7:4] in v2 version you have to change some additional register values, check 0x00C0, 0x00C4, 0x00C6 register description in [LimeSDR-Mini\_Gateware\_Description\_V01r00.pdf](https://github.com/myriadrf/LimeSDR-Mini-v2_GW/blob/main/LimeSDR-Mini_lms7_trx/doc/LimeSDR-Mini_Gateware_Description_V01r00.pdf) document page 19.

---

<div class="post-metadata">

**Author:** ![oe1rsa](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/oe1rsa/32/4714_2.png) [@oe1rsa](https://discourse.myriadrf.org/u/oe1rsa)\
**Post date:** [4 August 2023 14:14 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/6 "2023-08-04T14:14:52Z")

</div>

Ah, yes, thank you so much! I guess you mean the BOARD\_GPIO\_OVRD register? There is no dedicated function in the API available yet, correct?

Btw.: Can you pls. point me to where the behaviour of the “dedicated functions” of the shared Pins is described or give me a short description? Particularly I am interested in suitability of the GPIO7 pin for PA control. I can see that the LED starts to give a short flash when I schedule a transmit package that has a waiting timestamp, and then when the time has come to actually transmit, the LED starts a steady light until the burst has finished. What puzzles me: Can I get rid of the spurious flash at the begin?

---

<div class="post-metadata">

**Author:** ![VytautasB](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@VytautasB](https://discourse.myriadrf.org/u/VytautasB)\
**Post date:** [7 August 2023 09:59 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/7 "2023-08-07T09:59:19Z")

</div>

Yes, BOARD\_GPIO\_OVRD register overrides GPIO functions and gives control to the user.

Default GPIO behavior:  
GPIO[3:0] - currently they don’t have any dedicated function and by default can be controlled by user.  
GPIO4 - is shared with FPGA\_LED2\_G and indicates stream data from FPGA going trough USB.  
GPIO5 - is shared with FPGA\_LED2\_R and LED is always off.  
GPIO6 - is shared with FPGA\_LED3\_G and LED is always off.  
GPIO7 - is shared with FPGA\_LED3\_R and indicates stream data from Host going trough USB to FPGA.

So GPIO7 indicates stream data going trough USB endpoint this is why you see “short flash” when you send packet with waiting timestamp.

If you are willing to do some testing I can add transmit indication to one of the GPIOs which should be more suitable for PA control.

---

<div class="post-metadata">

**Author:** ![oe1rsa](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/oe1rsa/32/4714_2.png) [@oe1rsa](https://discourse.myriadrf.org/u/oe1rsa)\
**Post date:** [8 August 2023 16:22 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/8 "2023-08-08T16:22:33Z")

</div>

> [@VytautasB](#):
>
> If you are willing to do some testing I can add transmit indication to one of the GPIOs which should be more suitable for PA control.

This sounds great! We are, however, in design stage and have only an early prototype available. So what output would you expect from our testing, besides whether it works for us or not?

---

<div class="post-metadata">

**Author:** ![VytautasB](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@VytautasB](https://discourse.myriadrf.org/u/VytautasB)\
**Post date:** [9 August 2023 08:15 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/9 "2023-08-09T08:15:33Z")

</div>

I have added transmit indication to GPIO[0].  
Check for details here: [https://github.com/myriadrf/LimeSDR-Mini-v2\_GW/issues/3](https://github.com/myriadrf/LimeSDR-Mini-v2_GW/issues/3)

> [@oe1rsa](#):
>
> So what output would you expect from our testing, besides whether it works for us or not?

Just let me know if it works as expected 🙂

---

<div class="post-metadata">

**Author:** ![oe1rsa](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/oe1rsa/32/4714_2.png) [@oe1rsa](https://discourse.myriadrf.org/u/oe1rsa)\
**Post date:** [26 August 2023 16:03 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/10 "2023-08-26T16:03:35Z")

</div>

Finally after some delay, my friend told me that it looks like working 🙂 but I have not yet managed to update/flash my mini and test it since I am still waiting for delivery of my GPIO header connectors.

He, however, succeeded by loading the bit file via LimeSuiteGUI. Is this the recommended approach? Shall we also load the golden file?

---

<div class="post-metadata">

**Author:** ![VytautasB](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@VytautasB](https://discourse.myriadrf.org/u/VytautasB)\
**Post date:** [28 August 2023 06:42 UTC](https://discourse.myriadrf.org/t/limemini-2-2-gpio/8012/11 "2023-08-28T06:42:09Z")

</div>

> [@oe1rsa](#):
>
> Finally after some delay, my friend told me that it looks like working 🙂

Great, good to know 🙂

> [@oe1rsa](#):
>
> He, however, succeeded by loading the bit file via LimeSuiteGUI. Is this the recommended approach?

The simplest way to update would be via LimeSuiteGUI.

> [@oe1rsa](#):
>
> Shall we also load the golden file?

No. When updating with LimeSuiteGUI use only [lms7\_trx\_impl1.bit](https://github.com/myriadrf/LimeSDR-Mini-v2_GW/blob/main/LimeSDR-Mini_bitstreams/lms7_trx_impl1.bit)
