Post Go back to editing

Configuring and using the AD7172-4

Hi All

I have been trying to configure and use the AD7172-4 for about a week now and am not having much luck.

My Setup

  • Communicating with an PIC24 device - SPI signals look good. Viewed with a scope and edges look correct. Also reading registers back from the device appear correct.
  • AVdd1 = 5V
  • AVdd2 = 3.3V
  • IOVdd = 3.3V
  • PIC24 is at 3.3V
  • Caps on supply lines as suggested by datasheet.
  • Ref+ = 2.5V
  • Ref- = (A)GND
  • Tested input values 0.25V, 0.35V & 0.5V using millivolt source

I have tried two different setups.

  1. My own setup/configuration, from looking at the datasheet.
  2. One from register values specified by the AD7172-4 Eval+ software (used is simulation mode). In this, the physical input pint AIN5 is routed to analogue channel 3, which is set to use setup config1. The simulation seems to be correct.

I am using Single Conversion mode. After the conversion I am waiting a fixed amount of time before polling the status register to see if conversion is done. Please note that I am only doing this during testing, as I know waiting for a fixed time will not be practical in my final application. 

On a side note, I was initially polling the MISO pin (with CS high) at the PIC end to see it go low to indicate a completed conversion, however, when I probed it with a scope, this line seemed to decay over a (longish) period of time, rather than just drop as I would have expected. Unfortunately, I did not record the decay time. 

I am then looping through the 'Single Conversion - Wait - Poll - Read' sequence 1000 (now particular reason, also tried 1500) times, then instructing the PIC program to stop on a breakpoint. 

Now what I am seeing is the last read value seems to vary dependant on the my wait duration. The longer the wait duration the higher the value read. Furthermore, the value seen actually seems independent of the actual voltage applied at the input. At 100ms delay, the read value appears to be around 0.5V regardless of the input voltage. 

While I know it is virtually impossible for anyone to tell me what is wrong without actually seeing my configuration in detail, I would like to know if anyone has had a similar experience and seen similar effects? Or, if anyone could provide any suggestions. 

I think I have mostly exhausted possible issues with the configuration of the device and now am considering it to be a hardware issue.  

Thanking you in advance.


  • Hi,

    You have mentioned that you have polling the MISO pin (with CS high), when CS is high the MISO pin is in high impedance state and the DRDY will no longer indicates the end of conversion. Upon power up, can you reset the part by applying at least 64 consecutive 1s. This will ensure that all registers are set to their default values. With CS low, you should see that the DRDY pin is pulsing at the default output data rate (6.211ksps). Then, try to change the output data rate by writing to the filter configuration register. Read the register to ensure that the correct value was written. Again, with CS low, check that the DRDY pin is still pulsing at the new selected output data rate. If everything is working correctly, you can now attempt to read the data register and then reconfigure the device based on your required configuration.



  • Hi Jellenie

    Thank you for your reply, I will try this again this morning and let you know.

    I have however also re-read my initial post and it not quite as clear as it could be. I was initially polling the MISO pin, however when that did not work, I switched to polling/requesting the status register and checking the RDY bit. This is the way I am currently checking the ADC for a conversion complete status.

    However, as initially noted I will try what you have suggested.

    Thank you


  • Hi again Jellenie

    I have tried what you have advised. After reset I am getting a pulsing at 6.211 ksps. I have then changed my config and am getting the cira 1 ksps from a single enabled channel. 

    I have tired in both single conversion and continuous conversion mode. I have applied voltages to the input via both a millivolt source and a power supply. I have tried both unipolar and bipolar modes.

    In unipolar mode with the both sources I am getting a zero readback with a ADC Error condition. In order to make sure I am applied the input at the correct pin, I have even tried enabling 1 channel at a time and always get the same zero readback with ADC Error condition. 

    In bipolar output I am getting a value of around 0x796DD0 regardless of the input voltage,

    Any other suggestions that you could offer would be appreciated.

    Thank you


  • Hi,

    Have you checked if you have a valid reference? ADC_ERROR flags if you have any over range or under range input voltage. Can you probe your reference inputs as well as your analog inputs at AD7172-4 pins? Are you seeing correct values?



  • Hi Jellenie,

    Thank you for your continued support. 

    Yes, I am getting the correct value on the reference line, 2.5 V.

    I have also being trying a few other things in order to check the basics. I have configured the device to use both (Ref+/Ref-) and (AVdd1/Vss) as references and the ((AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5)-) & (Ref+/Ref-) in inputs. Essentially avoiding separate external measurement inputs. 


    I have tried three combinations of the above inputs and reference (the one missed out was (Ref+/Ref-) as both reference and input, the this would not theoretically work).


    In the other combinations, the value predicated by the evaluation software (in simulation mode) and my prototype hardware matched, however it was half what I was expecting. Furthermore, the value 'created' by using (AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5)- as the channel input seemed to change dependant on the reference, while AVdd1 and Vss remain the same. Is this normal?


    As this was showing fairly sensible values (baring the factor of 2 error), I re-configured the device for an external input.

    Initially this did not work, however when I tried a different input pin, the values now seem sensible.


    Please note, that I previous did try all the input pins, however at that point there was no guarantee that the rest of my configuration was correct. So it looks like I either have broken the Ain5 input or there is a problem with the soldering on my prototype board. My final boards should be in shortly and hopefully Ain5 will work in them.


    So at the moment I, hopefully, only have the issue of why the value 'created' by using (AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5)- as the channel input seemed to change dependant on the reference, while AVdd1 and Vss remain the same. 


    AVdd1 is 5 V and Vss is 0 V, so am I correct in thinking that the value presented the the ADC should be 2 V?


    However what I am seeing the following:


    When reference is set to AVdd1 & AVss and input is set to (AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5), both the hardware and simulation shows 0.5 V.

    When reference is set to  Ref+ & Ref- and input is set to (AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5), both the hardware and simulation shows 1 V.


    Would you also have any suggestions for the factor of 2 error I have been seeing, when reference is set to AVdd1 & AVss and input is set to Ref+ (i.e. 2.5 V) & Ref- (0 V). In the case both the hardware and simulations shows 1.25 V.


    In all cases, AVdd1 is 5 V and AVss is 0 V.


    Thank you in advance.





  • Hi Jellenie,

    I have been working on this over the day and I think I have found the problem.

    I have repeated what I tried yesterday, in terms of using (AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5), and I am now getting a constant voltage of 1 V with a AVdd1 of 5 V. 

    I must have been making a mistake in the config somewhere when selecting the setup and channel combinations. 

    I have come across another problem, in that the even numbered channels do not seem to work. However given the fact that I may already have a problem with my Ain5 pin, I will do some tests when I get a new chip and post as a separate question if I am still having problems. 

    Thank you for your support.


  • Hi, Chithambaran.

    When you select the ((AVdd1 - AVss)/5)+ & (AVdd1 - AVss)/5)-) the 1V output you get when AVDD1 = 5V and AVSS=0V is correct. There's a bug in the AD717x EVAL+ software on the selection of AVDD1-AVSS reference as the EXT reference value affects the results. That's probably the reasons why you are getting with different results as you have mentioned above. This will be corrected and updated the software as soon as possible.


  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin