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.

Compiler/ADS1232: LIB ADS1232 FOR CODE C

Part Number: ADS1232

Tool/software: TI C/C++ Compiler

hello mr Bob,
i am mohammad , i start new project with ADS1232 for read data LOADCELL .
i use mogul ADS1232(wcmcu-1232)

i read pdf , this ADS for read data with can 3 pin

void ads1232_init(void)   
{      
        SCLK=0;   
            
        PDWN=0;   
          
        delay_ms(100);    
            
        PDWN=1;    
        
        delay_ms(1000);
           
        while(DOUT == 1){
         delay_ms(3);
        }   
          
        for(i = 0; i < 26; i++)                    //offset calibration   
        {   
               
            SCLK=1;   
                delay_ms(4);   
            SCLK=0;   
                delay_ms(4);    
        }
        
        delay_ms(810);    
}

long read_ads1232(void)   
    {        
        adc_val = 0;     
        
        while(DOUT == 1){;}
        delay_ms(4);
        
        for(i = 0; i < 24; i++)   
        {   
            adc_val = adc_val << 1;    
               
            SCLK=1;        //clk high
            delay_ms(4);  // min 100ns   
              
            if(DOUT == 1)  //data low /high  
            {   
                adc_val += 1;  
            }   
            SCLK=0;      //clk low
            delay_ms(4);     
        }
           
        SCLK=1; delay_ms(2);     
        SCLK=0; delay_ms(2);   
        //adc_val=adc_val-65532;
           
        return adc_val;         
    }

plase help me this run project .

thanks

  • Hi Mohammad,

    Welcome to the E2E forum! It appears that you are using a bit-bang of the GPIO to communicate to the ADS1232. I don't see anything in particular with the code that would be an issue, but the picture you sent of the breadboard circuit only has a few of the pins connected. It does not show the power supply or most of the digital pins connected. All pins must be connected and properly powered for the device to work. To get a meaningful output, you must have the load cell connected and powered as well as the 5V excitation that is connected to the load cell also connected to the ADS1232 reference inputs and AVDD supply. DVDD should match the micro communication supply which I assume is 3.3V.

    To verify your communication, you should connect an oscilloscope or logic analyzer to SCLK and DRDY/DOUT to verify that the scope output matches the data collected in your code.

    Best regards,
    Bob B
  • Hi Bob,

    I use Microprocessor atmega32 (+5) and conation ADS1232 with 2pin DOUT & SCLK.

    PIN CONFIGURATION:

    1. Digital Power Supply : +5v
    2. XTAL1 & XTAL2 : not use (I use internal clk)
    3. Pin TEMP : GND
    4. Pin A0 : GND (Channel 1)
    5. AINP1 & AINN1 : Connect to the load cell
    6. AINP2 & AINN2:GND
    7. REFN : GND
    8. REFP : +5v
    9. I select gain : GAIN1 & GAIN0 ,+5 (GAIN 128)
    10. Pin speed : GND (DATA RATE 10SPS)
    11. PDWN : Connect as figure 40. RC DELAY Circuit
    12. SCLK : control software
    13. DOUT : READ PIN with MCU

     

    AVDD=5V ,VREF=5V ,DataRate=10SPS , GAIN=128

    Hardware design :

    Best regards
    M.A

  • Hi Mohammad,

    At this point you need to verify that the ADS1232 is actually converting. Use an oscilloscope to monitor DRDY/DOUT and make sure that you see this signal line pulsing every 100ms. If you do not see this, then you have an issue with your supplies or grounds.

    After observing the pulse on DRDY/DOUT, attempt to read the data and capture the communication on the oscilloscope (SCLK and DRDY/DOUT signals). Send me the scope plots and the raw data you are seeing for your code result for comparison.

    Best regards,
    Bob B
  • Hi Bob,

    PIN CONFIGURATION WHIT Raspberry Pi :

    1. Digital Power Supply : +5v & +3.3V
    2. XTAL1 & XTAL2 : not use (I use internal clk)
    3. Pin TEMP : GND
    4. Pin A0 : GND (Channel 1)
    5. AINP1 & AINN1 : Connect to the load cell
    6. AINP2 & AINN2:GND
    7. REFN : GND
    8. REFP : +5v
    9. I select gain : GAIN1 & GAIN0 ,+3.3 (GAIN 128)
    10. Pin speed : GND (DATA RATE 10SPS)
    11. PDWN : Connect as figure 40. RC DELAY Circuit
    12. SCLK : control software
    13. DOUT : READ PIN with MCU

    please see DOUT & SCLK with logic analyzer :

    out put with Raspberry Pi :

    best

  • Hi Mohammad,

    Are you jumper wiring between the ADS1232 and the Raspberry Pi? It would seem as if the ADS1232 is not responding to your SCLK, which might indicate that there is not a good ground connection between the ADC and the MCU.

    Also, the SCLK will need to be fast enough to clock out 24 bits between conversions. Currently, your SCLK appears to a have a frequency of about 75 Hz. It will need to be 300 Hz or faster. I'd recommend aiming for at least 1 kHz.