Post Go back to editing

issue with SPI COMMUNICATION WITH AD7173-8, controller ESP32

Category: Hardware
Product Number: AD7173-8

Hello everyone,

I am writing a driver to interface AD7173-8 to ESP32 Microcontroller. when I try to read the reset value of a particular register, it is giving different value.

here are the register reset values I tried to read 

the status register reset value as per the datasheet is 0x80. but the reset value I read is 0x81.

the ADCMODE  register reset value as per the datasheet is 0x2000. but the reset value I read is 0x201.

the IFMODE  register reset value as per the datasheet is 0x0000. but the reset value I read is 0x01.

please help to tackle this issue.

thank you

Moved & tagged
[edited by: emassa at 4:03 PM (GMT -5) on 2 Mar 2023]

Top Replies

    •  Analog Employees 
    •  Super User 
    in reply to SRISUS +1 verified

    HI  ,

    The ADC should be able to read +-2.5V. Note that the absolute input voltage of the ADC is AVSS-0.05 to AVDD1+0.05 for disabled input buffers and AVSS to AVDD1-1.1 for buffers enabled and ensure…

  • Hi,  

    When monitoring the MISO pin, can you confirm that you pull /CS low? 

    I would recommend to follow these steps for debugging purposes. 

    For example, upon power up when registers are all at default configuration. Stop reading the conversions, just monitor the DRDY pin (when /CS low). Do you see that the pin is pulsing at default ODR (i.e. 6.211ksps)? If yes, try to change the programmed ODR by writing to its appropriate register (FILTCON register). After that, try to readback the same register to see if it was successfully updated. If the readback is okay, try again to monitor the DRDY pin (when /CS is low) and check if the pin is now pulsing at the new programmed ODR. If everything is okay, you can start changing other register based on your target configuration. I would suggest to change it one at a time just to debug where the issue is coming from. 

    When DOUT/RDY stops pulsing at any time and it stays high or low (even though the ADC is configured for continuous conversion mode), this indicates that the serial interface has become asynchronous (incorrect number of SCLK pulses, glitches on the SCLK line). Ensure that the correct number of SCLK pulses are being used for each read/write operation. It is also recommended to tie DIN and SCLK high when they are not being used to prevent glitches affecting the SPI interface.


  • Hi Jellenie,

    thanks for your response.

    happy to share that I can able to read when DOUT/RDY goes low and conversion is happening properly as expected for a single supply(i.e for 0v to 2.5 reference voltage). 

    now I am working on split supply(i.e for -2.5v to 2.5v reference) in this I am not able to read for the full range. in split supply, I can able to read from -1.99v to +1.99v.

    can you please suggest to me to solve this issue?



  • Hi  

    Can you share your input setup please? For example what is your input voltage at AVDD, AVSS, IOVDD, REFIN+, REFIN-, AIN+ and AIN-?



  • Hi  Jellenie

    AVDD= 2.5V

    AVSS= -2.5V

    IOVDD = 3.3V

    REFIN+ = 2.5V


    AIN+ =  positive i have supply given

    AIN- =  I have connected this pin to ground

    thanks& regards


  • Hi  ,

    Apologies for getting back late. Your inputs are within specification, you should be able to read -2.5V to 2.5V. May I know what the output of the ADC is when you try to have an input of beyond -1.99V and 1.99V or at least the -2.5V and 2.5V input. Also, could you try probing REFIN+ and REFIN- just to make sure that it is 2.5V and AVSS respectively. I am assuming that both AVDD1 and AVDD2 is 2.5V, am I correct? 



  • Hi JC,

    yes AVDD1 and AVDD2 is 2.5v.

    here AIN1 is connected to the ground and AIN0 is used to give an input signal.

    here input signal is -2.5v to 2.5v. 

    I have attached the schematic below. please have look at the schematic and let me know if

    the schematic full fill the requirement. 

    quick response is appreciated.



  • Hi  ,

    I checked your schematic and noticed the voltage divider in AIN0. For inputs of -2.5V and 2.5V, this will be effectively halved by the voltage divider circuit. I am unsure why the data you are reading is above -1.25V and 1.25V unless there is a mismatch in the resistors in the voltage divider.

    It would also help if you could share the output code of the ADC for these inputs. Also, how are you converting the bipolar codes into voltage?

    Input voltage Output data code



  • Hi JC,

    in the above circuit, I have removed the voltage divider. 

    I have a doubt that I have a bipolar signal (+2.5 to -2.5) that I am feeding to AIN0 of ADC and here AIN1 is grounded. I have configured the ADC to BIPOLAR in the SETUPCON register.

    can ADC able to read that +-2.5v in AIN0 itself?

    as I understood that, a single-ended connection means if  I select channel0 with AIN0&AIN1, AIN1 is connected to the ground and AIN0 is used to feed the signal with respect to AIN1.  in a single-ended case, reference is given as REF+=2.5V & REF-=ground(AVSS=0V).

    Fully differential means, AIN0 is connected to the positive supply and AIN1 is connected to the negative supply. reference is given as REF+=2.5V & REF-=AVSS=-2.5.

    here above schematic is designed for a single-ended connection with  REF+=2.5V & REF-=AVSS=-2.5.

    can a single-ended connection able to read bipolar signals?

    formula I have used is Vout = data_code*2.5/(2^24).

    please help me out with this.



  • HI  ,

    The ADC should be able to read +-2.5V. Note that the absolute input voltage of the ADC is AVSS-0.05 to AVDD1+0.05 for disabled input buffers and AVSS to AVDD1-1.1 for buffers enabled and ensure that the differential input voltage range of the selected positive and negative input pins is +/- Vref, wherein Vref = REF+ - REF-. In your case, for the split supply, Vref = 5V. This is also applicable when connected in single-ended configuration.

    Yes, single-ended connection is able to read bipolar signals. Single-ended configuration means that you only have one input while the other input is fixed to ground. When bipolar mode is set, the ADC is able to accept a differential voltage either positive or negative. 

    Please use this equation to convert the output code.

    Bipolar code:

    Vout = [(Code/2^23) -1] * Vref

    Unipolar code:

    Vout = (Code * Vref) / 2^24



  • Hi JC,

    Thank you very much.

    now the device is working fine as expected. but the only concern is the accuracy.

    The accuracy error is 10 mv. I need to achieve below 1mv. my end application is designed to read 1mv to 2.5v.

    could you please help me out with this?