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.

Second channel reading Problem

Other Parts Discussed in Thread: ADS1232, ADS1230

Hi,

I am using ADS1232, and in my project need to read both the channel one by one... if i am reading only one channel all the time,, weather it is 1st or 2nd,  i am getting propper count, but if i am changing the channel durring program, i am getting same result for the another channel,,

my sequence is like this

1. polling for DO to be low,

2.change the channel by Toggle A0

3.read all the 24 bit

4.give extra clock ulse,

5 .repeat from step 2.

plase tell me ,, if any another process required..

 

  • Rathod,

    This ADS1232 delta-sigma device has cycle latency which means that the digital filter takes several conversion cycles before it has settled.  You should discard at least the first 3 to 4 conversion results following the input change.  This is shown on page 3 of the datasheet in the Electrical Characteristics table under Digital Filter Settling Time.  Page 17 of the datasheet discusses Settling Time and shows diagrams of the settling time.  This also will occur with a step voltage change on the input even if the channel is not changed.

    Best regards,

    Bob B

  • I have take care for that also,,but still getting proble,

    My code is below..

    for(i=0;i<4;i++)
    {
          while(DOUT);  // polling for data line to be low..
         adc_val =Adc();
    }
    while(DOUT);
    adc_val =Adc();
    Chnl =0;
    sprintf(buffer,"%ld",adc_val);
    lcd_str(buffer,0x80);

    for(i=0;i<4;i++)   // after channel change ,, i am reading four reading...
    {
    while(DOUT);
    adc_val =Adc();
    }
    while(DOUT);  //5 th stabilized reading ..
    adc_val =Adc();
    Chnl =1;
    sprintf(buffer,"%ld",adc_val);
    lcd_str(buffer,0xC0);

    ..........

    but still working individualy best,, but if i change channel,, both channel data seems to be same...

  • Rathod,

    Can you give me more information/code?  I can't tell where or how you are actually telling the micro to change the A0 input on the ADS1232.  I see where you set Chnl, but where in your code do you control the port pin on the micro?  Is it in Adc()?  Is Chnl a global?

    Best regards,

    Bob B

  • yes ,,Chnl pin is globle ,,

    i can change the value of that pin by assign the value 0 or 1;

    in ADC routine i have written like this..

    unsigned long int Adc()
    {

    unsigned char i=0;
    unsigned long int temp = 0;
    CLK = 0;

    for(i=0; i<24; i++)
    {
        temp = temp<<1;
        CLK = 1;
        _nop_();
        _nop_();   
         CLK = 0;
          if(DOUT) temp = temp | 0x00000001;
      }
        CLK = 1;
        _nop_(); 
        _nop_();
        CLK = 0;
        temp = temp >>5;
        return temp;
    }

  • Rathod,

    Can you send me some scope shots of the communication (DOUT, SCLK and the Address pin)?  It would be helpful to see the timing relationship.  Is it possible for you to also send me your schematic?

    Best regards,

    Bob B

  • I dont have scope,, but i have used the same schamatic ,, given in the datasheet,...

    I am using 89c52 microcontroller and  my code runs at 1Mhz clock speed.. ,,

  • Rathod,

    Without more specific information, the only thing I can conclude is the Chnl command is not being issued for some reason.  I would analyze what is different about the code that individually selects the channel and how it is working in your current code.  I would also verify with a voltmeter that the address pin at the ADS1230 is actually toggling.

    Best regards,

    Bob B