LimeSDR J12 GPIO Control

Hi all,

I’ve seen some discussion about the GPIOs on the LimeSDR on this post, but it hasn’t quite made it clear to me what the status of their implementation currently is.

I’m using the SoapySDR library to control the LimeSDR using my own c++ program, and need GPIO control using the J12 header, is there any way currently to do this? I noticed that the GPIO SoapySDR interface methods aren’t yet implemented, though should it still be possible to write to the GPIOs using the write register method? I’ve looked around for the FPGA register address for the J12 GPIO block, but haven’t had any success so far.

As a bit of background, I’m planning on using the GPIOs to control a switching network, to perform some measurements using a number of different antennas. SoapySDR seemed like a good choice, because I wanted to support the bladeRF we were using before the LimeSDR came along. If the case is that the GPIO support simply isn’t implemented yet, I’d be happy to volunteer some time on the code to try to get it going, though I have zero FPGA experience, so I might only be useful on the frontend. But I’m also willing to learn new tricks :slight_smile:

Thanks for any help you can offer,
Anthony

@fieldsde mentions the D-sub connector and a GPIO kit. Perhaps they have something to share about the GPIO.

@joshblum and I briefly discussed GPIO support and he had some suggestions. Tagging @Zack also as it sounds like work in the FPGA could be required.

Thanks @andrewback, that sounds good. If I can be of any assistance at all in the implementation, I have the time to help.

Also, @hTo137 thanks for mentioning that, it looks promising. @fieldsde, have you already started working on this?

Thanks, it’s much appreciated, @astancombe! I’ll leave it to Josh and Zack to look at what is required and consider how we might take you up on your kind offer.

Hello,

We have to update gateware/API to support GPIO. I do expect it to be finished next week.

4 Likes

Thanks Zack, that sounds really great - much sooner than I had anticipated!

I see there are calls in the LMS API to read and write to the GPIO pins now. I was wondering about the timing of the GPIO updates - how does the processing of the GPIO updates happen with respect to timing of trasmit samples? Might it be possible to sychronize outputs to GPIOs with the RF? Could GPIO output writes be tied to timestamps the same way the transmit RF can be?

2 Likes

@Zack Are you referring to https://github.com/myriadrf/LimeSuite/blob/master/src/ConnectionRegistry/IConnection.h#L524

Also @astancombe seems to want to use J12 to control a switching network. Is this possible? Reading https://wiki.myriadrf.org/LimeSDR-USB_User_Guide#Configuration.2C_status.2C_and_setup_elements I see J12 as “USB 3.0 microcontroller’s (IC6) debugging pin header” while https://wiki.myriadrf.org/LimeSDR-USB_User_Guide#General_user_input.2Foutput shows “only” J18, J19 and J20.

For anyone interested I found this image https://wiki.myriadrf.org/File:LimeSDR-USB-Overview.jpg showing those Jxx.

EDIT:
Reading https://myriadrf.org/blog/limesdr-made-simple-part-1/ it states “Connector J19 maybe of interest for some applications. This is a set of 8 generic GPIO’s”. I guess it should be J18.

Hi @BladderRF,

First of all, you are referring to the old version of the board. Check this resource to be on the same page:
https://wiki.myriadrf.org/LimeSDR-USB

Thanks @Zack, I see the page I linked was for v1.2 while the latest is 1.4. It can be quite confusing for someone who’s just new to it. I would advise to put a big disclaimer at the top of https://wiki.myriadrf.org/LimeSDR-USB_User_Guide

Hi all,

@astancombe We’re you able to control your switching network with the GPIO?

@andrewback @Zack I’ve seen the GPIO Board. There’s not much info about it. What improvements / additional capabilities does it add, as opposed to directly using the GPIO pins on the LimeSDR board?

Also the LimeSDR PCIe page looks a bit sad with just Coming Soon!. Does it work the same as the USB when it comes to GPIO?

Yep, using SoapySDR I can currently control the 8 available GPIO on the J12 GPIO block, which was enough for my switching network.

Nice, thanks.

Please see:

https://wiki.myriadrf.org/LimeSDR_GPIO_Board

I think so, but @Zack, could you confirm please.

Thanks Andrew. I at least tried to use the SoapySDR GPIO interface and it seems to be working, even if I haven’t connected it to anything interesting.

Hi Anthony,

I would also like to use a switch to switch between antennas. Now I just noticed that the switch I bought mentions DC blocking capacitors are required at ports RFC and RF1, 2, … Did you also had to use DC blocking capacitors on your setup? I’m pretty new to all this and was wondering if I really need them, and what type to use between inner, outer, inner/outer?

Thanks for any advice.

It really depends on the switch IC you are using and how you are using it. Some switch ICs have them inbuilt, though it sounds like yours does not - I am currently using mostly Peregrine switches and don’t need any blocking caps. You’ll have to read the datasheet for the recommended values and types, for example this murata switch recommends using 0402 330pF tin plated layer ceramic capacitors. If your datasheet doesn’t specify, you could probably use something recommended for a similar switch from a competitor. Generally it won’t matter a whole lot if it’s just for hobbyist applications, as long as a DC blocking capacitor of some value is there.

But it is really comming soon! :slight_smile: It should be ready next week.

Yes, it is the same. Just one difference - LimeSDR-PCIe board got 16 bits while LimeSDR-USB eight.

But it is really comming soon! :slight_smile: It should be ready next week.

Good to know :+1:

Yes, it is the same. Just one difference - LimeSDR-PCIe board got 16 bits while LimeSDR-USB eight.

It’s strange, it seems I can only see 8 bits through Soapy

char GPIOBankName[] = "MAIN"; // There's only that one bank.
int result = SoapySDRDevice_writeGPIODir(sdr, GPIOBankName, 4095);
unsigned int gpioDirRead = SoapySDRDevice_readGPIODir(sdr, GPIOBankName); // I get 255
result = SoapySDRDevice_writeGPIO(sdr, GPIOBankName, 4095);
unsigned int gpioRead = SoapySDRDevice_readGPIO(sdr, GPIOBankName); // I get 255