PGA870EVM: MATLAB Code for PGA870EVM Attenuator

Part Number: PGA870EVM
Other Parts Discussed in Thread: PGA870

Tool/software:

Hello, 

TI provided me MATLAB code for the PGA870EVM attenuator, which is used to adjust the attenuation level of the attenuator in MATLAB. I was able to get this code working on my laptop, so I am able to adjust the attenuation level in 5 dB steps within an accuracy of 0-0.3 dB.

However, I noticed that the actual attenuation level measured on the Spectrum Analyzer seems to be 10 dB lower than what I set it to using the set_gain function from the PGA class. I’m wondering if there is an explanation for why this could be happening.

For example, I injected a -5 dBm signal at the input of the attenuator, and had the output port directly connected to the Spectrum Analyzer. Before I call the set_gain function for the first time, the signal on the spectrum analyzer has a measured power of -5.55 dBm. But when I create the PGA MATLAB class and call myPGA.set_gain(0), the output power drops to -16.7 dBm. I would have expected the measured power to stay at roughly -5.55 dBm to reflect an attenuation of 0 dB.

Similarly, when I call myPGA.set_gain(-20), the output power drops to -36.8 dBm. I would have expected it to be -26.7 dBm.

I am using single-ended input and output connections. So I am only injecting RF signals into the IN+ port of the attenuator, and nothing is connected to the IN- port. Similary, the Spectrum Analyzer is only connected to the Out+ port; nothing is connected to the Out- port. Also, my DC power supply is supplying 5 Volts to the Vs port.

