APD Upper Threshold GPIO Monitor

I am trying to monitor a particular GPIO output on the AD9371 as shown here: https://ez.analog.com/wide-band-rf-transceivers/tes-gui-and-api-software-ad9371-ad9375/f/q-a/110977/rf-overload-gpio

My problem is that even when I see the input signal go into saturation, I do not see the bit go high. I have verified that my GPIO monitor set up is valid by looking at index 0x09 and verifying that I can read the RX1 gain table index out from the GPIO pins.

The only code that I have added/modified from the headless.c example is as follows:

1. I manually set the auxIo->gpio->gpioOe field to 0x000000FF right before calling MYKONOS_setupGpio() since this field appears to be zeroed out during various initialization calls.

2. I call MYKONOS_setGpioMonitorOut() with an index of 0x02 and a mask of 0xFF (I was testing to see if any bits in index 0x02 went high) right after calling MYKONOS_setupGpio().

3. In the example code, it sets various manual gains for RX. Instead during this time, I call MYKONOS_setRxGainControlMode() and set up the RX chain to use AGC. This happens between the GPIO set up and the initial calibrations. Note that I have previously verified that AGC appears to be working, because if I scale up my input level, the output shown in various plots does not appear to change until we hit saturation.

4. I run a large set of initial calibrations. The mask is as follows:

  static const uint32_t kInitCals =
    TX_BB_FILTER |
    ADC_TUNER |
    TIA_3DB_CORNER |
    DC_OFFSET |
    TX_ATTENUATION_DELAY |
    RX_GAIN_DELAY |
    FLASH_CAL |
    PATH_DELAY |
    TX_LO_LEAKAGE_INTERNAL |
    TX_QEC_INIT |
    LOOPBACK_RX_LO_DELAY |
    LOOPBACK_RX_RX_QEC_INIT |
    RX_LO_DELAY |
    RX_QEC_INIT;

Also, it should be noted that I bring up TX1, TX2, RX1, and RX2 for this particular application.

As a result of the fact that I get the correct gain index output on the GPIOs, but the overload bit is not working as expected, I am wondering if the problem is with my AGC setup. Below are all the relevant RX AGC structures. Note that we are using peak mode, so I would expect the APD upper threshold bit to go high during RF overload.

static mykonosPeakDetAgcCfg_t rxPeakAgc = {
  0x26,  // apdHighThresh
  0x16,  // apdLowThresh
  0xB5,  // hb2HighThresh
  0x72,  // hb2LowThresh
  0x40,  // hb2VeryLowThresh
  0x06,  // apdHighThreshExceededCnt
  0x04,  // apdLowThreshExceededCnt
  0x06,  // hb2HighThreshExceededCnt
  0x04,  // hb2LowThreshExceededCnt
  0x04,  // hb2VeryLowThreshExceededCnt
  0x4,   // apdHighGainStepAttack
  0x2,   // apdLowGainStepRecovery
  0x4,   // hb2HighGainStepAttack
  0x2,   // hb2LowGainStepRecovery
  0x4,   // hb2VeryLowGainStepRecovery
  0x1,   // apdFastAttack
  0x1,   // hb2FastAttack
  0x1,   // hb2OverloadDetectEnable
  0x1,   // hb2OverloadDurationCnt
  0x1    // b2OverloadThreshCnt
};

static mykonosPowerMeasAgcCfg_t rxPwrAgc = {
  0x01,  // pmdUpperHighThresh
  0x03,  // pmdUpperLowThresh
  0x0C,  // pmdLowerHighThresh
  0x04,  // pmdLowerLowThresh
  0x4,   // pmdUpperHighGainStepAttack
  0x2,   // pmdUpperLowGainStepAttack
  0x2,   // pmdLowerHighGainStepRecovery
  0x4,   // pmdLowerLowGainStepRecovery
  0x08,  // pmdMeasDuration
  0x02   // pmdMeasConfig
};

static mykonosAgcCfg_t rxAgcConfig = {
  255,    // agcRx1MaxGainIndex
  195,    // agcRx1MinGainIndex
  255,    // agcRx2MaxGainIndex
  195,    // agcRx2MinGainIndex
  255,    // agcObsRxMaxGainIndex
  203,    // agcObsRxMinGainIndex
  1,      // agcObsRxSelect
  1,      // agcPeakThresholdMode
  1,      // agcLowThsPreventGainIncrease
  30720,  // agcGainUpdateCounter
  3,      // agcSlowLoopSettlingDelay
  4,      // agcPeakWaitTime
  1,      // agcResetOnRxEnable
  0,      // agcEnableSyncPulseForGainCounter
  &rxPeakAgc,
  &rxPwrAgc
};

Finally, it should be noted that the one time I noticed the bit going high (but it only toggles momentarily) is if I input a signal that would saturate the frontend BEFORE running my application. In this instance, during the initial calibrations, I see the bit toggle twice, but it stays low after calibration.

Any help would be greatly appreciated since I think I am setting up the GPIO monitor correctly, it just doesn't seem like the device is outputting the bit when I would expect it to.