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.

ADS1231: ADS1231 only return 0x800000

Part Number: ADS1231

Hello,

I don't understand what is going wrong. When the data line is ready I read 24 bits, but the value is always the same: 0x800000.

I enable AVDD voltage, wait 2 seconds to make sure voltage is okay, and wait 15useconds between measure and measure because od the update time.

Why am I getting this value??

This is my code:

void ads1231_on()
{
    DO_PIN_AVDD     = 1;     // Enable AVDD
    DO_PIN_ADS_PDWN = 0;

    __delay_ms(2000);
    
    DO_PIN_ADS_PDWN  = 1;  // Enable ADS1231
    DO_PIN_ADS_CLOCK = 0;
}

void ads1231_off()
{
    DO_PIN_AVDD     = 0;   
    DO_PIN_ADS_PDWN = 0;
}

int24_t ads1231_read()
{
    int24_t data      = 0;
    int24_t tmp       = 0;
    int8_t bit_shift;
    
    // Wait the IC to be ready
    while( (DI_PIN_ADS_DATA)==1 ){};
    __delay_us(100);

    // Read data
    for(bit_shift=23; bit_shift >= 0; bit_shift--)
    {  
        DO_PIN_ADS_CLOCK = 1;
        __delay_ns(200);
        
        tmp =  DI_PIN_ADS_DATA;
        tmp = (tmp << bit_shift);
        data |= tmp;  

        
        DO_PIN_ADS_CLOCK = 0;
        __delay_ns(200);

    }
 
    // Send Final clock signal to end transmition
    DO_PIN_ADS_CLOCK = 1;
    __delay_ns(200);
    DO_PIN_ADS_CLOCK = 0;
    __delay_ns(200);

    return data;
}

void main(void)
{
    setup();  // Setup IO
    
    int24_t value1;
    int24_t value2;
    int24_t value3;
    int24_t value4;
    int24_t value5;
    int24_t value6;
    int24_t value7;

    ads1231_on();

    while(1)
    {
        
        value1 = ads1231_read();
            __delay_us(15);

        value2 = ads1231_read();
            __delay_us(15);

        value3 = ads1231_read();
            __delay_us(15);

        value4 = ads1231_read();
            __delay_us(15);

        value5 = ads1231_read();
            __delay_us(15);

        value6 = ads1231_read();
            __delay_us(15);

        value7 = ads1231_read();
    __delay_us(15);


    }


}

Thank you!

  • Hi Daniel,

    It looks like you are using your controller to power the ADS1231 - interesting! Can you provide a schematic showing the rest of your ADS1231 connections?
  • Hi Daniel,

    Just a few general comments. First after powering the AVDD supply, and bringing the PDWN pin high, I would suggest that you pulse the PDWN pin again after the initial wait period to make sure the ADS1231 has properly reset and started.

    Second I would suggest that you wait longer than 15us between reads. You should monitor DOUT/DRDY for a transition from high to low on this pin. This signals that the ADS1231 has finished converting and new conversion results are ready to be read from the device. Depending on the SPEED pin setting, the ADS1231 will be converting at 100ms (10sps) or 12.5ms (80sps). So I doubt that new data are available when you start you initial read.

    So after you pulse the PDWN pin, wait in time for at least 4 conversions cycles to complete before attempting to read from the ADS1231 the first time.

    Also make sure the CLKIN pin is tied low, that there is a valid voltage reference supplied to the ADS1231, and that the input is within the input range of the PGA. 0x800000 is negative full-scale.

    Best regards,
    Bob B
  • Hi Daniel,

    I haven’t heard back from you, so I’m assuming you were able to resolve your issue. If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Best regards,
    Bob B
  • Thank you Bob,
    It was an electrical issue. Is currently working as expected =)
    Sorry because of mi late response.