Post Go back to editing

Not able to read data properly from AD7387?


Hope all are doing good!!!!

I have done the register configuration as per given table for write and read operation.I am able to read data from ADC but when i m trying read it for multiple times, data gets changing continuously.

ADC=AD7387(SPI write and Read)



















Before reading as per Datasheet I sent first NOP command 0x0000 then it should provide me data in next frame but i can't able to get data.

When i am giving 1V analog input to ADC so its digital equivalent should be 0x5000 but while reading multiple times i m getting 0x6558 or 0x12546 or 0x8564 so this is continuously fluctuating and I am not able able to get proper data. 

Please tell me  the frame format for   1-wire mode and how data will  come and how many cycles it will take to provide proper data. Data from ADC is continuously fluctuating while receiving.

Please suggest me how can I read equivalent digital data properly from ADC as per my analog input voltage.

Thanks and Regards,

Rohidas Pawar

  • Hii

    hope all are doing good

    As per your suggestion I tried and configure that way but I m not getting proper values. 

    I am getting following Hex values for given voltage .I am using internal reference. While reading, data is fluctuating.

    here are the values mentioned.

    Configuration-2 data, I am not able to read.

    So please help me with source code. I am waiting for your response.

    Thanks and Regards,

    Rohidas Pawar

  • Hi Pawar,

             We have the AD738x wiki page with No OS driver. You can refer to the link below. If you have an oscilloscope, can you measure if there are signals in the SDOB pin.

          I just wanted to make sure that the AD7387 is converting correctly. After power-up, without writing to the AD7387 registers, can you send a signal to allow the AD7387 to convert using the default register setting then check the digital output data if it reflects the input signal. When the data are correct, we can then write to the registers to change into 1 wire mode. 



  • Hi,

    i am reading the register values with 1 bit shifting.for Example if reading the default data from reg 5: it is giving 0x0FFe  but acutal data ashould be 0xFFF;



Reply Children
  • Hi Rohidas,  

          But in terms of conversion are we getting correct results? By the way, when reading in 1-wire mode, would you be able to check if there are still data in the SDOB output? For the AD7387, it requires at least 28 SCLK cycles to read both ADC channels. I am assuming that sequencer mode is disabled. Which input pins the voltage connected? The AD7387 is a 4-channel dual simSAR ADC. If you are monitoring two inputs simultaneously, this should be connected in the AinA0 and AinB0 pins, and when the CH register is 1, the input voltage must be connected in the AinA1 and AinB1 pins.



  • Hi ,

    Now i am able to read the data from the register address perfectley and also Conversion results of SDOA.

    Now i have increased the clock cycles to 32 and trying to read the  SDOA and SDOB data from SDOA  line (28 -bit data),but i am reading only the 16 bit data which is SDOA ,Now i wan to read the 28 bit data on SDOA line.

    1.I have configured the register 2 for 0XA1000;(one wire mode).



  • Hi,

    I have increased the clock cycles and i am  trying to read the data from the SD0A(on SDOA line i have to get the both SD0A and SD0B)but i am geeting the SDOA data only SDOB it giving different data . I have probed on SDOB pin no data is coming.Can you please tell how i can come out of this issue.



  • Hi Pawar,

        If you have some snapshot of the digital interface that you can share, it can help figure out the problem. I did some simulations before with my AD7386  board it works fine using this timing. What SCLK frequency are you running? I am asking this because the AD738x has timing characteristics that need to be followed to have a successful write to the device. Here is a snapshot of the write I did to output a 1 wire mode interface.