configuration with external LNA in AD9364

   I designed customized RF tranceiver board with AD9364. I have a customize RF board with an external LNA   and output connected to the RF transceiver board.,  I  worked in fast AGC mode with out external LNA , its working fine . when i tried to give  GPIO_O output to my external LNA to control attenuation of external LNA .The AGC loop is working fine in power on condition , when i tried to change the input of system, the AGC is going to failed .  

 I changed  the default gain table as per UG -570  and enabled the bit of D6  in the register of 0x026. please can any one suggest me how to fix my problem ? 

  • 0
    •  Analog Employees 
    on Sep 6, 2021 3:03 PM

    How is GPO configured in ad9361_gpo_setup function ?

    Are you using manual GPO control or update of gain automatically by updating the gain table?

    From user Guide.

    Setting Bit D4 of Register 0x026 puts the GPOs in manual control mode. Use the upper nibble (four bits) of Register 0x027 as the GPO logic level controls. GPO_3 uses D7; GPO_2 uses D6, GPO_1 uses D5, GPO_0 uses D4. In this mode, the lower nibble of Register 0x26 is ignored.

  • thank you reply.

    I configured GPO-0 ,by updating the gain table . i am not using manual control. the read data of 0x026 is 0xA0.

  • 0
    •  Analog Employees 
    on Sep 7, 2021 3:08 PM in reply to manideep

    Are you able to change the gain of the external LNA using GPO0 as per the gain table? Can you share with us your modified gain table? At what input level, the AGC is failing? Is the AGC failing only at those power levels in which AGC is using the added external LNA gain ?

  • Yes, i am able to change the gain of the external LNA through GPO0. I am changing the attenuation of the external LNA through GPO0. My external LNA gain values are 28 dB if attenuation  is off or 14 dB if attenuation  is on . The AGC loop is working fine  in  the mode of attenuation off  for all input levels.

         To made simulation easy, I have prepared two gain tables of external LNA control on and off . I have simulated the conditions one by one by placing respective gain tables in the program. The AGC loop is working fine with the gain table of external LNA OFF for all input levels. 

        The observations with the gain table of external LNA ON  are :

               1. AGC is working fine only on initialization .

               2. Going to calibration out even for 1 dB change in input level. Again if I reinitialize,                 AGC is working good for changed input levels.

                  Here with i am enclosing two gain tables.

         

    gain_tables.txt
                   
        // Gain table with External LNA off control
    
                    { 0x00, 0x00, 0x20 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 },//2
    		{ 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x00 },//5
    		{ 0x00, 0x02, 0x00 }, { 0x00, 0x03, 0x00 }, { 0x01, 0x01, 0x20 },
    		{ 0x01, 0x02, 0x00 }, { 0x01, 0x03, 0x00 }, { 0x01, 0x04, 0x20 },
    		{ 0x01, 0x05, 0x00 }, { 0x01, 0x06, 0x00 }, { 0x01, 0x07, 0x00 },
    		{ 0x01, 0x08, 0x00 }, { 0x01, 0x09, 0x00 }, { 0x01, 0x0A, 0x00 },
    		{ 0x01, 0x0B, 0x00 }, { 0x01, 0x0C, 0x00 }, { 0x02, 0x08, 0x20 },
    		{ 0x02, 0x09, 0x00 }, { 0x02, 0x0A, 0x00 }, { 0x02, 0x0B, 0x20 },
    		{ 0x02, 0x0C, 0x00 }, { 0x02, 0x0D, 0x00 }, { 0x02, 0x0E, 0x00 },//26
    		{ 0x02, 0x0F, 0x00 }, { 0x02, 0x2A, 0x20 }, { 0x02, 0x2B, 0x00 },
    		{ 0x04, 0x27, 0x20 }, { 0x04, 0x28, 0x00 }, { 0x04, 0x29, 0x00 },//32
    		{ 0x04, 0x2A, 0x00 }, { 0x04, 0x2B, 0x00 }, { 0x04, 0x2C, 0x00 },//35
    		{ 0x04, 0x2D, 0x00 }, { 0x24, 0x20, 0x20 }, { 0x24, 0x21, 0x00 },//0x24 is replaced with  0x44  for 37,38,39
    		{ 0x44, 0x22, 0x00 }, { 0x44, 0x23, 0x00 }, { 0x44, 0x24, 0x00 },
    		{ 0x44, 0x25, 0x00 }, { 0x44, 0x26, 0x00 }, { 0x44, 0x27, 0x00 },
    		{ 0x44, 0x28, 0x00 }, { 0x44, 0x29, 0x00 }, { 0x44, 0x2A, 0x00 },
    		{ 0x44, 0x2B, 0x00 }, { 0x44, 0x2C, 0x00 }, { 0x44, 0x2D, 0x00 },
    		{ 0x44, 0x2E, 0x00 }, { 0x64, 0x2E, 0x20 }, { 0x64, 0x2F, 0x00 },
    		{ 0x64, 0x30, 0x00 }, { 0x64, 0x31, 0x00 }, { 0x64, 0x32, 0x00 },
    		{ 0x64, 0x33, 0x00 }, { 0x64, 0x34, 0x00 }, { 0x64, 0x35, 0x00 },
    		{ 0x64, 0x36, 0x00 }, { 0x64, 0x37, 0x00 }, { 0x64, 0x38, 0x00 },
    		{ 0x65, 0x38, 0x20 }, { 0x66, 0x38, 0x20 }, { 0x67, 0x38, 0x20 },
    		{ 0x68, 0x38, 0x20 }, { 0x69, 0x38, 0x20 }, { 0x6A, 0x38, 0x20 },
    		{ 0x6B, 0x38, 0x20 }, { 0x6C, 0x38, 0x20 }, { 0x6D, 0x38, 0x20 },
                	{ 0x6E, 0x38, 0x20 }, { 0x6F, 0x38, 0x20 }
    
    
      // Gain table with External LNA on control
    
                    { 0x80, 0x00, 0x20 }, { 0x80, 0x00, 0x00 }, { 0x80, 0x00, 0x00 },//2
    		{ 0x80, 0x00, 0x00 }, { 0x80, 0x00, 0x00 }, { 0x80, 0x01, 0x00 },//5
    		{ 0x80, 0x02, 0x00 }, { 0x80, 0x03, 0x00 }, { 0x81, 0x01, 0x20 },
    		{ 0x81, 0x02, 0x00 }, { 0x81, 0x03, 0x00 }, { 0x81, 0x04, 0x20 },
    		{ 0x81, 0x05, 0x00 }, { 0x81, 0x06, 0x00 }, { 0x81, 0x07, 0x00 },
    	        { 0x81, 0x08, 0x00 }, { 0x81, 0x09, 0x00 }, { 0x81, 0x0A, 0x00 },
    		{ 0x81, 0x0B, 0x00 }, { 0x81, 0x0C, 0x00 }, { 0x82, 0x08, 0x20 },
    		{ 0x82, 0x09, 0x00 }, { 0x82, 0x0A, 0x00 }, { 0x82, 0x0B, 0x20 },
    		{ 0x82, 0x0C, 0x00 }, { 0x82, 0x0D, 0x00 }, { 0x82, 0x0E, 0x00 },//26
    		{ 0x82, 0x0F, 0x00 }, { 0x82, 0x2A, 0x20 }, { 0x82, 0x2B, 0x00 },
    		{ 0x84, 0x27, 0x20 }, { 0x84, 0x28, 0x00 }, { 0x84, 0x29, 0x00 },//32
    		{ 0x84, 0x2A, 0x00 }, { 0x84, 0x2B, 0x00 }, { 0x84, 0x2C, 0x00 },//35
    		{ 0x84, 0x2D, 0x00 }, { 0xA4, 0x20, 0x20 }, { 0xA4, 0x21, 0x00 },//0x24 is replaced with  0x44  for 37,38,39
    		{ 0xC4, 0x22, 0x00 }, { 0xC4, 0x23, 0x00 }, { 0xC4, 0x24, 0x00 },
    		{ 0xC4, 0x25, 0x00 }, { 0xC4, 0x26, 0x00 }, { 0xC4, 0x27, 0x00 },
    		{ 0xC4, 0x28, 0x00 }, { 0xC4, 0x29, 0x00 }, { 0xC4, 0x2A, 0x00 },
                    { 0xC4, 0x2B, 0x00 }, { 0xC4, 0x2C, 0x00 }, { 0xC4, 0x2D, 0x00 },
    		{ 0xC4, 0x2E, 0x00 }, { 0xE4, 0x2E, 0x20 }, { 0xE4, 0x2F, 0x00 },
    		{ 0xE4, 0x30, 0x00 }, { 0xE4, 0x31, 0x00 }, { 0xE4, 0x32, 0x00 },
    		{ 0xE4, 0x33, 0x00 }, { 0xE4, 0x34, 0x00 }, { 0xE4, 0x35, 0x00 },
    		{ 0xE4, 0x36, 0x00 }, { 0xE4, 0x37, 0x00 }, { 0xE4, 0x38, 0x00 },
    		{ 0xE5, 0x38, 0x20 }, { 0xE6, 0x38, 0x20 }, { 0xE7, 0x38, 0x20 },
    		{ 0xE8, 0x38, 0x20 }, { 0xE9, 0x38, 0x20 }, { 0xEA, 0x38, 0x20 },
    		{ 0xEB, 0x38, 0x20 }, { 0xEC, 0x38, 0x20 }, { 0xED, 0x38, 0x20 },
    		{ 0xEE, 0x38, 0x20 }, { 0xEF, 0x38, 0x20 }
    

  • 0
    •  Analog Employees 
    on Sep 14, 2021 10:46 AM in reply to manideep
    Going to calibration out even for 1 dB change in input level. Again if I reinitialize,                 AGC is working good for changed input levels.

    What do you mean by calibration out? Are you checking the convergence bit to determine the cal failure?  Is the DC offset cal failing? 

    The DC cal bit in the gain table that runs the cal should only be set to 1 when the  internal LMT(LNA, MIXER,TIA) gain index changes(DC cal bit should follow the default gain table). It should not be set to 1 with the external LNA index change. 

    Make sure that there is no signal input given to the RX port while running callibrations.