AD9361 RF BW change only for Rx

My customer use No-OS software for AD9361 in their system and want to change Rx RF filter BW independently in normal operation. But the setting for the filters of the both Rx and Tx are changed in the source code of  the command 'ad9361_update_rf_bandwidth()'. So they modified it as the attached file. Would you check their modification? They have a concern about commenting out the command 'ad9361_ensm_force_state()'. So would you let me know if there is any problem on this commenting out?

ad9361_update_rf_bandwidth_rx.c.txt
int32_t ad9361_update_rf_bandwidth_rx(struct ad9361_rf_phy *phy,
    uint32_t rf_rx_bw, uint32_t rf_tx_bw)
{
    uint32_t bbpll_freq;
    uint32_t real_rx_bandwidth = rf_rx_bw / 2;
    int32_t ret;

    bbpll_freq = clk_get_rate(phy, phy->ref_clk_scale[BBPLL_CLK]);
    ret = ad9361_tracking_control(phy, false, false, false);
    if (ret < 0)
        return ret;


//  ad9361_ensm_force_state(phy, ENSM_STATE_ALERT);

    ret = ad9361_rx_bb_analog_filter_calib(phy,
        real_rx_bandwidth,
        bbpll_freq);
    if (ret < 0)
        return ret;

    ret = ad9361_rx_tia_calib(phy, real_rx_bandwidth);
    if (ret < 0)
        return ret;

    ret = ad9361_rx_adc_setup(phy,
        bbpll_freq,
        clk_get_rate(phy, phy->ref_clk_scale[ADC_CLK]));
    if (ret < 0)
        return ret;

    phy->current_rx_bw_Hz = rf_rx_bw;

    ret = ad9361_tracking_control(phy, phy->bbdc_track_en,
        phy->rfdc_track_en, phy->quad_track_en);
    if (ret < 0)
        return ret;

//  ad9361_ensm_restore_prev_state(phy);

    return 0;
}

Parents Reply
  • 0
    •  Analog Employees 
    on Feb 12, 2019 1:40 AM over 1 year ago in reply to DragosB

    I know other calibration is explained that it should be run in the alert mode but the analog filter calibration is not explained about the state machine mode in the user. It is just commented as "The Rx baseband filter and Tx baseband filter calibrations are not part of the calibration sequence state machine, and should run only when all other calibrations are not running.". Moreover the customer has checked the modified looks work well. So the alert mode seems not to be mandatory. 

Children