How to change ad9375 TX gain ?

Hi

My system run mykonos on NO-OS use TX2 and RX2. I have read UG992. to change gain Tx, I can use API:  MYKONOS_setTx2Attenuation.

But once I use this API, gain TX is not change. I set MYKONOS_setTx2Attenuation(&mykdevice, 10000)

and get return value MYKONOS_getTx2Attenuation(); It return 1000; I can't change value attenuation.

Can you give solution?

Thanks

  • 0
    •  Analog Employees 
    on Jul 20, 2020 4:05 AM

    Please check whether the attenuation pin control mode is enabled using MYKONOS_getTx1AttenCtrlPin(), API MYKONOS_setTx2AttenCtrlPin ().

    If pin control mode is enabled then SPI mode command will not execute.

    Please check whether the Tx channel is enabled.

    From UG-992,

    If the Tx datapath is powered down when these commands are called, the last valid Tx attenuation setting when the Tx was powered up is read back.These commands are as follows:
    MYKONOS_getTx1Attenuation(mykonosDevice_t *device, uint16_t *tx1Attenuation_mdB)
    • MYKONOS_getTx2Attenuation(mykonosDevice_t *device, uint16_t *tx2Attenuation_mdB)

  • Hi

    Thanks for your reply

    I had verify again.

    I had disable pin control mode using MYKONOS_setTx2AttenCtrlPin(&mykDevice, 0, 0, 0, 0);

    And Tx datapath powered up in normal. with tone signal output -6dbm.

    But I still can't set attenuation TX on adrv9375

    Thanks and brgs

  • 0
    •  Analog Employees 
    on Apr 15, 2021 5:11 PM in reply to sonminh

    I apologize, The attenuation value has to be in dB not in mdB.

    Please refer to the below python script, If you want to set attenuation value as 10 dB.

    Link.Mykonos.setTx2Attenuation(10)
    print Link.Mykonos.getTx2Attenuation(0)

  • Thanks ,

    I use  library C mykonos to set attenuation, not python srcipt:

    /**
     * \brief Reads back the Tx2 RF output Attenuation
     *
     *  This function reads back the TxAttenuation setting currently applied to the transmit chain.
     *  The function will work with SPI mode or pin controlled TxAtten mode using the increment/decrement GPIO
     *  pins.  For the readback value to be valid the Tx data path must be powered up.  If the Tx data path
     *  is powered down or radioOff state, the last TxAtten setting while the Tx was powered up will be
     *  read back.
     *
     * <B>Dependencies</B>
     * - device->spiSettings
     * - device->spiSettings->chipSelectIndex
     *
     * \param device Pointer to the Mykonos device's data structure
     * \param tx2Attenuation_mdB The readback value of the Tx2 Attenuation in milli-dB (Range: 0 to 41950 mdB)
     *
     * \retval MYKONOS_ERR_OK Function completed successfully
     * \retval MYKONOS_ERR_GETTX2ATTEN_NULL_PARM tx2Attenuation_mdB return parameter pointer is NULL
     */
    mykonosErr_t MYKONOS_getTx2Attenuation(mykonosDevice_t *device, uint16_t *tx2Attenuation_mdB)

    So i set 10 dbm is 10000:

    MYKONOS_setTx2Attenuation(&mykDeviceB, 10000;
                        uint16_t u16Gain;

    MYKONOS_getTx2Attenuation(&mykDeviceB, &u16Gain);

    I had tried to set different value as 15000, 1500, 20000

    But It not change and always return value 1000

  • 0
    •  Analog Employees 
    on Apr 16, 2021 4:08 AM in reply to sonminh

    I suppose tx2Attenuation_mdB is a documentation mistake.

    What is the software package / version you are using.

    Can you please try dB value for tx2Attenuation_mdB in "C" code  and let us know?