LMS_WriteFPGAReg(device, 0x00C0, 0xFFFE) is not working

Hello.
I am trying to transmit data when GPIO_0 is high(trigger). But it doesn’t work.
LimeSDR transmitted data even though I disconnected GPIO pin.

my code is here(github)
I just add LMS_WriteFPGAReg into my code.

Am I missing something??

@Zack
Do you know why?

I do not see GPIO_0 pin init command (set input or output mode). After GPIO is initialized it can be read or write pin state.

1 Like

Thank you for replying, yt7pwr.

I still can’t implement.
I set all pin input mode like this

uint8_t gpio_dir = 0x00;
LMS_GPIODirWrite(m_device, &gpio_dir, 1);

then,

LMS_WriteFPGAReg(device, 0x00C0, 0xFFFE)

But, it doesn’t work. (LimeSDR transmitted data even though I disconnected GPIO pin.)

Is there anything I have to write wait something code? or What code should I write?

Use LMS_GPIORead command to read pin state.

With some devices, you need to set the transmit gain to zero to actually get it to stop transmitting - perhaps that is your problem.

1 Like

I set tx gain to zero. But it didn’t work…

@yt7pwr
What should I do when read GPIO(LMS_GPIORead )?
I did many way but LimeSDR transmit data even though I disconnected GPIO pin.

I want to solve this problem which is two SDR didn’t simultaneously send IQ data. I think it caused by different usb port. I think it can be solve with rendering trigger(transmit when GPIO pin is HIGH), not using usb communication.
In the future I want to 8x8 MIMO(OAM).

Your original question was how to trigger TX with GPIO pins. Read GPIO pin state and you will have trigger information. This is not interrupt but polling system. TX will start when your software start filling transmit buffer and will end when buffer is empty or TX is disabled by command. To sync two devices is complex task, my solution will be to give each device command with exact TX start time but times will be different and you will need sync routine to determine time difference. USB is not syncroniuos system but if you know exact delay and your software and hardware are fast enough result is sync work.

Thank you for your nice replying. I see sync two device is complex task…
I have no choice but to render IQ data from GPIO pin instead of from USB for syncing multi LimeSDR.

I modified the FPGA firmware such that four GPIO outputs represent four bits of the TX stream. A TX data packet thus consists of 16 bits in total: 12 bits for the DACs and 4 bits for the GPIO. Importantly, the LimeSuite API already implements streams with 16-bit data, which is natural given the bus width of the USB interface. from this site