Correct setup for AD7793?


I am evaluating AD7793 through the EVAL-CN0355-PMDZ board. In order to understand how it works I'm using the NO-OS driver found here and trying to interface it with an Arduino, but as far I can see, data is a little bit strange.

When I execute AD7793_Init(), the function does not return 1, it returns 0 meaning the device is not correctly detected.

When I read from the AVDD Monitor with these functions:

  unsigned long conv = AD7793_SingleConversion();
  float AVDD = ((conv - 8388608.0) / 8388608.0) * 1.17 / (1/6.0);
It returns a value that oscillates around 4.9V, which seems correct because I'm powering the board with 5V, also when I read the chip temperature I read the ambient temperature, which seems to be correct. The problem comes when I try to read from AIN2, I get data that is absolutely not correct.
conv = AD7793_SingleConversion();  /* Returns the result of a single conversion. */
float Temp = (((conv - 8388608.0) / 8388608.0) * 1.17 * 1000 / 0.810);
First I set the excitation current to 1mA, then I set the channel to read and finally I try to get the conversion. But data read varies from -1444.44 to 1444.44. Data read should be zero because I'm not using an RTD, but a resistance with a nominal value of 100 Ohm (100 Ohm correspond to 0ºC). So I think I'm missing some configuration before getting the data.
Any ideas of what I'm doing wrong?

Formatation done.
[edited by: rnicolas at 3:40 PM (GMT -4) on 17 Mar 2021]
  • 0
    •  Analog Employees 
    •  Super User 
    on Mar 18, 2021 3:41 AM


    We will look into this, I'll contact the product owner and get back to you.



  • 0
    •  Analog Employees 
    on Mar 18, 2021 7:26 AM


    May I know what external reference resistor did you use? Are you using exactly the same circuit as CN-0355 and just used 100ohm resistor in replacement with RTD? 

    I don't fully understand how the equation used was derived. But if you probe for example the 100ohm and the Rref, are you getting the actual voltage? I'd suggest to measure the data output code only and see if that reflects to the actual input voltage. We can work on the code to temp equation once we verified your schematic and configuration. 

    I think the excitation current have also an outpiut compliance. So for example you have AVDD=5V and you have used 5kohm Rref the voltage drop across Rref using 1mA current is already 5V and it violates the output compliance of AVDD - 1.1V and it do not have enough headroom for RTD. So please confirm your circuit and ADC configuration. 

    I'd also suggest to ask someone from the Reference Circuits - EngineerZone ( if you have questions specific to CN0355. 



  • Hi,

    Thank you for your fast answer.

    May I know what external reference resistor did you use? Are you using exactly the same circuit as CN-0355 and just used 100ohm resistor in replacement with RTD? 

    Yes, exactly, in fact, I'm using the EVAL-CN0355-PMDZ. I've attached an image so you can see it.

    I've changed the setup code by the following ones (from your driver of Renesas) adapted to use AIN2 instead of AIN1:

    AD7793_SetGain(AD7793_GAIN_1);                // set gain to 1
    AD7793_SetChannel(AD7793_CH_AIN2P_AIN2M);     // use AIN1(+) - AIN1(-) 
    AD7793_SetIntReference(AD7793_REFSEL_INT);    // select internal 1.17V reference
                     AD7793_CH_AIN2P_AIN2M);      // Internal Zero-Scale Calibration

    And also reduced the excitation current from 1mA to 10uA (I've seen if I use 210uA, sometimes the board gets stuck and I have to reinitialize it). Now I'm receiving values the following values:


    Which if I apply the formula that I put in the first post I get a value that goes around 0 ºC, but since it was a quick hack from one of my colleagues I'm not using it.

    As far I understand, these values in binary are the differential voltages on the resistor acting as PT100 in my system, right? The problem is that I don't see how to convert them to V to get then the R-value (and once I get the R I can get the temperature directly) since I know the Intensity (10uA) and Voltage (in binary form).

  • 0
    •  Analog Employees 
    on Mar 19, 2021 1:45 AM in reply to rnicolas


    Okay. If you are using exactly the same configuration circuit as CN0355. Then I guess you need to update your ADC configuration in order to reflect with the circuit configuration. 

    So Ideally, CN0355 uses a ratiometric configuration wherein the same current is flowing through RTD and the 5kohm reference resistor. Meaning, any variation in IOUT or errors in excitation current will be cancelled. With a 210uA current, a 5kohm Rref will generate a 1.05V and will serve as the reference input voltage of the ADC. So Instead of using internal reference, you must configure the ADC to use external reference. Then since a 210uA is quite small, it will also generate a small voltage across your RTD so to maximize the ADC performance you should also change your Gain. I am not sure what gain the CN uses but a Gain of 16 would be fine.  

    In terms of how to convert code to voltage, you can refer to this link. 

    FAQ: How to convert the AD7124-4/AD7124-8 data output Code to equivalent analog input voltage? - Documents - Precision ADCs - EngineerZone

    And in terms of how to convert from RTD to temp, you can use CN0383 as reference. It uses a different ADC but would still apply the same calculations. I'd think I can also recommend using AD7124 instead as this is a newer part. It has all of the building blocks of AD7793 with more advanced features. We also have an RTD design tool that could help you get started. Example codes for this product is also available, and we are also planning to release example code specific to temp sensing. 

    Reference circuit: CN-0383 (Rev. C) (

    RTD Tool: 

     Sample code: 

    Sigma Delta ADC Temperature-BLE Demo [Analog Devices Wiki]

    AD7124 Example on STM32 Processors [Analog Devices Wiki]



  • Hi,

    I've just set up the project with those values you mentioned. But still, data read from the ADC is strange for me because when I calculate the R, R has a value that does not correspond with the expected ones, but before going deep into that I would like to see if I understand correctly the different parameters.

    According to this link, the formula is the following one:

    Code = (2^N × AIN x Gain)/VREF

    In my case, since I'm using AD7793, the values that I need to use are these ones:

    N = 24

    AIN = ??? (the value that am I searching for?)

    Gain = 16

    Vref = 1.05V (Voltage drop in Rref)

    Code = the value read when I call the AD7793_SingleConversion() function (is that right?).

    So, when I substitute these values in the formula and I isolate AIN, I get this:

    AIN = (Code*Vref)/((2^n)*GAIN)

    AIN = (1414464*1.05)/(16777216*16)

    AIN = 1485187.2/268435456

    AIN = 0.0055327 (I assume this is the voltage that drops in the RTD).

    And this value is not correct because V=I*R, so:

    0.0055327/0.00021 = 26,34 Ohms, which is not possible because instead of an RTD I am using a 100Ohm, so I should get a value around 100 Ohm, not around 25 Ohm.


    I've also done the math using the bipolar formula because it is the default mode. I've applied the formula in the document, but data is still not correct. The only configuration that I've found to get some reasonable data is using a Gain of 32, which I get 106 Ohms in R, but again, this is not acceptable because 106 is the equivalent to 15ºC (which is an error about 15ºC from the data that I should be monitoring).