I will like to know if possible to limit the maximum gain of the AGC mode on the AD9361/9364. Can you please let me know the procedure? I'm using the latest 2014_R2 on the ZC702/Zed board with Linux.
Accessing SPI registers is documented here:
AD9361 high performance, highly integrated RF Agile Transceiver™ Linux device driver [Analog Devices Wiki]
Loading custom gain tables is on our TODO list. Right now custom gain tables require a kernel rebuild.
I think you set the maximum values you want as the highest entries in the gain table. The documentation explains the relationship between gain tables and gain in the RX chain.
You can modify the gain table by deleting the higher gain entries that you do not need. You can refer to the documentation to see how the table is written and how to set the highest valid gain index.
Does it mean recompiling the whole driver + kernel? Is ther a way to update that table on the fly?
Can you explain what you are trying to achieve at the application level?
We may be able to offer a better solution for you if you knew more about your application.
What are you trying to achieve by limiting max gain? Are you trying to limit sensitivity or increase maximum input signal handling capability (the same max input signal level still applies)?
Hi All and thank you for the support.
Regarding the concern about maximum gain on AGC, there are situations where the maximum gain needs to be limited because of overall system gain and isolation. As the AGC will go to full gain (about 77 dB) when no signal present, it is necessary sometimes to be able to limit the maximum gain, Ex: an aplifier system where your maximum system gain cannot be higher than 100 dB (amp gain = 40 dB) and the AGC should be limited to 60 dB. that is the applciation and widely used in narrowbanding. That is why should be a way of limiting the gain under those cirscunstances (it will desensitize the receiver because of hihger NF, but that is the goal). Is there any way of controlling this?
Gain can be limited by omitting gain table entries that result in a gain that is over the maximum gain limit.
To me it seems like you want to do this only part of the time and still have full gain table available to work with.
Depending on the timing you are trying to meet this may not be possible because gain table entries take time to write and at least some of the entries require calibration.
You can try the approach below as another option. This has not been tested as max gain control on the fly, but it is worth trying out. This is a register that sets the maximum gain index of the gain table, i.e. it sets a limit for the AGC algorithm in how high it can go when adjusting gain. It is only one SPI Write and it may work for you as a way of changing max gain limit on the "fly". With this approach a full gain table would be written.
SPI Register 0x0FD—Max LMT/Full Gain
This register must be set to the maximum gain index of the gain table.
Thank you for the info, Is there a way to write that register under the current linux iio driver?
Yes - in the main window, there should be a "debug" tab, which is where you can do SPI reads/writes to test things out.
timh can add some more docs, if you can't follow what's there. Just let us know. (it does look a little thin to me).
We are not using the graphical environment, I just wonder if there is a function on the iio driver tos send a debug command to the AD9361, command line like.
There is IIO for Windows (communicate over remote network) - does that work?
Otherwise, you can poke in the kernel's debugfs
Can you please show me where on the debugfs is the access to the SPI to write that register? I can see lots of nodes there but will help me if you gave me some guidance, like an example.
Moved to Linux Software Drivers for an answer on where to finds debugfs.
Retrieving data ...