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.

ADS1232: Scale output error

Part Number: ADS1232


Hello,

We are using ADS1232 from Ti for one of our newest Scale products. We only have some problems with wrong data that is coming out of the IC. Depends on the speed/frequentie the ADS is giving output data there is each x row a zero output. Its not just with 1 IC but with all. Our software engineer tried to figure out what is the problem but he found out its really coming out of the IC and its not an software issue.

Please see in the appendix the scale output where you can find the zero error each 6th weight.

In the appendix also our PCB diagram can be found.

 Schematics Autogram_PCB_V3.PDF

Thanks

  • Hello Levi,

    This looks like a timing issue with communications.

    1.  Could you send the raw ADC data, and not the calculated results?

    2.  Please capture IO signals using an oscilloscope or logic analyzer SCLK, nDRDY/nDOUT over 4-5 cycles, including a cycle where the reading is 0.  It would be helpful to also measure nPDWN and SPEED pins to make sure these signals are not changing during conversion readings.  

    3.  Although this will not cause the 'zero' readings, the reference input capacitor C11, should be at least 10nF or higher value, to reduce noise from the power supply.  Using the same 100nF capacitor as the input capacitor C7 is recommended.

    Regards,
    Keith Nicholas
    Precision ADC Applications

  • Hello Keith,

    Thank you for your fast reply and your help/

    My apologies, but I explained the issue incorrectly. It's not that the output gives a 0 every so often, but rather that the output gives duplicate values every x output. Since we are measuring the difference in the above calculation, it results in 0 when two numbers are equal to each other. We have conducted numerous measurements, and it appears that the scale always produces duplicate values with an exact recurring frequency at a certain ADS speed. The frequency of these duplicate values depends on the speed setting of the ADS1232

    With this information can you say anything more about it or should i still do this same tests?

    I asked our engineer to do it and they will reply soon.

    Thank you

  • Hello Levi,

    Yes, I still need the captured IO data for SCLK, nDRDY/nDOUT over 4-5 cycles.  This appears to be a timing issue, but I will need the IO signals to confirm.

    This could also be an issue with the firmware.  Providing the raw ADC readings will confirm if the repeated readings are coming from the ADS1232, or if there is some sort of firmware bug.

    Regards,
    Keith

  • Dear Keith,

    I hope this message finds you well. Firstly, please accept my sincere apologies for the delayed response. Our engineers have been caught up with various tasks, which caused the delay in addressing your concern.

    Upon reviewing the raw data and comparing it with the calculated data, we have discovered that the issue of double data only seems to manifest in the calculated data. However, pinpointing the exact location of this problem has proven to be quite challenging for us thus far.

    In order to provide you with a clearer understanding of the situation, I have attached the relevant data in the appendix. You will find a screenshot highlighting the instances of double data. Here can been seen that only the calculated data is double.

    We use the library from the below link.

    https://gitlab.com/jousis/ads1232-library

    Further our calculations in the main software looks as following:

    ''weight = (double) tared_value / (double) cal_factor;
    mlt = powf(10.0f, 2);
    weight = roundf(weight * mlt) / mlt;''

    Given your extensive experience in this field, we kindly request your guidance in steering us in the right direction to resolve this issue. Any insights or suggestions you can offer would be immensely appreciated.

    Thank you very much for your understanding and cooperation.

    Best regards,

  • Hello Levi,

    I cannot tell where the problem occurs from the information provided.

    1.  The readings are constantly increasing.  Are these actual changes in weight, or an input ramp voltage creating the changes?

    2.  I cannot tell from the code what variable is printed for Raw Value.  Can you provide more of the code that shows the full printf statement, and the values and types (float, double, INT, etc.) for all of the variable used in the code provided?

    3.  If possible, please capture the ADS_DOUT, ADS_PDWN, ADS_SCLK, and ADS_SPEED waveforms. 

    Regards,
    Keith

  • Hello Keith,

    Thanks again for your fast response 

    1: Jes these are actual changes, but you can see that the weight is doubling and the raw data is not.

    2: see in the Wetransfer link the software we use to make the ADS calculations

    3: Unfortunately with the current pcb design we can not capture this data/

    In the ADS task of the main file you can find the code we use for getting the data out off the ADS.

    hopefully this makes it more clear for you?

    https://we.tl/t-HWKhdFjePY

    Waiting on your response

    Thank you

  • Hello Levi,

    I cannot use the file sharing service that you linked.  Please provide a screen shot of the relevant code.

    Regards,
    Keith

  • Hello Keith,

    I copied the relevant code into a word file. Please see the appendix.

    You can find in here

    - ADS task (read and calculate weight)

    - ADS1232.h (library)

    -ADS1232.c (library)

    ADS task.docx

  • Hello Levi,

    I am not certain from your code exactly what is causing the repeated results.  However, since the RAW ADC values are changing, this is likely related to the software.  I suggest setting the 'smoothing' variable to false in the 'initConfig' so that the readRaw returns the average ADC value.  

    Also, I do not see where the ScaleAverage variable is defined; this should be declared to a specific value, such as 4.

    Regards,

    Keith

  • Hello Keith,

    1: By setting the smoothing to 'false,' I was able to successfully resolve the problem. I really appreciate your assistance in this matter.

    However, I have noticed that with the smoothing turned off, the result is somewhat less stable. I'm considering whether it would be appropriate to make the 'false' and 'true' values variables that can be adjusted based on the algorithm. This way, the end user will only see a stable value and the smoothing will switch depending on what the machine is doing. Do you foresee any potential problems if we implement this approach?

    2 Scale Average we store in a variable. The range of this variable is from 1 to 5. During the machine's weighing cycle, we set the ADS speed higher. Conversely, when the user interacts with the machine, we set the speed lower. This strategy ensures that the scale appears stable and reliable to the end user.

    Thank you for your attention to these matters, and I look forward to hearing your thoughts.

    Best regards,

  • Hello Levi,

    I do not see any problems using the 'smoothing' function in some cases, and simply averaging for other cases.  This has no effect on the ADC performance, and is a firmware filtering method to provide a good balance between low noise and response time.  However, if you intend to use the smoothing function, then I suggest you reach out to the author of the example code, https://gitlab.com/jousis/ads1232-library, to better understand how this function works.

    Regards,
    Keith

  • Dear Keith,

    Thank you once again for your prompt response.

    Before we conclude our conversation successfully, I have one final question.

    Could you please confirm if Texas Instruments (TI) has developed libraries specifically for the ADS1232 that we can utilize?

    I appreciate your assistance.

    Kind regards,

    Levi

  • Hello Levi,

    Unfortunately, we do not have example code or libraries for this device.  However, there are many 3rd party examples, including the example code that you are using, that provide a good starting point to read the raw ADC values. 

    Regards,
    Keith