This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE7903: LNA Bypass Gain / ALC LNA Gain Compensation Issue

Part Number: AFE7903


Hi, we have a few issues with the AFE7903 regarding LNA Bypass,ALC and Floatmode

Issue 1: The ALC does not compensate lna gain when bypass is enabled. This leads to a signal level jump when lna is bypassed.

Is the ALC able to completly compensate the lna gain when bypassed such that the rx gain stays constant?

Issue 2: The AGC behavioral with lna bypass is counter intuitive and the lnagain0 does not have any influence on the release time.
The expected behavior of the AGC when the LNA is bypassed is to reduce the DSA attenuation to a point near the decay threshold. We can achieve this by setting lnaGainMargin to a value of lnagain - margin in our case 27-4 dB.
The formula in the data sheets "current_dsa_gain < lnagain - lnagainmargin" seems to be wrong.

What would be the correct way to achieve this behaviour?

Attached are two documents.
The first "agc_only_measurement" shows six figures of a spectrum analyzer in zero span mode and the afe configured with an integer jesd interface and only agc activated. The general latte parameters are given below.

We performed six level jumps from -inf to the specified value in the figure reference. The AGC increases the DSA attenuation to bring the level below the attack threshold of -10 dBm.
With a high enough jump to -15 dBm input power (the lna gain is 27 dB) the agc bypasses the lna (see figure 4) and reduces the DSA attenuation in the next eight release phases until the decay threshold of -20 dBm is reached. ( Figure 4,5,6)

This results in a steady state gain difference of 10 dB.


When we turn on the ALC as well and repeat the measurements from before, we would expect a 10 dB level jump above an input power of -15 dB of 10 dB.

With regards to the attachment "alc_measurement_report" we see the correct output level in figures 1-2. In figures 3 - 5 the expected output power is -25 dBm and -10 dBm, and we measure -43 dBm and -27 dBm. This jump corresponds to the lna gain and not the margin difference. Thus we conclude that the ALC infact does not apply the lnagain to the signal when the lna is bypassed.


Can you help us here?
Our goal is to have a constant rx gain!

Latte Configuration
if enableAGC:
for i in range(4):
## Internal AGC mode
#### RXA/B config
sysParams.agcParams[i].agcMode = 1 # Internal AGC mode
sysParams.agcParams[i].rfdeten = 0 # RF analog detector is enabled.
sysParams.agcParams[i].atken = [1,1,0] # attack peak detector is enabled with big step.
sysParams.agcParams[i].decayen = [1,1,0] # decay power detector is enabled.
sysParams.agcParams[i].atkthreshold = [-8,-10,-25] # This value is the applied threshold of attack detector
sysParams.agcParams[i].decaythreshold = [-14-8,-12-8,-28] # This value is the applied threshold of decay detector
sysParams.agcParams[i].atkwinlength = [60000,40000000] # Attack detector Time Constant in absolute time in ns. Max is 40ms
sysParams.agcParams[i].decaywinlength = 40000000 # Decay detector Time Constant in absolute time in ns. Max is 40ms
#sysParams.agcParams[i].atkNumHitsAbs = [200,200] # Absolute Number of times signal crosses threshold.
#sysParams.agcParams[i].deacyNumHitsAbs = [200,200] # Absolute Number of times signal crosses threshold.
sysParams.agcParams[i].atkNumHitsRel = [75,2]
sysParams.agcParams[i].decayNumHitsRel = [90,80]
sysParams.agcParams[i].custRfMode = 1 # Use RF analog detector as very big step attack in internal AGC.
sysParams.agcParams[i].atksize = [6,1] # Whenever detector triggers the DSA change 0.5dB* value, i.e.big step 2dB, small step& power detector 0.5 dB
sysParams.agcParams[i].decaysize = [4,1] # Whenever detector triggers the DSA change 0.5dB* value, i.e. big step 2 dB, small step& power detector 0.5 dB
sysParams.agcParams[i].minDsaAttn = 0 # Minimum DSA attenuation used by AGC, 0.5dB* value
sysParams.agcParams[i].maxDsaAttn = 50 # Maximal DSA attenuation used by AGC, 0.5dB* value
sysParams.agcParams[i].totalGainRange = 52 # Total gain range used by ALC for gain compensation, 1dB * value. 64 dB is maximal. Rounded internaly to multiples of 2 -> n*6.02dB
# LNA + max DSA => 52 dB -> rounded to 54.182 dB. This is the digital ADC gain.
sysParams.agcParams[i].rfdetnumhits = 10 # Absolute Number of times signal crosses threshold.
sysParams.agcParams[i].rfdetstepsize = 50 # Whenever RF detector triggers the DSA change 0.5dB* value, i.e.25 dB.
sysParams.agcParams[i].rfdetThreshold = -4 #or 3?

