I am using AD9375 + ZC706 with Matlab 2019b on Windows.
I was able to transmit and receive signals with the attached files (I had to make minor changes to the ORx.m file and to the ad9371.m file).
I am trying to change the observation receiver to work with 'manual' gain control instead of 'automatic' gain control and I am getting the following error:
"Error using matlabshared.libiio.base/cstatus
Attribute harswaregain return value -190, expected 10"
1) Any suggestions about how to fix this?
2) Is it because I am using AD9375 and not AD9371 (I am using the AD9371 files provided by Bogdan)?
2) How do I set the target power for automatic gain control?
Yaniv said:Attribute harswaregain return value -190, expected 10"
This a paste error? There is no such attribute harswaregain.
None of your code sets manual gain control mode. When do you get this error?
Sorry for the paste error. The correct error is:
Attribute hardwaregain return value -190, expected 10"
I did not include the changes in the ORx.m file that I sent. See below the changes I made.
I get the error when I call to: [out, valid] = rx();
properties %GainControlMode Gain Control Mode % specified as one of the following: % 'automatic' For signals with changing power levels % 'manual' For setting the gain manually with the Gain property % 'hybrid' For configuring hybrid AGC mode GainControlMode = 'manual'; %Gain Gain % Rx gain, specified as a scalar from 0 dB to 52 dB. The acceptable % minimum and maximum gain setting depends on the center % frequency. Gain = 10; end
properties %RFPortSelect RF Port Select % 'OFF' - SnRx path is disabled % 'ORX1_TX_LO' SnRx operates in observation mode on ORx1 with % Tx LO synthesizer % 'ORX2_TX_LO' SnRx operates in observation mode on ORx2 with % Tx LO synthesizer % 'INTERNALCALS' enables scheduled Tx calibrations while using % SnRx path. The enableTrackingCals function needs to be called % in RADIO_OFF state. It sets the calibration mask, which the % scheduler will later use to schedule the desired calibrations. % This command is issued in RADIO_OFF. Once the AD9371 moves to % RADIO_ON state, the internal scheduler will use the enabled % calibration mask to schedule calibrations whenever possible, % based on the state of the transceiver. The Tx calibrations % will not be scheduled until INTERNALCALS is selected and the % Tx calibrations are enabled in the cal mask. % 'OBS_SNIFFER' SnRx operates in sniffer mode with latest % selected Sniffer Input for hardware pin control operation. % In pin mode, the GPIO pins designated for ORX_MODE would % select SNIFFER mode. Then MYKONOS_setSnifferChannel function % would choose the channel. % 'ORX1_SN_LO' SnRx operates in observation mode on ORx1 with % SNIFFER LO synthesizer % 'ORX2_SN_LO' SnRx operates in observation mode on ORx2 with % SNIFFER LO synthesizer % 'SN_A' SnRx operates in sniffer mode on SnRxA with SNIFFER % LO synthesizer % 'SN_B' SnRx operates in sniffer mode on SnRxB with SNIFFER % LO synthesizer % 'SN_C' SnRx operates in sniffer mode on SnRxC with SNIFFER % LO synthesizer RFPortSelect = 'ORX1_TX_LO'; end
Ok you are directly editing the class (I wouldn't really recommend this since you can just update properties in objects).
So the problem comes when the RF Port Select is in "OFF" mode when setting the manual gain. This is really only an issue if at first initialization you must be in manual mode. If you setup the class, call the operation ( rx() ) first, then go into manual mode, this error is avoided.
I added a change to go around this during initialization (https://github.com/analogdevicesinc/TransceiverToolbox/pull/20). If you can wait 12 hours it should be merged soon.
Thank you for your fast response.
I will check the new version in manual mode and update if it is working.
How do I set the target power for the automatic gain control?
There is no such setting as target power.
Thanks for the answer.
I checked the new ORx.m code and it is working.
I am only able to configure the ORx gain between -4 dB to +18 dB.
Is this the expected range?
Yes, ORx is much more limited on gain.