Post Go back to editing

ADC data read issue ad7298

Category: Software
Product Number: AD7298-1
Software Version: 2023.2

I am having trouble using the ad7298 ADC. I am using petalinux 2023.2. This is my device tree entry for the ADC

Heres my HDL IP config for the ADC 

And heres the issue im seeing


as you can see after i first read I cant read the temp value anymore and all the voltage raw values read 4096 (this is weird because the ADC is 10 bits).
Heres what I see on iio oscilloscope


In kernel config I have the device driver set to <M> since im using late bitstream loading, but i have tried with early loading as well and its the same issue. 

Any help would be appreciated I need to log this data for the health of the system and if i cant read the data its a big issue. Any help would be appreciated.

  • Hi  ,

    This looks suspiciously like it might be a hardware problem - the values shown correspond to all 1s in the data output - full-scale for the voltage readings, and negative 0.25C for the temperature.

    This could happen if CS is not being asserted (for example, if CS were assigned to the wrong I/O pin on the FPGA), and if DOUT (MISO) happens to float high (either by chance, or if the FPGA has weak pullups enabled.)

    Have you probed the SPI signals with an oscilloscope or logic analyzer? One trick you could try is temporarily connect a 1k resistor between DOUT (MISO) and ground - if the temperature and voltage values read back are zero, that may indicate miswiring.

    -Mark

  • Thank you. We were able to probe the CS line and it was being pulled low so we are now pulling it high and I can do multiple readings. There is another issue that popped up though. When the internal temp sensor reaches 40C the ADC stops working and reports values almost 1/3 of what They should be or even less. We have verified this behavior with absolute certainty by blowing cold air on it. When the internal temp sensor is below 40C the adc works perfect but not when it’s above 40C.

    EDIT : RESOLVED. It was a misconfigured clock