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/ADS127L01: Errors in some reading with ADS127L01

Part Number: ADS127L01

Tool/software: TI C/C++ Compiler

we are using ADS127L01 and raspberry pi B3 in our design for a DAQ measurement system. The ADC works is working fine but in Some reading up the device is reading constant value 7FFFFF irrespective of the input variation.This issue is causing lot of trouble in our system.Please help us on this.The powerdown pin recommendation is followed in the firmware.Please share any other fix that could solve the issue

public async Task<bool> Connect()
                {
               SpiController spiController = await SpiController.GetDefaultAsync();
                var settings = new SpiConnectionSettings(0)
                {
                    ClockFrequency = 16000000, // TODO! Investigate this number!
                    Mode = SpiMode.Mode1,
                   DataBitLength = 8
                    
                };

                _ADS127L01 = spiController.GetDevice(settings);
                GPIO_INIT();
                GPIO_Set(HRPin); //HR =1
                Delay(0x1fff);
                Set_PGA(2);//0:gain = 2.02//1:gain = 6.6//2:gain = 13.2
                Set_Filters(2);///0:64K 1:128K 2:256K 3:512K
                Delay(0x1fff);
                ADS127L01_INIT();
                Delay(0x1fff);
                GPIO_Set(StartPin);
                return true;
           }

       
 void ADS127L01_INIT()
        {
            GPIO_Set(Cs0Pin);
            Delay(0x1fff);
            GPIO_Reset(Cs0Pin);
            Delay(0x1fff);
            GPIO_Set(ResetPin);
            Delay(0x1fff);
            GPIO_Reset(ResetPin);
            Delay(0x1fff);
            GPIO_Set(ResetPin);
            Delay(0x1fff);

            WriteRegister(_ADS127L01, 0x41);
            WriteRegister(_ADS127L01, 0x05);//REG NUM-1
            WriteRegister(_ADS127L01, 0x02);//conf1
            WriteRegister(_ADS127L01, 0x00);//OFC0 DEFAULT
            WriteRegister(_ADS127L01, 0x00);//OFC1 DEFAULT
            WriteRegister(_ADS127L01, 0x00);//OFC2 DEFAULT
            WriteRegister(_ADS127L01, 0x00);//FSC0 DEFAULT
            WriteRegister(_ADS127L01, 0x80);//FSC1 DEFAULT
        }
      
public async void Start()
       {
           Task t = new Task(() =>
           {
           while (true)
           {
            double Sample = readADC();
            Sample = ((Sample / 8388607) * 2.5) * (3 / 6.6);
            Debug.WriteLine(Sample);
           }
           });
            t.Start();
           }

private int readADC()
       {
           byte[] receiveBuffer = new byte[3];
           while (DRDY.Read() == GpioPinValue.High) { }               
          _ADS127L01.Write(new[] { Command.ReadData });
          _timing.WaitMicroseconds(6);
          _ADS127L01.Read(receiveBuffer);
           uint result = ((uint)receiveBuffer[0] << 16) | ((uint)receiveBuffer[1] << 8) | receiveBuffer[2];
           if ((receiveBuffer[0] & 0x80) != 0)
           {
               result |= 0xFF000000;
           }
            return unchecked((int)result);
           }

  • Hello Sufian,

    Can you provide the settings for all of the IO pins, or a partial schematic that shows all connections to the pins?

    I assume you are using the WB filter at 250ksps.

    Filter0, Filter1 tied low, or GND.

    Whenever you reset the device, you will need to wait for the filter to settle, which will take 84 conversion cycles, or 84*1/Fs=336uS.  Please confirm that your delays are long enough to account for this time.

    Also, since you mention that it works most of the time, I suspect there is a timing requirement that is not being bet during the conversion reading.  Please send a waveform picture showing /CS, /DRDY/, SCLK, and DOUT.  (DIN should be held low during a conversion read).

    Also, please confirm that you have a clean, continuous 16MHz clock on the CLK pin of the device.

    Regards,
    Keith Nicholas
    Precision ADC Applications