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.

ADS1262: ADS1262

Part Number: ADS1262

Hello 

The ADS1262 is reading successifully if the gain is 1 and the PGA is pypassed(MODE2 = 0x80) 
changing the MODE2 register  to any other value will result in noisy unpredictable results .
I want to use PGA = 32 .Please help.
attached is the liberar that I used to read the chip.

ADS126X.c
#include "ADS126X.h"
#include "stdio.h"
#include "ADC_Definitions.h"
#include "main.h"
#include "delay.h"



uint8_t ADS126X_recBuffer[7];
int adcenable_flag;

void ADS126X_soft_spi()
{    
	  START_0() ;
    RESET_1();
    CS_1();
    SCK_0();

}


//	TO DO  measure the timing

void ADS126X_DelaySCLK(uint8_t  clks)//debug
{
    uint16_t i;
    for (i = 0; i < 3 * clks; i++);//old value 3
}

void ADS126X_DelayDATA(void)
{
    delay_us(6);
}


void ADS126X_Send_8Bit(uint8_t _data)
{
    uint8_t i;
    ADS126X_DelayDATA();
    for (i = 0; i < 8; i++)
    {
        SCK_1();
        if (_data & 0x80)
        {
            DI_1();
        }
        else
        {
            DI_0();
        }
        _data = _data << 1;

        ADS126X_DelaySCLK(1);
        SCK_0();
        ADS126X_DelaySCLK(1);
    }
}

uint8_t ADS126X_Recive_8Bit(void)
{

    uint8_t i;
    uint8_t read = 0;
    ADS126X_DelayDATA();
    for (i = 0; i < 8; i++)
    {
        SCK_1();
        read = read << 1;
        ADS126X_DelaySCLK(1);
        SCK_0();
        read = read   | Read_DO();
        ADS126X_DelaySCLK(1);
    }
    return read;

}





void ADS126X_Init(void)
{
    ADS126X_soft_spi();
}


/* write a command to ADS126X1a02 */
void ADS126X_WRITE_CMD(uint8_t command)
{
    CS_0();
    delay_us(10);
    ADS126X_Send_8Bit(command);
    CS_1();
    delay_us(10);
}

/*****************************************************************************************
* Function Name: ADS126X_RREG
* Description  : Read Reg
* Arguments    : address: Reg Address�
* Return Value : Reg Value
******************************************************************************************/
uint8_t ADS126X_RREG(unsigned char address)
{
    unsigned char temp = 0x00;
    unsigned char receive = 0x00;

    temp = ADS126X_RREG_COMMAND | address; //0X20|REG
    CS_0();
    delay_us(10);
    ADS126X_Send_8Bit(temp);//001r rrrr, where r rrrr is the starting register address.
    ADS126X_Send_8Bit(0x00);//000n nnnn, where n nnnn is the number of registers to read �C 1.
    receive = ADS126X_Recive_8Bit();
    CS_1();
    delay_us(10);
    return receive; //�return reg value .
}


/*****************************************************************************************
* Function Name: ADS126X_WREG
* Description  : д�뵥��ADS126X1�ڲ��Ĵ�
* Arguments    : address:�Ĵ�����ַ  data:д������
* Return Value : ��
******************************************************************************************/
void ADS126X_WREG(unsigned char address, unsigned char data)
{
    unsigned char temp = 0x00;
    temp = ADS126X_WREG_COMMAND | address; //0X40|REG
    CS_0();
    delay_us(10);
    ADS126X_Send_8Bit(temp);  //001r rrrr, where r rrrr is the starting register address.
    ADS126X_Send_8Bit(0x00);  //000n nnnn, where n nnnn is the number of registers to read �C 1.
    ADS126X_Send_8Bit(data);
    delay_us(10);
    CS_1();
    delay_us(10);
}

/*****************************************************************************************
* Function Name: ADS126X_PowerOnInit
* Description  : ADS126X�ϵ縴λ
* Arguments    : NONE
* Return Value : NONE
******************************************************************************************/
int adcenable_flag;

