Hello. In the pluto_tddn.py example in the pyadi-iio examples, the TDD engine is setup as following.
The tddn's class documentation is unfortunately very minimal and barely explains how it works and how to modify this for different use cases. One has to look at the HDL documentation and diagram in Vivado to begin to have an idea of how to understand it and I don't have much experience with it. So some more in-depth explanation directly in the pyadi-iio would be appreciated.
From what I understand looking at the Vivado project, the uncommented 1st channel is connected to the GPIO 0 pin. So is it just for external sync or do the channel[0] properties matter if we are doing software sync?
Why the magic number 10 in the off_raw property of channel[1] and channel[2]? From what I understand this property "turns off" the DMA SYNC channels 10 clock cycles before the frame is finished. If I try to set off_raw to 0 in the RX DMA SYNC channel I get the following error
x = self._rx_buffered_data()
^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/adi/compat.py", line 149, in _rx_buffered_data
self._rxbuf.refill()
File "[...]/iio.py", line 1003, in refill
_buffer_refill(self._buffer)
File "[...]/iio.py", line 62, in _check_negative
raise OSError(-result, _strerror(-result))
TimeoutError: [Errno 110] Connection timed out
Which I can't recover from even after setting the value back to 10 unless I turn the Pluto off and on again.
If I set tddn.channel[2].off_raw = 0, then basically only 0's are sent to the transceiver for transmission.
Using off_raw = 2 seems to work. I would be grateful if someone could provide an explanation on how to pick this value and if it is possible to use off_raw = 0 so that samples aren't lost between frames.
Finally, what does polarity do?

