I try to read RX FIR Taps from AD9361. The value of address 0x0F0 is 0X7F, and I found all values around address 0x7F are not tap values I loaded through IIO. What is the RX taps start address? How can the ARM read those taps?
You don't have to read the value of 0x0F0 - you have to write the number of the coefficient to be read.
For example, if you want to read the coefficient 0:
- write 0 to register 0x0F0;
- read registers 0x0F3 and 0x0F4 for obtaining the coefficient 0 data.
If you want to read the coefficient 1:
- write 1 to register 0x0F0
- read registers 0x0F3 and 0x0F4 for obtaining the coefficient 1 data.
You have to do the same thing as ad9361_get_rx_fir_config() does.
You are saying that the FIRs were configure through IIO, so I assume that you are using the Linux drivers, not the no-OS ones. Is it true?
There is not a Linux user space function for reading back the coefficients.
On the no-OS side, you can use ad9361_get_rx_fir_config()/ad9361_get_tx_fir_config() for doing that. If you really need that, you can do something similar on Linux.
Thanks for the reply. You are correct we use Linux drivers. We really want to read coefficients back from AD9361. I thought those taps are saved in the AD9361 registers, so ARM can read them back through SPI. But I could not do it. Could you please tell me a method , any mathod, to do so?
Thanks a lot!
You can replicate what ad9361_get_rx_fir_config() does (no-OS/ad9361_api.c at master · analogdevicesinc/no-OS · GitHub). The digital filter coefficients are indirectly addressable: you need to specify first the number of the coefficient to be read using register 0x0F0 and after that to actually read the coefficient data from registers 0x0F3 and 0x0F4.
Is register 0x0F0 for FIR address? The number of coefficients is in 0x0F5? The value of register 0x0F0 is 0x7F, what does that mean?
You can find the description of these registers in the AD9361 Register Map Reference Manual UG-671 (http://www.analog.com/en/design-center/landing-pages/001/integrated-rf-agile-transceiver-design-resources.html ).
Yes, I did. The UG-671 says: SPI Regitser 0x0F0: Rx Filter Coeff Addr.
See here: https://github.com/analogdevicesinc/linux/blob/xcomm_zynq/drivers/iio/adc/ad9361.c#L4728
static int ad9361_verify_fir_filter_coef(struct ad9361_rf_phy *phy, enum fir_dest dest, u32 ntaps, short *coef)
This function shows how to read FIR TAPS.
Please note in order to read them successfully the FIR needs to be enabled.
Thanks for the instructions. I tried following after load a RX FIR:
All read back coeffcients are 0s.
Take a look here: no-OS/ad9361_api.c at master · analogdevicesinc/no-OS · GitHub
You have to also set the Rx Filter Configuration (0x0F5) - read it first, set the desired channel and the bit "Start Rx Clock" in the read value and write the result to 0x0F5.
Since we use Linux, we may not be able to follow the no-OS approach. Instead, I did following:
I set (0F5) D1=1, and the results are still are 0s.
Thanks a lot!
It doesn't matter if it's Linux or no-OS - the approach should be the same.
You have to choose one of the channels, not both of them (instead of 0xFA try 0xEA).
I got it right now. Thank you very very much!
Retrieving data ...