void ADS126X_PowerOnInit(void)
{
    uint8_t RECEIVE = 0X00; //����spi���ص��ַ�
    uint8_t ID;
    ADS126X_Init();
    delay_ms(20);

    ADS126X_WRITE_CMD(ADS126X_RESET_COMMAND); //RESET ADS126X1

    ID = ADS126X_RREG(ADS126X_ID);
    //SET  MODE0
    ADS126X_WREG(MODE0, 0X10); //chopper enabled
    //SET  MODE2
    ADS126X_WREG(MODE1, 0X60); //Sinc4 mode

    //SET  MODE2
    ADS126X_WREG(MODE2, 0X90); //Positive:2.5SPS  /gain 2

    //SET  POWER
    ADS126X_WREG(POWER, 0X11); //Internal reference enabled (default)

    //SET  REFMUX
    ADS126X_WREG(REFMUX, 0X00); //Internal 2.5 V reference

    //SET  INPMUX
    ADS126X_WREG(INPMUX, 0X76); //Positive:7 Negative:6
//	  ADS126X_WREG(INPMUX, 0X54); //Positive:5 Negative:4

    //CHECK THE REGS
    RECEIVE = ADS126X_RREG(INPMUX);
    RECEIVE = ADS126X_RREG(MODE2);

    //Start ADC1 conversions
    ADS126X_WRITE_CMD(ADS126X_START1_COMMAND);

    adcenable_flag = 1;
}





void ADS126X_Start_ADC1() {
    START_1() ;
    ADS126X_DelaySCLK(4) ; //wait for 4 clocks
    START_0() ;
}




void ADS126X_Read_BUFFER_DATA(void)
{
    uint8_t i = 0;
    CS_0();
    for(i = 0; i < 7; i++)
    {
        ADS126X_recBuffer[i] = ADS126X_Recive_8Bit();
    }
    CS_1();
}


unsigned long ADS126X_Read_Value(void)
{
    unsigned long  value = 0;
    union
    {
        unsigned long voltage;
        struct
        {
            unsigned char frist;
            unsigned char second;
            unsigned char three;
            unsigned char four;
        } byte;
    } volt;


    while( DR_IS_HIGH());
		delay_ms(10);
    ADS126X_Read_BUFFER_DATA();

    volt.byte.frist = ADS126X_recBuffer[4];
    volt.byte.second = ADS126X_recBuffer[3];
    volt.byte.three = ADS126X_recBuffer[2];
    volt.byte.four  = ADS126X_recBuffer[1];

    value = volt.voltage;

    return value;
}













ADS126X.h

  • Hi Ahmed Shaaban,

    Have you confirmed that the register settings you write to the ADC are being received correctly by performing and RREG?

    What signals are you applying to the ADC? Please include the differential signal (AINP - AINN) as well as the absolute voltage on each pin with respect to ground.

    Are you sure you are selecting the correct channels to which you are applying the input signals?

    -Bryan

  • HI Bryan 

    thank you .
    Yes I confirmed the register settings .
    I am injecting voltge signal using Fluke 753 calibrator between AN7 and AN6 .
    I am leaving AN7 and AN6 floating  NO common voltage .
    Yes I am selecting the correct channel and when the PGA is disabled the ADC just work fine .

    Ahmed 

  • Hi Ahmed Shaaban,

    The PGA inside the ADS1262 has common-mode input limitations (see section 9.3.6 in the datasheet). Given the information you have provided, I believe the absolute input voltages from the Fluke output are not within the valid VCM range.

    Typically you want the common-mode of your input signal to be approximately at mid-supply ( [AVDD-AVSS] / 2). Can you please make sure your input signals abide by Equation 12 in the ADS1262 datasheet?

    Let us know what happens when you make these changes.

    -Bryan

  • Hi Bryan
    thank you.
    I have  connected the Negative side of the  input channel to 2.5 Voltage and the chip is working fine .
    Thank you for your help

    Ahmed

  • Hi Ahmed Shaaban,

    Glad we could help resolve your issue quickly!

    If you have further questions, please start a new thread and we will support you there

    -Bryan