# # external LNA control
sysParams.agcParams[i].lnaEn = True # Enternal RXA LNA control
sysParams.agcParams[i].extLnaTempModel = 0 # Use a temperature model for the lna gain
sysParams.agcParams[i].singleDualBandMode = 0 # RXA is single band
sysParams.agcParams[i].lnagain0 = 27 # The gain of external RXA LNA for AGC to compensate, the resolution is 0.03125 dB 864 or 27.0?
sysParams.agcParams[i].lnaphase0 = 0 # The phase of external RXA LNA for AGC to compensate in Band0
sysParams.agcParams[i].lnaGainMargin = 46 # hysteresis value when to turn on lna [0.5 dB per unit]
sysParams.agcParams[i].blank_time_extcomp = 2550 # number of clocks of FadcRx/8 max 65535

if enableALC:
for i in range(4):
# ALC and floating point mode
sysParams.agcParams[i].alcEn = True # RXA ALC enabled
sysParams.agcParams[i].alcMode = 0 # RXA Floating point mode 0 float
sysParams.agcParams[i].fltPtMode = 1 # RXA Always send MSB of mantissa in floating point mode
sysParams.agcParams[i].fltPtFmt = 2 # RXA 4 bit exponent, 11 bit mantissa and 1 bit sign

/cfs-file/__key/communityserver-discussions-components-files/220/agc_5F00_only_5F00_measurement_5F00_report.pdf

