Post Go back to editing

Not able to read data properly from AD7387?

Hi,

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)

Register

Write_Value

Read_Value

Configuration-1

0x9802

0x1000

Configuration-2

0xA100

0x2000

Alert_Register

--

0x3000

Alert_Low_Threshold

0xC1F1

0x4000

Alert_High_Threshold

0xD3A9

0x5000

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 on...like this only.it 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

Parents
  • 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

Reply
  • 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

Children
  • 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.

    https://wiki.analog.com/resources/eval/user-guides/ad738x 

    Regards,

    Jonathan

  • 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;

    Regards,

    Rohidas

  • 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.

    Regards,

    Jonathan

  • 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).

    Regards,

    Rohi

  • 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.

    Regards,

    Rohi

  • 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.

    Regards,

    Jonathan