This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ads8689: can not get correct data

Part Number: ADS8689

i|=SPI2_ReadWriteByte(0x00)<<8;
i|=SPI2_ReadWriteByte(0x00);
SPI2_ReadWriteByte(0x00);
SPI2_ReadWriteByte(0x00);
ADS868X_CS=1;

printf("\r\n%d\ti\r\n", i);

when i use this command ,i set it 0-10.24v i can not get the correct ADC data ,just  like it return 16383,while it is 46.6mv

  • i can write the register ,but can not get the correct data
  • Hi,

    You must be sure to initialize your variable i to all zeros before reading the data. you must do this every time you read data out.
    Also, I would suggest trying to write to a register and then reading that same register, this will make sure that the registered are correct and will show that you are reading data correctly

    Regards
    Cynthia
  • oh ,i see ,thanks,i just solve it
  • I also want to know if ADS8689 can send a single when it has conversion,and if not ,what frequence should i read the conversion
  • I also want to know if ADS8689 can send a signal when it has conversion,and if not ,what frequence should i read the conversion
  • You can use RVS to know when the device is done wtith the conversation phase, note that RVS can depend on the output protocol used.

    I would suggest looking at the datasheet, starting on Page 10 for timing requirements of the device. The frequency you use depends on how you are using the device, just be sure to be within the bounds of the device's capabilities.

    Also, if you want to learn more about ADCs' there is a great resouce, Precision Labs-ADCs that can really help

    Regards

    Cynthia

  • i get the data is not stable. Just like i use ads8689 measure the 3.3v,but i get the data 3.21v-3.54v
    ,even 3.61v .i try to read data every 1 MS ,10MS,even 100MS,but the data is not stable。if i should get the RVS signal,but i do not know how to use it.
    ADS868X_CS=0;
    ADC_RateDataGroup[ADC_RateDataCount]=SPI2_ReadWriteByte(0x0000);
    SPI2_ReadWriteByte(0x0000);
    ADS868X_CS=1;
    i get 10 data,then get the average of them
  • And i look the datasheet on Page 10 .it tell me i can read data every 10US
  • Hello Biao,

    Can you please upload your schematic and your timing screenshot with a scope for Convst/CS,SCLK, SDO and SDI? also please let us know how you tested,  for example, your signal source and so on. These will be very helpful to address the issue, thanks.

    Best regards

    Dale

  • I do not have the conditions to test the time series
  • Hi Biao,

    Your schematic looks fine for me, but there are some concerns:

    1.  Your are splitting the ground and your ground connection point by R22 is far from ADC, also you are using only two-layer pcb board and there is very small analog ground area. You have to make sure the voltage difference between GND and AGND/REFGND is less than +/-300mV, so a solid ground plane is strongly recommended and this is also mentioned in datasheet.

    2.  Two-Layer pcb layout is not easy to achieve 16-bit ADC's performance, also your board size is small and all circuits including DC-DC and MCU digital circuit are put together. It's important to have a clean layout to avoid any interference from digital/power to analog circuit.

    3.  ADC's AVDD is used for internal signal acquisition and conversion, so it's important to have a clean and well-bypassed power supply. A low noise LDO is a good solution to provide a supply to the ADC, for example, TPS7A47xx, this is a very common device to be used in our EVM boards.

    Please refer to Layout Guidelines for more details in ADS8689 datasheet page 61.

    Except above layout suggestions, can you please let us know the value for resistors and capacitors in your schematic? also please upload your timing screenshot from a scope so that we can check if your timing is correct, like Figure 3 in datasheet.

    The test conditions I mean are: 

    Did you apply the test signal on Q2? What's the voltage for test and where is signal from(precision signal generator or others)? What's the output conversion code you got from ADC? etc.

    Thanks.

    Best regards

    Dale

  • I apply the test signal on Q2 ,and the voltage for test and signal from the 3.3v,5v of PCB and a sick distance sensor

  • ADS868X_CS=0;
    ADC_RateDataGroup[ADC_RateDataCount]=SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    ADS868X_CS=1;
  • Hi Biao,
    When you set ADC input range to 2.5xVref( 0-10.24v), if the conversion code you got is 16383, the corresponding voltage is around 2.56V [(16383/65526)*10.24]. I suggest you to do a test without input range change in case your digital signal's timing has any potential issue, after power up the ADC, the default input range is ±3 × VREF(±12.288V for internal 4.096V reference), please upload your conversion data file and I can check for you.
    Please notice that:
    1. Don't use power supply as input test signal because the code will not be stable for noisy supply.
    2. Let me know the value of your resistors and capacitor(input) in your schematic.
    3. Upload your timing screenshot from a scope for SCLK,/CS,SDO and SDI, so I can check if your timing is correct.

    By the way, as I mentioned in previous reply, your Two-Layer pcb layout board and your splitting the ground will be a challenge to achieve the performance on ADS8689 even the function will work after you do above test. Please re-design you pcb board if it's possible.
    Thanks.

    Best regards
    Dale

  • I re-design my pcb board now,and i do not  have condition test timing ,i just a student .can i use the gnd as input test signal?

  • i think my timing is correct,because i can write and read the register ,such as RANGE_SEL_REG Register (address = 14h)
  • I also want to know if i must need the optional board

  • ADS868X_CS=0;
    delay_ms(1); //延时ms
    SPI2_ReadWriteByte(0xD014);
    SPI2_ReadWriteByte(0x0009);
    ADS868X_CS=1;

    float adc_filter(u16 *data,u16 num)
    {
    u8 i=0;
    u16 max=0,min=0;
    u32 sum=0;
    float average=0;

    max = *(data+0);
    min = *(data+0);
    sum += *(data+0);

    for (i=1; i<num; i++)
    {
    if (max < *(data+i))
    {
    max = *(data+i);
    }
    if (min > *(data+i))
    {
    min = *(data+i);
    }
    sum += *(data+i);
    }

    sum = sum - max - min;
    average = (float)((float)sum/(float)(num-2));

    return average;
    }

    void TIM3_IRQHandler(void) //TIM3中断
    {
    static u16 ADC_RateDataGroup[ADC_FILTER_NUM]= {0};
    static u16 ADC_RateDataCount=0;
    if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //检查TIM3更新中断发生与否
    {
    if(ADC_RateDataRedy==0)
    {
    ADS868X_CS=0;
    ADC_RateDataGroup[ADC_RateDataCount]=SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    ADS868X_CS=1;
    ADC_RateDataCount++;
    if(ADC_RateDataCount==ADC_FILTER_NUM)
    {

    ADC_RateData =adc_filter(ADC_RateDataGroup,ADC_FILTER_NUM)*10.24/65535; //100-600
    ADC_RateDataRedy=1;
    ADC_RateDataCount=0;
    }
    }
    TIM_ClearITPendingBit(TIM3, TIM_IT_Update); //清除TIMx更新中断标志

    }
    }
  • /*设置量程0-2.5*4.096*/
    ADS868X_CS=0;
    delay_ms(1); //延时ms
    SPI2_ReadWriteByte(0xD014);
    SPI2_ReadWriteByte(0x0009);
    ADS868X_CS=1;
  • /*设置量程0-2.5*4.096*/
    ADS868X_CS=0;
    delay_ms(1); //延时ms
    SPI2_ReadWriteByte(0xD014);
    SPI2_ReadWriteByte(0x0009);
    ADS868X_CS=1;


    float adc_filter(u16 *data,u16 num)
    {
    u8 i=0;
    u16 max=0,min=0;
    u32 sum=0;
    float average=0;

    max = *(data+0);
    min = *(data+0);
    sum += *(data+0);

    for (i=1; i<num; i++)
    {
    if (max < *(data+i))
    {
    max = *(data+i);
    }
    if (min > *(data+i))
    {
    min = *(data+i);
    }
    sum += *(data+i);
    }

    sum = sum - max - min;
    average = (float)((float)sum/(float)(num-2));

    return average;
    }


    void TIM3_IRQHandler(void) //TIM3中断
    {
    static u16 ADC_RateDataGroup[ADC_FILTER_NUM]= {0};
    static u16 ADC_RateDataCount=0;
    if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //检查TIM3更新中断发生与否
    {
    if(ADC_RateDataRedy==0)
    {
    ADS868X_CS=0;
    ADC_RateDataGroup[ADC_RateDataCount]=SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    ADS868X_CS=1;
    ADC_RateDataCount++;
    if(ADC_RateDataCount==ADC_FILTER_NUM)
    {

    ADC_RateData =adc_filter(ADC_RateDataGroup,ADC_FILTER_NUM)*10.24/65535; //100-600
    ADC_RateDataRedy=1;
    ADC_RateDataCount=0;
    }
    }
    TIM_ClearITPendingBit(TIM3, TIM_IT_Update); //清除TIMx更新中断标志

    }
    }
  • Thanks.

    the value for resistors and capacitors in my schematic

    output conversion code i got from ADC: I get the average of 10 data.

    /*设置量程0-2.5*4.096*/
    ADS868X_CS=0;
    delay_ms(1); //延时ms
    SPI2_ReadWriteByte(0xD014);
    SPI2_ReadWriteByte(0x0009);
    ADS868X_CS=1;

    float adc_filter(u16 *data,u16 num)
    {
    u8 i=0;
    u16 max=0,min=0;
    u32 sum=0;
    float average=0;

    max = *(data+0);
    min = *(data+0);
    sum += *(data+0);

    for (i=1; i<num; i++)
    {
    if (max < *(data+i))
    {
    max = *(data+i);
    }
    if (min > *(data+i))
    {
    min = *(data+i);
    }
    sum += *(data+i);
    }

    sum = sum - max - min;
    average = (float)((float)sum/(float)(num-2));

    return average;
    }

    void TIM3_IRQHandler(void) //TIM3中断
    {
    static u16 ADC_RateDataGroup[ADC_FILTER_NUM]= {0};
    static u16 ADC_RateDataCount=0;
    if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //检查TIM3更新中断发生与否
    {
    if(ADC_RateDataRedy==0)
    {
    ADS868X_CS=0;
    ADC_RateDataGroup[ADC_RateDataCount]=SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    SPI2_ReadWriteByte(0x0000);//发送读取ID命令
    ADS868X_CS=1;
    ADC_RateDataCount++;
    if(ADC_RateDataCount==ADC_FILTER_NUM)
    {

    ADC_RateData =adc_filter(ADC_RateDataGroup,ADC_FILTER_NUM)*10.24/65535; //100-600
    ADC_RateDataRedy=1;
    ADC_RateDataCount=0;
    }
    }
    TIM_ClearITPendingBit(TIM3, TIM_IT_Update); //清除TIMx更新中断标志

    }
    }

  • Hi Biao,

    I would like to communicate with you by email and call, I will contact you directly.

    Thanks

    Best regards

    Dale

  • ok,please tell me how to  communicate with you? 923190163@qq.com

  •  lbayy@my.swjtu.edu.cn   ,this is my email in my university

    I re-design a pcb ,how about it ? Thanks.  Thanks.

  • Hi Biao,
    I sent email to your lbayy@my.swjtu.edu.cn on March 8th, but didn't get any response, can you please check your email box or sent a email back to me? I would like to have your data base for both new sch and pcb to double check, here I can not tell you whether it's good or not with two simple screenshots, I need to check your ground, connections on important pins etc.
    Thanks.
    Best regards
    Dale