I am having some issues with AGC mode on the ADRV9008-1. In particular it is with the operation of the gain index. Using the evaluation board, another engineer able to test AGC mode and see it operate according to UG1295. However, in our in-house design board I see the gain index moving in the reversed direction.
I have a gain table with 52 entries, index 255 down to 204. I first tried with the maximum gain value in index 255 as specified in the user guide. I tried moving the input level on a CW signal and reading back the current gain index. What I saw was that when I raised the CW level to our board to -15dBm, the index would jump up to 255. If I then lowered the input level to -60dBm, the gain index jumped down to 204. I was moving the input level 5dB at a time. The gain index did not move until I got up to -15dBm or down to -60dBm.
Next I tried reversing the gain table, maximum gain at index 204. With this I saw a desired response type. I could see the gain index moving in steps in the range between -40dBm and -20dBm. At -20dBm the gain index would be around 251. At -40dBm the gain index would be around 207. I would see the gain index move to be somewhere in the middle as I moved the CW input between those ranges. I took captures to confirm. I got -59.979dBFS for the -40dBm input. For the -20dBm input, I got -60.498dBFS. That is what I expected to see from the AGC operation.
Is there anything that we could be doing that could cause this? Could it be our configuration? Could it be caused by the HW design of the PCB?
Our SW tool uses a file to read in the values for the structs used by the APIs. The following is the configuration I was using when running this testing.
#TalInit
#TalInit SPI Settings
talInit.spiSettings.MSBFirst=1
talInit.spiSettings.enSpiStreaming=0
talInit.spiSettings.autoIncAddrUp=1
talInit.spiSettings.fourWireMode=0
talInit.spiSettings.cmosPadDrvStrength=TAL_CMOSPAD_DRV_2X
#Rx settings
talInit.rx.rxProfile.rxFir.gain_dB=-6
talInit.rx.rxProfile.rxFir.numFirCoefs=48
talInit.rx.rxProfile.rxFir.coefs={-2, 23, 46, -17, -104, 10, 208, 23, -370, -97, 607, 240, -942, -489, 1407,910, -2065, -1637, 3058, 2995, -4912, -6526, 9941, 30489, 30489, 9941, -6526,-4912, 2995, 3058, -1637, -2065, 910, 1407, -489, -942, 240, 607, -97, -370,23, 208, 10, -104, -17, 46, 23, -2}
talInit.rx.rxProfile.rxFirDecimation=2
talInit.rx.rxProfile.rxDec5Decimation=4
talInit.rx.rxProfile.rhb1Decimation=1
talInit.rx.rxProfile.rxOutputRate_kHz=245760
talInit.rx.rxProfile.rfBandwidth_Hz=200000000
talInit.rx.rxProfile.rxBbf3dBCorner_kHz=200000
talInit.rx.rxProfile.rxAdcProfile={182, 142, 173, 90, 1280, 982, 1335, 96, 1369, 48, 1012, 18, 48, 48, 37, 208, 0, 0, 0, 0, 52, 0, 7, 6, 42, 0, 7, 6, 42, 0, 25, 27, 0, 0, 25, 27, 0, 0, 165, 44, 31, 905}
talInit.rx.rxProfile.rxDdcMode=TAL_RXDDC_BYPASS
talInit.rx.rxProfile.rxNcoShifterCfg.bandAInputBandWidth_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandAInputCenterFreq_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandANco1Freq_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandANco2Freq_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandBInputBandWidth_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandBInputCenterFreq_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandBNco1Freq_kHz=0
talInit.rx.rxProfile.rxNcoShifterCfg.bandBNco2Freq_kHz=0
talInit.rx.framerSel=TAL_FRAMER_A
talInit.rx.rxGainCtrl.gainMode=TAL_AGCSLOW
talInit.rx.rxGainCtrl.rx1GainIndex=255
talInit.rx.rxGainCtrl.rx2GainIndex=255
talInit.rx.rxGainCtrl.rx1MaxGainIndex=255
talInit.rx.rxGainCtrl.rx1MinGainIndex=204
talInit.rx.rxGainCtrl.rx2MaxGainIndex=255
talInit.rx.rxGainCtrl.rx2MinGainIndex=204
talInit.rx.rxChannels=TAL_RX2
#Clock Settings
talInit.clocks.deviceClock_kHz=122880
talInit.clocks.clkPllVcoFreq_kHz=9830400
talInit.clocks.clkPllHsDiv=TAL_HSDIV_2P5
talInit.clocks.rfPllUseExternalLo=0
talInit.clocks.rfPllPhaseSyncMode=TAL_RFPLLMCS_NOSYNC
#JESD204B settings
#FramerA Settings
talInit.jesd204Settings.framerA.bankId=0
talInit.jesd204Settings.framerA.deviceId=0
talInit.jesd204Settings.framerA.lane0Id=0
talInit.jesd204Settings.framerA.M=2
talInit.jesd204Settings.framerA.K=32
talInit.jesd204Settings.framerA.F=4
talInit.jesd204Settings.framerA.Np=16
talInit.jesd204Settings.framerA.scramble=1
talInit.jesd204Settings.framerA.externalSysref=1
talInit.jesd204Settings.framerA.serializerLanesEnabled=0x01
talInit.jesd204Settings.framerA.serializerLaneCrossbar=0xE4
talInit.jesd204Settings.framerA.lmfcOffset=31
talInit.jesd204Settings.framerA.newSysrefOnRelink=0
talInit.jesd204Settings.framerA.syncbInSelect=0
talInit.jesd204Settings.framerA.overSample=0
talInit.jesd204Settings.framerA.syncbInLvdsMode=1
talInit.jesd204Settings.framerA.syncbInLvdsPnInvert=0
talInit.jesd204Settings.framerA.enableManualLaneXbar=0
#FramerB Settings
talInit.jesd204Settings.framerB.bankId=0
talInit.jesd204Settings.framerB.deviceId=0
talInit.jesd204Settings.framerB.lane0Id=0
talInit.jesd204Settings.framerB.M=2
talInit.jesd204Settings.framerB.K=32
talInit.jesd204Settings.framerB.F=0
talInit.jesd204Settings.framerB.Np=16
talInit.jesd204Settings.framerB.scramble=0
talInit.jesd204Settings.framerB.externalSysref=1
talInit.jesd204Settings.framerB.serializerLanesEnabled=0x0C
talInit.jesd204Settings.framerB.serializerLaneCrossbar=0xE4
talInit.jesd204Settings.framerB.lmfcOffset=31
talInit.jesd204Settings.framerB.newSysrefOnRelink=0
talInit.jesd204Settings.framerB.syncbInSelect=1
talInit.jesd204Settings.framerB.overSample=0
talInit.jesd204Settings.framerB.syncbInLvdsMode=1
talInit.jesd204Settings.framerB.syncbInLvdsPnInvert=0
talInit.jesd204Settings.framerB.enableManualLaneXbar=0
#Deframer A settings
talInit.jesd204Settings.deframerA.bankId=0
talInit.jesd204Settings.deframerA.deviceId=0
talInit.jesd204Settings.deframerA.lane0Id=0
talInit.jesd204Settings.deframerA.M=0
talInit.jesd204Settings.deframerA.K=32
talInit.jesd204Settings.deframerA.Np=16
talInit.jesd204Settings.deframerA.scramble=1
talInit.jesd204Settings.deframerA.externalSysref=1
talInit.jesd204Settings.deframerA.deserializerLanesEnabled=0
talInit.jesd204Settings.deframerA.deserializerLaneCrossbar=0xE4
talInit.jesd204Settings.deframerA.lmfcOffset=0
talInit.jesd204Settings.deframerA.newSysrefOnRelink=0
talInit.jesd204Settings.deframerA.syncbOutSelect=1
talInit.jesd204Settings.deframerA.syncbOutLvdsMode=1
talInit.jesd204Settings.deframerA.syncbOutLvdsPnInvert=0
talInit.jesd204Settings.deframerA.syncbOutCmosSlewRate=0
talInit.jesd204Settings.deframerA.syncbOutCmosDriveLevel=0
talInit.jesd204Settings.deframerA.enableManualLaneXbar=0
# Deframer B settings
talInit.jesd204Settings.deframerB.bankId=0
talInit.jesd204Settings.deframerB.deviceId=0
talInit.jesd204Settings.deframerB.lane0Id=0
talInit.jesd204Settings.deframerB.M=4
talInit.jesd204Settings.deframerB.K=32
talInit.jesd204Settings.deframerB.Np=16
talInit.jesd204Settings.deframerB.scramble=1
talInit.jesd204Settings.deframerB.externalSysref=1
talInit.jesd204Settings.deframerB.deserializerLanesEnabled=0x0F
talInit.jesd204Settings.deframerB.deserializerLaneCrossbar=0xE4
talInit.jesd204Settings.deframerB.lmfcOffset=0
talInit.jesd204Settings.deframerB.newSysrefOnRelink=0
talInit.jesd204Settings.deframerB.syncbOutSelect=0
talInit.jesd204Settings.deframerB.syncbOutLvdsMode=1
talInit.jesd204Settings.deframerB.syncbOutLvdsPnInvert=0
talInit.jesd204Settings.deframerB.syncbOutCmosSlewRate=0
talInit.jesd204Settings.deframerB.syncbOutCmosDriveLevel=0
talInit.jesd204Settings.deframerB.enableManualLaneXbar=0
#SER Amplitude
talInit.jesd204Settings.serAmplitude=15
talInit.jesd204Settings.serPreEmphasis=1
talInit.jesd204Settings.serInvertLanePolarity=0
talInit.jesd204Settings.desInvertLanePolarity=0
talInit.jesd204Settings.desEqSetting=1
talInit.jesd204Settings.sysrefLvdsMode=1
talInit.jesd204Settings.sysrefLvdsPnInvert=0
#AGC Config
talAGCConfig.agcPeakWaitTime=2
talAGCConfig.agcRx1MaxGainIndex=255
talAGCConfig.agcRx1MinGainIndex=204
talAGCConfig.agcRx2MaxGainIndex=255
talAGCConfig.agcRx2MinGainIndex=204
talAGCConfig.agcGainUpdateCounter_us=500
talAGCConfig.agcRx1AttackDelay=0
talAGCConfig.agcRx2AttackDelay=0
talAGCConfig.agcSlowLoopSettlingDelay=16
talAGCConfig.agcLowThreshPreventGain=0
talAGCConfig.agcChangeGainIfThreshHigh=0
talAGCConfig.agcPeakThreshGainControlMode=0
talAGCConfig.agcResetOnRxon=0
talAGCConfig.agcEnableSyncPulseForGainCounter=0
talAGCConfig.agcEnableIp3OptimizationThresh=0
talAGCConfig.ip3OverRangeThresh=0
talAGCConfig.ip3OverRangeThreshIndex=0
talAGCConfig.ip3PeakExceededCnt=0
talAGCConfig.agcEnableFastRecoveryLoop=0
#AGC Power Config
talAGCConfig.agcPower.powerEnableMeasurement=1
talAGCConfig.agcPower.powerUseRfirOut=1
talAGCConfig.agcPower.powerUseBBDC2=0
talAGCConfig.agcPower.underRangeHighPowerThresh=15
talAGCConfig.agcPower.underRangeLowPowerThresh=2
talAGCConfig.agcPower.underRangeHighPowerGainStepRecovery=2
talAGCConfig.agcPower.underRangeLowPowerGainStepRecovery=4
talAGCConfig.agcPower.powerMeasurementDuration=5
talAGCConfig.agcPower.rx1TddPowerMeasDuration=5
talAGCConfig.agcPower.rx1TddPowerMeasDelay=1
talAGCConfig.agcPower.rx2TddPowerMeasDuration=5
talAGCConfig.agcPower.rx2TddPowerMeasDelay=1
talAGCConfig.agcPower.upper0PowerThresh=10
talAGCConfig.agcPower.upper1PowerThresh=2
talAGCConfig.agcPower.powerLogShift=1
talAGCConfig.agcPower.overRangeLowPowerGainStepAttack=2
talAGCConfig.agcPower.overRangeHighPowerGainStepAttack=4
#AGC Peak Config
talAGCConfig.agcPeak.agcUnderRangeLowInterval_ns=4000
talAGCConfig.agcPeak.agcUnderRangeMidInterval=2
talAGCConfig.agcPeak.agcUnderRangeHighInterval=4
talAGCConfig.agcPeak.apdHighThresh=37
talAGCConfig.agcPeak.apdLowGainModeHighThresh=40
talAGCConfig.agcPeak.apdLowThresh=26
talAGCConfig.agcPeak.apdLowGainModeLowThresh=29
talAGCConfig.agcPeak.apdUpperThreshPeakExceededCnt=6
talAGCConfig.agcPeak.apdLowerThreshPeakExceededCnt=3
talAGCConfig.agcPeak.apdGainStepAttack=4
talAGCConfig.agcPeak.apdGainStepRecovery=2
talAGCConfig.agcPeak.enableHb2Overload=1
talAGCConfig.agcPeak.hb2OverloadDurationCnt=1
talAGCConfig.agcPeak.hb2OverloadThreshCnt=1
talAGCConfig.agcPeak.hb2HighThresh=203
talAGCConfig.agcPeak.hb2UnderRangeLowThresh=80
talAGCConfig.agcPeak.hb2UnderRangeMidThresh=100
talAGCConfig.agcPeak.hb2UnderRangeHighThresh=128
talAGCConfig.agcPeak.hb2UpperThreshPeakExceededCnt=6
talAGCConfig.agcPeak.hb2LowerThreshPeakExceededCnt=3
talAGCConfig.agcPeak.hb2GainStepHighRecovery=2
talAGCConfig.agcPeak.hb2GainStepLowRecovery=4
talAGCConfig.agcPeak.hb2GainStepMidRecovery=8
talAGCConfig.agcPeak.hb2GainStepAttack=4
talAGCConfig.agcPeak.hb2OverloadPowerMode=0
talAGCConfig.agcPeak.hb2OvrgSel=0
talAGCConfig.agcPeak.hb2ThreshConfig=3
talAGCConfig.agcPeak.hb2UnderRangeLowThreshExceededCnt=6
talAGCConfig.agcPeak.hb2UnderRangeMidThreshExceededCnt=3
#LO Frequency
talInit.LOFreqInHz=1850000000
talInit.GainMode=TAL_AGCSLOW
talInit.defGainIndex=255