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.

ADS1281: How to calibrate ads1281?

Part Number: ADS1281
Other Parts Discussed in Thread: ADS1282

We use stm32f103 spi to control and read ads1281. When calibrate ads1281 ofc register with shorting the analog input, I send below command series and then begin to read data. It seems diffrent to ads1281 EVM.

SDATAC RDATAC SDATAC  OFSCAL RDATAC


Now my questions:

1. Would you please provide the sample programs of ads1281?

2. How to calibrate ads1281 and How to read adc data?

Thanks.

  • Hi w w1,

    Welcome to the TI E2E Forums!

    Is the command sequence you showed what you are observing on the ADS1281EVM, or is that the command sequence you are currently using with the STM MCU?

    If you'd refer to Figure 51 in the ADS1281 datasheet, the command sequence for calibration should be:
    SDATAC, SYNC, RDATAC, (WAIT FOR /DRDY), SDATAC, OFSCAL, RDATAC, (WAIT FOR /DRDY)

    I'm not entirely sure why the device needs to be in RDATAC mode, but certainly the SDATAC commands are necessary to exit RDATAC mode to be able to send the SYNC and OFSCAL commands at all. The first time you wait for data ready you are ensuring that the digital filter has settled before performing the calibration.

    Alternatively, you could simple take a reading (or the average of multiple readings) with the inputs shorted and write this result to the OFC[2:0] registers. The OFSCAL command is optional.

    Unfortunately, I do not have any example code for the ADS1282; however, if you have additional programming questions we'll do our best to help you out!
  • Hi Chris,

    Thanks for your reply!
    Firstly, the command sequence mentioned following up is that I am using with STM MCU. We could not know the calibration process of ADS1281EVM.

    In this command sequence, "SDATAC, SYNC, RDATAC, (WAIT FOR /DRDY), SDATAC, OFSCAL, RDATAC, (WAIT FOR /DRDY)", after sending SYNC command, how long the /drdy remain high? If not interrupt mode, delay ?? ms to send RDATAC?

    Thanks!
  • Hi w w1,

    There is a timing diagram for the ADS1281 on page 6 of the datasheet and is also as shown below.  See the circled section.

    As shown in Figure 51, after the SYNC command the DRDY stays high for 64 data conversion periods.  After the calibration command DRDY stays high for 16 data conversion periods.  The conversion period will relate to the data rate selected and the oscillator frequency being used.

    Best regards,

    Bob B

  • Hello Bob,
    Thank you firstly!
    I tried the method you mentioned. For example, if the MCU read 0xfffa0437, I set OFC[0]=0x04, OFC[1]=0xfa, OFC[0]=0xff. Is this right?
    But then I read the input data, it is about +-50000.
    If I connect analog input + to 2.5V, analog input - to GND, I get 0x7fffffff. If I connect analog input - to -2.5B, analog input + to GND, I get 0x80000.
    It seems right.

    So, I am confused what caused this result?

    Thanks a lot.
  • Hi w w1,

    It is a little confusing what you have done as you have shown OFC[0] twice. To do the manual offset calculation, you must follow the instructions under the USER CALIBRATION section on page 29 of the ADS1281 datasheet. The offset calibration requires that you short the AINP and AINN inputs together. You also need to verify or set the OFC register values so that they are all 0 at the start of your series of conversions. Take several conversions and average the values together. You would then copy the results into the OFC registers.

    The OFC registers are 24 bits and not 32 bits. The value in the OFC registers are left-justified to the 32-bit value. When setting the value in the OFC registers, you start with the MSB value which is OFC[2]. The next byte is OFC[1] and byte 3 is OFC[0]. You ignore the LSB byte.

    If we use your example of 0xfffa0437, then OFC[2] would be 0xff, OFC[1] would be 0xfa, and OFC[0] would be 0x04. You would ignore the last byte (0x37). This value indicates a negative offset. The OFC value will be subtracted from the conversion result.

    The conversion result now becomes 0xXXXXXXXX (where XXXXXXXX is representing the conversion output value ) - 0xfffa0400. So when measuring a shorted input you should see something close to zero plus noise.

    Remember that the output code is binary 2's complement, so if you were to convert the value to decimal it would be a negative number. This then results in the conversion result - (-offset), which would actually add the OFC value to the conversion result.

    Best regards,
    Bob B