Reading Registers on AD7172-4

Hello everone.

I have connected the EVAL-AD7172-4SDZ board to the SPI interface on a STM32F405 board. Writing to registers in the ADC seems to work fine, e.g. I can start a conversion in single conversion mode, set the ADC into standby mode or turn on an LED on the eval board by activating the PDSW bit in the GPIO register (0x06).

However, reading by any of the registers does not return the values as expected. Especially the ID register (0x07) does not return 0x205x as shown in the data sheet, but 0x0077 instead.

A screen shot showing the SPI signals is attached.

The code I use is very similar to the No-OS package on github.

Any hints about getting the chip to return the correct read data will be greatly appreciated.

The same problem applies to other registers in that writing them seems to word while reading back does not give the expected results.E.g. I write 0x1f00 to SETUP0 (0x20) and read back 0x1e01.

Btw I am referring to the AD7172-4 data sheet in Rev. A.

Thanks a lot.

  • 0
    •  Analog Employees 
    on Nov 9, 2016 10:47 PM over 4 years ago

    Hi,

    Have you tried to perform a reset before reading the register? It is recommended to perform a reset after power up to ensure that all the registers are at their default values. You can reset the interface by taking DIN high for at least 64 clock cycle. You mentioned that you are using the evaluation board, have you tried to use it in conjunction with the SDP board with its dedicated software and check if you are reading correct read back for ID register? It's weird that you can write correctly to the register but not reading the correct data. The most likely reason for reading incorrect data from the registers is an incorrect setting or number of clock pulses on the SCLK line. Your processor should output data on the SCLK falling edge as the part latches it in on the SCLK rising edge. The scope shop seems to be correct. Have you check your SPI pins connections especially the DOUT pin?

    Thanks and Regards,

    Jellenie

  • 0
    •  Analog Employees 
    on Nov 10, 2016 5:28 PM over 4 years ago

    Hi, Bernhard.

    You have mentioned that your software interface works with other AD7172-4 chips/board, right? Have you tried to read all the registers? Are you reading the same value even if you changed the value of that register? The only way to check for corruption is to read the registers back periodically. You would need to read all the registers to make sure that nothing has been corrupted. An overvoltage on the analog inputs can corrupt the registers. Have you check the supplies/inputs if it is within the specifications?  

    Thanks,

    Jellenie

  • Hi Jellenie

    Thank you for your helpful reply. I tried the RESET sequence. I verified its effect by observing the ADC to restart its default measurement sequence as evident from the pulse sequence on /RDY output. Also, it turn off the current sink on the PDSW port.

    I implement the RESET sequence by sending eight bytes of 0xFF thru the SPI interface.

    However, the RESET does not change the chip's behavior when reading its register. I still get the 0x0070 value from the ID register after the reset (or 0x0077 after putting the ADC into standby mode by writing 0x0020 to the MODE register 0x01).

    The SPI interface works fine with other chips so I am pretty sure there is no problem here. Also I always observe the same value in the processor as on the scope for both reading and writing. The scope also shows that MOSI and MISO both change on SCLK falling edge so they can be sampled correctly on the rising edge.

    I have also lowered the SCLK frequency to 650 kHz without any change.

    Do you have any other idea that could help?

    Thanks again and best regard

    Bernhard

  • Jellenie,

    could you please check wether the Rev. A of the AD7172-4 data sheet is the most up-to-date version, and wether there are any updates or errata documented for the chip?

    Unfortunately I do not currently have an SDP board for an independent verification.

    regards

    Bernhard

  • Hi Jellenie

    thanks a gain for looking into this.

    As I mentioned above, I am using a EVAL-AD7172-4SDZ board. Therefore I am not worried about the power supply of the AD7172-4 chip. At this time I only have a single ADC chip to test against, so I cannot rule out a defective chip. The other chips I mentioned are of a different kind; not AD chips.

    I can confirm that I do not always get back the same value from a register immediately after writing to it. Most significantly, the ID register (0x07) does not give the expected value.

    Did you check for the most current revision of the data sheet (I am using Rev. A) ?

    I am trying to get hold of an SDP eval baord to rule out any problems on my MCU's side.

    Regards

    Bernhard