/cfs-file/__key/communityserver-discussions-components-files/220/alc_5F00_measurement_5F00_report.pdf

  • Hi Christian, Matthias,

    As we had discussed in today's meeting, I'll focus on prioritizing this issue. I'll try to reproduce this issue on my setup in Dallas, hopefully I will have some updates to share next week.

    Thanks,

    Aman

  • Hi Matthias,

    Following up from our meeting this morning.

    Below are the plots I shared this morning, showing this "jumping" behavior in our captured power when ALC is turned on with your AGC/ALC settings. I performed this experiment by sweeping my signal generator power up and observing both the current RX DSA setting (red line) and the power of our capture (blue line). The AGC only data makes sense to me, where the captured power is being kept between -10 and -20 dBFS by our internal AGC DSA. The ALC enabled data shows some odd behavior where the capture power only seems to drop in steps of around 6 dB. Please check to see if you can replicate these results on your board.

    We'll take a look through the AGC/ALC/LNA settings Christian had shared above to see if we can figure out why this is happening when ALC is enabled. 

    I'll also keep digging in to the original issue you shared in your data; I believe there may be some DGC delay parameters we can tune that may be responsible for the delay we see in the ALC. 

    AGC only (enableAlc = False)

    ALC enabled

    Thanks,

    Aman

  • Hi Matthias,

    I did some more testing and found that this jumping behavior I found last time was due to me using the coarse-fine ALC mode on my setup so that I could read power levels - the 6 dB jumps are because of the 6 dB coarse step used by the coarse-fine ALC mode. I don't expect you to see this on your end, and this doesn't actually look like it's an issue.

    I now have a way of reading my power levels when using floating point mode, so I've switched to that and am running some more experiments, but I have yet to be able to reproduce the issue you see. I'm still looking into the DGC delay I mentioned in my post above.

    Thanks,

    Aman

  • Hi Matthias,

    I have one open question on the DGC delay registers with the software team that I'm waiting for a response on before sharing - sorry for the delay on this. I'll send these registers and some modified AGC parameters to you via email by the end of the week.

    Thanks,

    Aman

  • Hi Matthias,

    I've done some more playing around with AGC parameters and I still cannot reproduce this issue where ALC is not compensating for the LNA bypass. Would it be possible for you to run some experiments on your setup with some new AGC/LNA parameters to see if you still see this issue?

    One thing I noticed in your AGC parameters is the LNA gain margin - setting this to 46 will mean that the LNA will stop being bypassed when the DSA setting = 2 dB, 23 dB (46/2) under the max DSA attenuation of 25. From what I understand in Christian's post above,  I believe your intent was to set this such that the LNA will stop being bypassed at 23 dB DSA, 2 dB below the max DSA attenuation of 25 dB. To get this behavior, I have changed the LNA gain margin = 4.

    I have also changed some of the other parameters to be standard values, so we can further isolate this issue.

    Could you please try the following AGC parameters?

    ##############		AGC			##############
    for i in range(4):
    	## Internal AGC mode
    	#### RXA/B config
    	sysParams.agcParams[i].agcMode = 1 												# Internal AGC mode
    	sysParams.agcParams[i].rfdeten = 0 												# RF analog detector is enabled.
    	sysParams.agcParams[i].atken = [0,1,0] 											# attack peak detector is enabled with big step. # big step, small step, pow det
    	sysParams.agcParams[i].decayen = [0,1,0] 										# decay power detector is enabled. # big step, small step, pow det
    	
    	sysParams.agcParams[i].atkthreshold = [-8,-10,-14] 								# This value is the applied threshold of attack detector # big step=-8, small step=-10, pow det
    	sysParams.agcParams[i].decaythreshold = [-22,-20,-20] 							# This value is the applied threshold of decay detector # big step=-22, small step=-20, pow det
    	
    	sysParams.agcParams[i].atkwinlength = [170,170] 								# Attack detector Time Constant in absolute time in ns. Max is 40ms
    	sysParams.agcParams[i].decaywinlength = 87380 									# Decay detector Time Constant in absolute time in ns. Max is 40ms
    	sysParams.agcParams[i].atkNumHitsAbs = [8,8]									# Absolute Number of times signal crosses threshold.
    	sysParams.agcParams[i].decayNumHitsAbs = [8,8]									# Absolute Number of times signal crosses threshold.
    	
    	sysParams.agcParams[i].custRfMode = 1 											# Use RF analog detector as very big step attack in internal AGC.
    	sysParams.agcParams[i].atksize = [6,2]											# Whenever detector triggers the DSA change 0.5dB* value
    	sysParams.agcParams[i].decaysize = [6,2] 										# Whenever detector triggers the DSA change 0.5dB* value
    	sysParams.agcParams[i].minDsaAttn = 0 											# Minimum DSA attenuation used by AGC, 0.5dB* value
    	sysParams.agcParams[i].maxDsaAttn = 50 # 60 # 23								# Maximal DSA attenuation used by AGC, 0.5dB* value
    	sysParams.agcParams[i].totalGainRange = 52 # 57 # 50							# Total gain range used by ALC for gain compensation
    	
    	sysParams.agcParams[i].rfdetnumhits = 8 										# Absolute Number of times signal crosses threshold.
    	sysParams.agcParams[i].rfdetstepsize = 8 										# Whenever RF detector triggers the DSA change 0.5dB* value, i.e.25 dB.
    	
    	# # external LNA control
    	sysParams.agcParams[i].lnaEn = True 											# Enternal RXA LNA control
    	sysParams.agcParams[i].extLnaTempModel = 0										# Use a temperature model for the lna gain
    	sysParams.agcParams[i].singleDualBandMode = 0 									# RXA is single band
    	sysParams.agcParams[i].lnagain0 = 27 										    # The gain of external RXA LNA for AGC to compensate, the resolution is 0.03125 dB 864 or 27.0?
    	sysParams.agcParams[i].lnaphase0 = 0 											# The phase of external RXA LNA for AGC to compensate in Band0
    	sysParams.agcParams[i].lnaGainMargin = 4 								        # hysteresis value when to turn on lna
    	sysParams.agcParams[i].blank_time_extcomp = 255 								# number of clocks of FadcRx/8 max 65535
    
    for i in range(4):
    	# ALC and floating point mode
    	sysParams.agcParams[i].alcEn = 1 												# RXA ALC enabled
    	sysParams.agcParams[i].alcMode = 0 												# RXA Floating point mode 0 float
    	sysParams.agcParams[i].fltPtMode = 1 											# RXA Always send MSB of mantissa in floating point mode
    	sysParams.agcParams[i].fltPtFmt = 2 											# RXA 4 bit exponent, 11 bit mantissa and 1 bit sign

    If you still are seeing the same issues, is it possible for you to experiment with the following two changes?

    1. Set maxDsaAttn = 60 and totalGainRange = 57
    2. Set maxDsaAttn = 23 and totalGainRange = 50

    Please let me know if these new AGC settings show any different behavior, and let me know if changing these AGC parameters is not possible or very difficult on your end and we can think of something else.

    Thanks!

    Aman