Below is the link to three files I am using with a 32 bit ADC from TI, ADS1262, plus a link to it's datasheet. It works fine but I'm not getting any better voltage resolution than with a 16 bit ADC. I am using it for small voltage, from 0 to 0.070 volts. For example, for a known stable voltage of 0.01000 volts from a Fluke thermocouple calibrator I get 0.010000 to 0.010006. I get this same 0.000006 volt jitter if I short the ADS1262 input pins together. I suspect it may be a programmable gain amplifier issue. I can put 2.5 volts into it and not damage it. There is a line in the .ino file, #define PGA 1. On a guess, I changed this to #define PGA 32 but it had no effect on the results, it's like my attempted program change didn't take. I read in the ads1262 datasheet that the PGA Gain is in the MODE2 Register, address 05h. A gain of one is set with 000 and a gain of 32 is set with 101. But I do not know how to proceed. Perhaps somebody can help me out.

https://github.com/Protocentral/ProtoCentral_ads1262/tree/master/Libraries http://www.ti.com/lit/ds/symlink/ads1262.pdf

1 Answer 1


The symbol PGA appears in exapmle.ino (sic) twice, once each in lines 28 and 30:

 #define PGA 1                     // Programmable Gain = 1
 #define VFSR VREF/PGA

It is not used elsewhere in the example or the library code. The only effect of changing its value from 1 to 32 is to change the value of VFSR, and asVFSR appears only in line 30, that effect is nil.

Looking at the ads1262.cpp file from github, it appears that ads1262::ads1262_Init() initializes register MODE2 to 0x6, via:

ads1262_Reg_Write(MODE2, 0x06);

which per the ADS1262 spec sheet, page 93, table 44, enables the PGA and sets its gain to 1 and sets the sample rate to 60 SPS.

Apparently, if you wish to use some other gain setting, you should define PGA appropriately and put a corresponding setting into MODE2. For example, if you want to set up a gain of 16 and sample rate of 400 SPS, in setup() you could say

PC_ADS1262.ads1262_Reg_Write(MODE2, 4<<4 | 8); // 4=gain 16, 8=400 SPS

More generally, you could set up some constants for gain codes and SPS rates, and reference those constants when writing to MODE2. For example, after

enum { GainCode1, GainCode2, GainCode4, GainCode8, GainCode16, GainCode32 };
enum { SPSCode2p5, SPSCode5, SPSCode10, SPSCode16p6, SPSCode20, SPSCode50,
       SPSCode60, SPSCode100, SPSCode400, SPSCode1200, SPSCode2400,
       SPSCode4800, SPSCode7200, SPSCode14400, SPSCode19200, SPSCode38400};

you would say

PC_ADS1262.ads1262_Reg_Write(MODE2, GainCode32<<4 | SPSCode2400);

to set the gain at 32 and the sample rate at 2400 SPS.

(Note, enum is a C language element used to define integer constants. In an enum, each symbol mentioned without an explicit value has a value one more than the previous symbol, or zero if there's no preceding symbol. So GainCode1 is 0, GainCode2 is 1, GainCode4 is 2, etc.)

Note, to get better ultimate resolution, you may need to combine multiple readings, or may need to set the ADS1262's filtering parameters.

  • Yes! Adding PC_ADS1262.ads1262_Reg_Write(MODE2, 4<<4 | 8); did improve the voltage resolution. Thank you for taking the time to look at the linked material. Can you tell me how to set the gain to 32 instead of 16?
    – Rico
    Nov 30, 2016 at 1:57
  • @Rico, see edit Nov 30, 2016 at 5:54
  • I wish I could up vote this wonderful answer! Big help.
    – Rico
    Dec 1, 2016 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.