Post Go back to editing

AD7124-8: REF_DET_ERR is always reported even though the measured reference is above 0.7V.

Category: Software
Product Number: AD7124-8

Hello all, I am using the AD7124-8 and i am trying to incorporate some wire break detection using the reference detect diagnostic. I am using continuous mode and I can get good data to return from the adc conversion. However, immediately after the conversion I check the REF_DET_BIT in the error register. If it is set, i send a wire break error in the code. Only if i clear the error register by reading it before the conversion will it say the reference is good. I constantly measure the REFIN1(+) and REFIN1(-) during this process and it always stays above 0.7 V yet the REF_DET_ERR is always set no matter how many times I clear it. Has anyone had this issue before?

Best Regards,

Landen

Edit Notes

added product to title
[edited by: JEstayo at 10:58 AM (GMT -5) on 16 Dec 2024]
  • Hi  ,

    Can you confirm if the device exits of standby mode when you are checking the REF_DET_ERR bit? The reference detect flag may be set when the device exits of standby mode. Therefore, you need to read the error register after exiting standby mode to reset the flag to 0. This flag also indicates when the external reference being used by the ADC is open circuit or less than 0.7 V.

    Thanks and regards, 

    Rod 

  • Hello  , I am in continuous conversion mode now so the device shouldn't enter standby mode, correct? Now that you mention the external reference, though, i am unsure if I have the external reference connected to the circuit. I can check and let you know because that could the reason. This issue is more of a convenience thing. I can read the error register each cycle to clear it anyway and still get good data. I just was curious about why it continuously reports a ref_det_err when my reference is connected.  

  • To clarify, I am actually using the external reference REFIN1(+) and REFIN1(-). This is the reference i measured a continuous voltage above 0.7 V. 

  • Hi  ,

    Yes, you are correct, the device shouldn't enter standby mode when in continuous conversion.  

    Is the REF_DET_ERR_EN the only thing enabled on the Error enable register? 

    However, immediately after the conversion I check the REF_DET_BIT in the error register. If it is set, i send a wire break error in the code.

    The REF_DET_ERR_EN bit in the ERROR_EN register is set to 1, right? And does the ERR bit in the status register also set in this scenario you mentioned? Can you also confirm what do you mean by 'wire break error' in your code?

    I've tried to do a test on the REF_DET_ERR bit using an EVAL-AD7124-8ASDZ. I tried it in continuous conversion and tried to convert/gather data with a valid reference and with an open reference. Since the voltage between my REFIN1+/- never goes below 0.7V and does not become open at any time, the REF_DET_ERR bit in the error register is set to 0 and ERR bit in the status register is also set to 0. When I tried to open the reference across REFIN1+/-, the REF_DET_ERR bit in the error register is set to 1 and ERR bit in the status register is also set to 1. I am observing expected values on this test.

    Can you share your configuration and register setting for this for further debugging? 

    Thanks and regards,

    Rod

  • Hi  , sorry for the late response, been busy. 

    1. Yes the REF_DET_ERR_EN bit in the ERROR_EN is set when i initialize the channel registers. 

    2. I check the status register right before i check the error register and the ERR bit is indeed set. 

    3. By wire break error, i mean that report that the ADC is reading all F's when the REF_DET_ERR bit is set. To simplify it, i will say that i do a print statement saying "Wire Break" when the error bit is set. 

    4. I read my external reference's voltage (across a reference resistor since this is a RTD that i am measuring) and it shows that the voltage stays above 0.7 V. When i actually do remove my current source (the current wire for the RTD which goes into AIN0), the reference voltage goes below 0.7 and the ADC accurately reports that the REF_DET_ERR bit is set.

    Below is the small portion of the code causing the issue. My comments explains what I am trying to do. Basically, I read the data register, then check to see if the current loop is open. The if (cur_wire_open) just reads back the error register and sees if bit 11 (the REF_DET_ERR) is set. If I don't read the error register before i call cur_wire_open (which clears the error register), it will report that the error is always set and then it will set my a2d_data to OPEN_CUR_LEAD. Now if my current loop is truly open, cur_wire_open will return true regardless of if i read the error register beforehand. Again, i want to clarify that this issue isn't something that has to be fixed, I am just curious as to why it is doing this. The code is functioning as expected after adding the read_a2d_reg24(ERROR_REG). 

    ________________________________________________________________________

    a2d_data = read_data_reg(DATA_REG);

     

      /*this clears the error register so the reference detection error isn't reported unneccessarily.
       * If you don't clear it, the cur_wire_open() function below will always return true.
       * Only if there is a true missing reference voltage, do we want to report a broken wire.
      */
      read_a2d_reg24(ERROR_REG);

      //check to see if the current loop is open.
      if (cur_wire_open())
      {

    // Reference voltage is missing so the current loop is broken. Set the a2d_data to OPEN_CUR_LEAD
      a2d_data = OPEN_CUR_LEAD;
  • Hi  ,

    I have tried to replicate this issue with an RTD setup based on CN-0383 (Rev.D) and have enabled REF_DET_ERR_EN bit. Assuming you have a ratiometric configuration due to this statement:

    When i actually do remove my current source (the current wire for the RTD which goes into AIN0), the reference voltage goes below 0.7 and the ADC accurately reports that the REF_DET_ERR bit is set.

    This is what I have observed: 

    • If I enabled REF_DET_ERR_EN bit upon initialization BEFORE enabling IOUT on IO_Control register, the REF_DET_ERR bit is set. Thus, an additional step on reading the Error register to clear the reference detect error is needed.
      • The REF_DET_ERR bit is set because there is no valid reference at the time (since IOUT is still disabled) the REF_DET_ERR_EN bit is enabled.
    • If I enabled REF_DET_ERR_EN bit upon initialization AFTER enabling IOUT on IO_Control register, the REF_DET_ERR bit is not set. There is no error flagged on the Error register.
      • The REF_DET_ERR bit is not set because there is a valid reference at the time the REF_DET_ERR_EN bit is enabled.

    As soon as the REF_DET_ERR_EN bit is enabled on the ERROR_EN register, the ADC checks if there is a valid reference for the device (since the device is in continuous conversion mode), thus, it is recommended to first enable the excitation currents before enabling the REF_DET_ERR_EN bit.

    Thanks and regards,

    Rod