AnsweredAssumed Answered

ad9361_validate_enable_fir Error

Question asked by Raptor99 on Dec 14, 2015
Latest reply on Dec 18, 2015 by mhennerich

Hello,

 

I am writing a function using the no-OS driver to configure the ad9364 between a mode appropriate for LTE (30.72 MHz sample rate) and CDMA (2.4576 MHz). The function basically calls a series of functions from the ad9361_api.

 

To do this I am using the ad9361_set_trx_path_clks function and I wish to use a 128 tap FIR. In CDMA mode, I configure the FIR using ad9361_set_rx_fir_config to a 128 tap decimate by 2 filter and enable the filter. Then I set the clocks using these vectors:

 

For my application I am not using transmit functionality so I only set it because the function requires it.

 

    uint32_t cdma_rx_clks[7] = {1258291200, 39321600, 19660800, 9830400, 4915200, 2457600,0};
    uint32_t cdma_tx_clks[5] = {39321600,19660800, 9830400,4915200,4915200};

 

The receive FIR will decimate by 2 for an output of 2.4576 MHz.

This function works the first time I execute it and i get filtered data at the appropriate rate. However, the 2nd time I invoke this configuration function fails every time, giving the error:

 

ad9361_validate_enable_fir: Invalid ratio ADC/2 / RX_SAMPL * 16 > TAPS

 

However this is the same sequence of functions and configuration that worked properly the first time the function is called. Printing out the clock chain, shows the chain is correct up to the last stage, which shows the output of the FIR not decimated by 2 (4.9152).

 

Further confusing is I have a function for the LTE sample rate which sets the clocks as follows:

    uint32_t lte_rx_clks[7] = {983040000, 491520000, 245760000, 122880000, 61440000, 30720000,0};
    uint32_t lte_tx_clks[5] = {245760000, 122880000, 61440000, 30720000, 30720000};

 

This function, which is essentially the same (the only difference between the 2 is the clock chain vectors and the actual FIR taps), can be called many times in a row without failure and the data comes out of the FIR as expected.

 

What is invalid about the cdma clock chain vectors? Is there a certain relationship needed between the Tx/Rx chains to configure properly? In my application, I am not transmitting so any valid Tx vector would be fine.

 

Thanks

Outcomes