I'm attempting to enable the Transmit / DDS for Transmit (Tx) DMA output buffer transfers for Tx 1 on the PicoZed SDR through a script without the aid of the IIO Oscope application (and the associated IIO server daemon [iiod]).
From my understanding, in order to enable / activate the data for Tx1, I can use the following echo commands to set the following IIO parameters for the cf-ad94361-dds-core-lpc (iio:device2) device to a one (1):
echo 1 > /sys/bus/iio/devices/iio:device2/scan_elements/out_voltage0_en
echo 1 > /sys/bus/iio/devices/iio:device2/scan_elements/out_voltage1_en
echo 1 > /sys/bus/iio/devices/iio:device2/buffer/enable
However, after I a script that contains these commands, it appears that when I write data to the DMA Tx buffer the spectrum doesn't appear to change as if the data isn't being written.
Am I missing something in order to enable the DAC output buffers for Tx1?
Any feedback would be appreciated. I look forward to your response.
I would recommend avoiding direct usage of the file descriptors. This is what libiio was designed to make easier.
Here is an example which uses TX DMA buffers: libiio/ad9361-iiostream.c at master · analogdevicesinc/libiio · GitHub
Here is an example which uses TX DDSs: plutosdr_scripts/power.c at master · analogdevicesinc/plutosdr_scripts · GitHub
Thank you for your feedback and the GibHub links for examples on how to use the Tx DMA buffers and DDS subsystems.
I will look into referencing those examples for properly initializing (and shutting down) the Tx / DDS DAC buffer outputs but for is there a way I can use the file descriptors found in the /sys/bus/iio/devices/iio:devicex directories to quickly verify which parameters needs to be initialized set the DDS Mode to use the DAC Buffer Output and allow so data can be passed through to the DAC and the corresponding Tx 1 output?
Switching between the DDS and DMA is just writing to the cf-ad9361-dds-core-lpc device, channel altvoltage0, raw attribute.
DDS = 1
DMA = 0
HI. If you could, can you please elaborate on this. Ideally I am attempting to use system() calls from my embedded Linux app running from the Altera A10 dev kit for the adv9371, I want to simply be able to:
1. Set the TX1/2 DDS Mode to DAC Buffer Output
2. Load a file that contains my test waveforms
3. Virtually press the "load" button (reference to iio scope screen) to actually start the flow of data from the buffers to the TX DACs
I noted in the driver calls there are ways to set via "echo X > param", most parameters and even load a profile, but its not at all clear how to setup the TX 1/2 DDS mode to DAC Buffer Output, load the file and start the data flow from the buffer.
I have looked at some of the c code examples but having some difficultly in resolving many missing references even though including iio.h. The method I described would meet my needs if I could get the correct sequence and settings. Thank you very much.
root@analog:/sys/bus/iio/devices/iio:device3# cat nameaxi-ad9371-tx-hpc
buffer out_altvoltage5_TX2_I_F2_phasedev out_altvoltage5_TX2_I_F2_rawname out_altvoltage5_TX2_I_F2_scaleof_node out_altvoltage6_TX2_Q_F1_frequencyout_altvoltage0_TX1_I_F1_frequency out_altvoltage6_TX2_Q_F1_phaseout_altvoltage0_TX1_I_F1_phase out_altvoltage6_TX2_Q_F1_rawout_altvoltage0_TX1_I_F1_raw out_altvoltage6_TX2_Q_F1_scaleout_altvoltage0_TX1_I_F1_scale out_altvoltage7_TX2_Q_F2_frequencyout_altvoltage1_TX1_I_F2_frequency out_altvoltage7_TX2_Q_F2_phaseout_altvoltage1_TX1_I_F2_phase out_altvoltage7_TX2_Q_F2_rawout_altvoltage1_TX1_I_F2_raw out_altvoltage7_TX2_Q_F2_scaleout_altvoltage1_TX1_I_F2_scale out_altvoltage_sampling_frequencyout_altvoltage2_TX1_Q_F1_frequency out_voltage0_calibphaseout_altvoltage2_TX1_Q_F1_phase out_voltage0_calibscaleout_altvoltage2_TX1_Q_F1_raw out_voltage1_calibphaseout_altvoltage2_TX1_Q_F1_scale out_voltage1_calibscaleout_altvoltage3_TX1_Q_F2_frequency out_voltage2_calibphaseout_altvoltage3_TX1_Q_F2_phase out_voltage2_calibscaleout_altvoltage3_TX1_Q_F2_raw out_voltage3_calibphaseout_altvoltage3_TX1_Q_F2_scale out_voltage3_calibscaleout_altvoltage4_TX2_I_F1_frequency out_voltage_sampling_frequencyout_altvoltage4_TX2_I_F1_phase powerout_altvoltage4_TX2_I_F1_raw scan_elementsout_altvoltage4_TX2_I_F1_scale subsystemout_altvoltage5_TX2_I_F2_frequency uevent
There is an explicit example for AD9371 here: https://github.com/analogdevicesinc/libiio/blob/master/examples/ad9371-iiostream.c
If you want to have the data passed to the DMA simply repeat, just make the buffer cyclic: https://analogdevicesinc.github.io/libiio/group__Buffer.html#ga6caadf077c112ae55a64276aa24ef832
Here are the details on enabling/disabling the DDS: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dds/axi-dac-dds-hdl
Here is an example of configuring it for AD9361 but it applies to AD9371 as well: https://github.com/analogdevicesinc/plutosdr_scripts/blob/master/power.c