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.

ADS1234: Sample code for self Offset calibration

Part Number: ADS1234
Other Parts Discussed in Thread: TS5A3166

Does TI have sample software for the ADS1234 self offset calibration? (page 20 of the spec)

Thanks,

Patrick

  • Hi Patrick,

    Unfortunately we do not have sample code for the ADS123x devices at this time.  This is on our todo list for this year, but that doesn't help you now.  Actually the ADS1234 is a relatively simple device to use.  All settings are by pin control.  To issue the self-offset calibration you need to transmit a minimum of 26 SCLKs.  If the micro you are using is byte oriented transfers you can simply send 4 bytes of SCLKs (for a total of 32 clocks).

    Other options are possible including bit-banging the GPIO to initiate 26 clocks.  In the end, the ADS1234 requires a minimum of 26 clocks to initiate the self-offset calibration.

    Best regards,

    Bob B

  • Bob,

    OK... That is what I have. 

    I have 4 load cells connected, and am using  4 TS5A3166 switches to each load cell to ground.

    I did a test today over temperature, and I saw no difference in the temperature error profile (heating and cooling the PCB only--not the load cells) with the software enabled, and with the software "snubbed out"

    That's why I wanted to double check the code.

    The processor is pwr_dwn'd ... then powered up..... wait 500mms, offset calibrated, then the data is gathered. and powered down.

    Patrick

  • Hi Patrick,

    Are you powering off/on the ADS1234?  One thing I recommend is controlling the PDWN pin with GPIO.  The PDWN pin powers down the ADS1234 to a low power state, but holds the offset calibration information.  Pulsing the PDWN pin also acts as a reset to the device and resets all of the internals of the ADS1234 except the offset calibration register.

    I also recommend using the PDWN with GPIO for initial power-up as well.  This pin must be held low for at least 10us after the supplies reach nominal operating voltage.  When powering off and on the device, there can be an issue where the POR circuit does not work as expected due to residual charge left in the device if the off/on cycle is too quick.  Using a pulse of high-low-high on the PDWN will reset the device similar to the internal POR circuit.  However, as I already stated, the offset calibration register in the device will not be reset.  This can only be reset by using the self-offset calibration.

    Best regards,

    Bob B

  • Bob,

    When an offset calibration is performed in the ADS1234

    1.) Do I need to select a channel??

    2.)  Just do 26 + clocks 

    3.) and  is the offset is complete  on all 4 channels?

    or

    4.) If I do need to select a channel, do I need to select all 4 channels?

    Patrick

    PS sure wish we had example code!

  • Hi Patrick,

    The A0 and A1 pins must have a valid state applied to the pins as these are the mux selection pins for the desired channels.  Also the remaining digital input pins (Gain, PDWN, and Speed) must have a valid a state applied.

    The offset calibration itself will disconnect the mux input and apply and internal short to correct for offset of the PGA and ADC.  So the most important thing here is that the reference has fully settled before issuing the self-offset calibration.

    1.) Do I need to select a channel?? [Bob] There should be a valid input channel selected as this is a digital input and should not be left floating.  It doesn't matter which is selected as the calibration is conducted with an internal short.  However it is important that the gain pins be set to the desired PGA gain settings that will be used.  Also, a settled reference is important.

    2.)  Just do 26 + clocks [Bob] Yes, just sending 26 SCLKs will initiate the self-offset calibration.  This calibration corrects for the ADC itself and not the system.  Also, the self-calibration can be issued at any time.  For example, you may wish to issue the self-offset calibration following power-up and perhaps periodically as the ADS1234 operating temperature may vary over time.

    3.) and  is the offset is complete  on all 4 channels? [Bob] Again, this calibration is independent of the input channels, so it doesn't matter which inputs are selected.  Some ADCs offer a system calibration, but the ADS1234 does not have this feature.

    or

    4.) If I do need to select a channel, do I need to select all 4 channels? [Bob] A channel should be selected so as not to have a floating input, but as stated above the channel selection will not affect the outcome.

    Best regards,

    Bob B