Is there an explanation for why I am observing this 10-11 dB degradation in attenuation level from what I set in the MATLAB code?

  • Hello Joshua,

      We are looking into this issue, and will get back to you by today.

    Thank you,

    Sima

  • Hello Joshua,

    Could you share a block diagram or schematic of how you have the PGA870EVM configured?  I am curious how you are driving the PGA870.  There could be an issue with input loss and reflections, resulting in your lower observed output power.

    I also will note the minimum gain of the PGA870 is -11.5dB; you have been passing -20dB into the MATLAB function.  

    Would you mind sharing your code, as is, with me via email screenshots if you do not wish to share here?  I want to know how you are setting the properties of the myPGA class; you would need to set the minimum and maximum gain.  There may also need to be a seed or starting value for curgain (current gain) to make sure the PGA is initialized properly.  

    The other thing you can check is that you do not have any attenuation in your signal chain from instrument to DUT to instrument?  

    Best,

    Alec

  • Hello Joshua,

    I believe we are also supporting this internally via your TI FAE & TSR.  Please feel free to keep me updated on any direct questions you have for me here, but I am also looped-in to the related discussion through your support contacts.

    Best,

    Alec

  • Hello Alec, 

    I have the attenuator board set up very similar to the image shown below. There are only a few differences between the configuration in this image and the configuration I have with our PGA870EVM board; following is a list of all these differences:

    (1) I do not have anything connected to the IN- port; that port is not terminated with any load. I wonder if it should be terminated with a 50-ohm termination to prevent reflections caused by the open-circuit at IN-.

    (2) I do not have anything connected to the OUT- port; that port is not terminated with any load. I wonder if it should be terminated with a 50-ohm termination to prevent reflections caused by the open-circuit at OUT-.

    (3) I'm not sure if the configuration of the switches circled in orange affects the operation of the board. I actually tried flipping each of those switches to see if it would affect the observed attenuation level. But I did not see any impact. 

    (4) I'm using a 5 V power supply to power the attenuator board. I'm not sure if TI is using a different voltage level to power the board in their lab configuration.

     

  • Hello Joshua,

    I can provide my insight here.  I am able to help debug or answer additional questions you may have after this.

    1. You may try terminating the SMA connector for IN-.  You can use an SMA 50-Ohm connector or use the pads on the PCB to add 50-Ohm termination to the IN- side of the input structure.  The PGA870EVM can be driven single-endedly, the issue may be as you summarized with the zero-Ohm resistors/shorts connecting the IN- signal path to the device without a signal present.

    2. Similar to #1, you should try your debugging step of termination of the OUT- port.  For either the inputs or outputs there is also the ability to install a transformer, should you wish to use a transformer for single-ended to differential (and/or vice-versa).  

    3. When the PGA870EVM is configured to be controlled over USB, the switches circled in orange outline will not be active.  The EVM has an either/or setup for these switches; either the orange switches are active and the three switches near the serial connector are inactive, or the other way around.  Essentially you can choose to control the board via software or manually using the orange-outlined switches.  For debugging, you may wish to use the switches without a USB connection to confirm your understanding of the circuit operation.

    4. 5V power supply is good for the board, this is what I use in the lab.  There is no issue with your supply configuration.

    Best,

    Alec

  • I tried attaching a 50-ohm termination to the IN- and OUT- ports. That did not fix the problem; I am seeing the exact same measurements as I did before.

    I also tried changing the min attenuation level to -11.5 dB. That did not fix the problem. 

    I'm going to email you the code I'm using because it's big pain to insert it on this forum. What's your email address?

  • Hello Joshua,

    I have sent you a message with my email.  Agreed on inserting code onto the forum, it can be a long process.

    Best,

    Alec

  • I still can't locate your email address. Would you be able to provide it in a message in this forum?

  • Hello Joshua,

    You should now have a message from me.

    Best,

    Alec

  • Hello Alec, I want to let you know what output I see when I run the attenuator code as demonstrated in the email I sent you and verify if it's correct. 

    In this case, I set minGain and maxGain to -11.5 and 20. When I then call myPGA.set_gain(-11.5), I observer that the total attenuation of the attenuator drops to -31.5 dB. 

    If I then call myPGA.set_gain(20), the total atenuation measured on the Spectrum Analyzer is 0 dB.

    If I re-run this experiment, but change minGain to -5 dB, then myPGA.set_gain(-5) causes the total attenuation to decrease to -31.5 dB. Basically, if I try to set the attenuation to the same values as minGain by calling myPGA.set_gain(minGain), the total attenuation always drops to -31.5 assuming that minGain is in the range of -11.5 to 20 dB.

    Please confirm if this is the output that I should expect to see. I specifically want to know if I should expect to see the attenuation level of -31.5 dB that I'm measuring in these scenarios. Thank you!

  • Hello Joshua,

    Thank you for sharing the details of your results and various conditions.  I will take a look in-lab and see what values I observe on our equipment.  It may take me a day or so to do this, depending on access to lab equipment.

    Best,

    Alec

  • Hello Joshua,

    I have had issues attempting to just run the MATLAB code you are using.  I usually run the code as a portion of a larger setup, which is in multiple pieces currently.

    Have you had debugging progress or any additional questions since the holiday?

    You can run the EVM offline from the GUI, using the bank of switches I referred to above.  This may simplify debugging to eliminate if there is a hardware issue or a software control issue.

    Best,

    Alec

  • Hello Alec,

    A few weeks ago, I reported that I was measuring a total attenuation for the PGA attenuator of -31.5 dB to 0 dB.

    Last night, I measured the attenuation levels of the PGA attenuator again, and used the exact same test setup that I had a few weeks ago. But for some reason, the attenuation level that I measured was 17.5 dB lower than what I measured a few weeks ago. Now I'm measuring  total attenuation of -49.5 dB to -18 dB.

    Can you think of any reason why the actual attenuation levels I'm measuring would vary from one week to the next? I hope it isn't due to any kind of inadvertent hardware damage. We have been using this attenuator in an ESD-controlled lab and taking the appropriate ESD precautions (wrist strap, ESD jacket, grounded matt on the bench).

    I am using the PGA attenuator with single-ended inputs and outputs, not differential. I'm not sure if this could be a reason why the attenuation levels I measure are fluctuating.

    Also, I checked my test setup repeatedly, and I did not see any differences from a few weeks ago when I measured lower attenuation levels. I tried varying the attenuation in 5 dB increments, and the attenuation level that I measure changes in 5 dB increments with reasonable accuracy and precision. My measurements are provided below.

    Signal Generator Input Power: -5 dBm          
             
    Components in Test Setup: Signal Generator Input RF Cable PGA870EVM Attenuator Output RF Cable Spectrum Analyzer
               
    Attenuation Gain Setpoint (Value Passed into set_gain Function) Output Power Measured on Spectrum Analyzer (dBm)        
    -10 -53.4 dBm        
    -5 -48.3 dBm        
    0 -43.3 dBm        
    5 -38.4 dBm        
    10 -33.4 dBm        
    15 -28.5 dBm        
    20 -23.6 dBm      
  • Hello Joshua,

    Thank you for providing an update.

    I have a couple of ideas.  It could be the measurement method or equipment settings may have changed; similarly a flip of a switch on the PGA870EVM itself would shift results.

    It is also possible if the EVM was left powered-on that a transient event or some form of damage could occur.  It is more likely however that the attenuation is being affected by measurement, the EVM settings, or a cable/connection issue.

    The increased attenuation range may be due to an additional contributor to attenuation in your measurement system.  The original measured attenuation of -31.5 is what is expected for the PGA870 device.

    Best,

    Alec

  • Hello Alec,

    Thank you for your response

    So is that the case that the PGA870EVM has an expected gain of -31.5 dB to 0 dB? Does this mean that if you input a -20 dBm RF signal into the IN+ port of the PGA870EVM, you can expect the RF signal at the OUT+ port of the PGA870EVM to have an RF power varying from (-20 - 31.5 = -51.5 dBm) to (-20 - 0  = -20 dBm) depending on the PGA's configuration? The User Guide is very confusing because it seems to state that the PGA870EVM can achieve a total gain between OUT+ and IN+ of -11.5 dB to +20 dB.

    We tried using a different Spectrum Analyzer and got the same results, so it is not a measurement issue on the Spectrum Analyzer's end. We also checked the input and output cables and verified that they are not contributing to any significant loss. The PGA jumpers and switches are configured the exact same as a few weeks ago when we recorded the correct attenuation levels.

    We have been led to worry about the possibility that our PGA board is damaged. I'm not aware of any incidents that occurred between now and the last time we measured the PGA870EVM's performance that could have damaged the board. And I've been powering the board on only when I'm actively using it, and powering it off when I'm done working. I do wonder if an ESD or overcurrent event that happened a couple of months ago could have initiated a gradual decline in performance, which started off slow but accelerated in the past week?