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.

ADS1255: PGA settings

Part Number: ADS1255

Hello!

I have trouble with PGA settings to the desire value, during conversion. What I'm able to do is changing a PGA during measurement, in order to satisfied the large dynamic range - V to couple of uV. Till now I have successfully initialize the adc, set the data rate, pga and adc gives me the expected result.  

My question is how to change the PGA, if adc is already initialized. I have tried to set adc to standby mode and after wake up command initialize with different pga setting, which doesn't work.

So, whats the proper way to changing pga during measurement? 

Thanks!

Best regards, Žiga

  • Hi Ziga,

    The command to change the PGA gain should be very similar to the commands used to initialize the device. However, instead of writing to multiple registers you can just write to the ADCON register if all you need to do is change the PGA gain. The command sequence for this would look like: 0x52, 0x00, <data byte>.

    Just make sure that the device is in SDATAC mode before attempting to write to the device registers. You may need to send the 0x0F command before the WREG command sequence shown above.

    After changing the PGA gain, you'll probably need to restart the ADC conversions. You can do this by sending the SYNC (0xFC) and WAKEUP (0x00) commands (as shown in Figure 19 of the datasheet). This makes sure that the next result is settled and correctly represents the new value with the updated PGA gain. 

    By chance, do you enable auto-calibration during initialization? If so, then keep in mind that changing the PGA gain will trigger a calibration and you'll need to wait for the calibration to complete (/DRDY will go low) before doing anything else.

    Best Regards,
    Chris

  • Before answer to my question, I tried a couple of thing and find the following solution. Sending the SYNC and WAKEUP command first and then command to change PGA works! I don't know why but it's working properly now. Is this a good practice or I should change to this sequence: SDATAC -> PGA_change -> SYNC -> WAKEUP ?

    I'm not reading data continuously, so why should issue SDATAC command? 

    Auto-calibration is off. 

    Thanks!

    Best regards, Žiga

  • Hi Žiga,

    Previously, were you attempting to send the WREG command around the time when /DRDY would normally go low?

    It might be possible that sending a WREG command at that time would not take effect...That's the only explanation I can think of for why sending SYNC and WAKEUP first would correct this issue. By restarting the ADC conversion and then sending WREG, you are ensuring that WREG does not take place while the device is updating the data in the output shift register. I'm not aware of this being an issue with the device, but I'll look into it to see if this is what is really happening.

    You might also try waiting until /DRDY goes low before sending the WREG command. If the issue is related to the timing of /DRDY going low, then this would also work to ensure that WREG does not occur while the data are updated. Please let me know your findings if you try this!

    Regarding SDATAC, I would just recommend sending it as the first command (as a best practice) just to ensure the device is in this mode before attempting to write to the registers.

    Best Regards,
    Chris

  • Hi,

    Previously, were you attempting to send the WREG command around the time when /DRDY would normally go low? Yes, I tried this, but it wasn't work. 

    Now I read data continuously  and when changing PGA, I send first SDATAC command, then change pga command and it's working properly. Of course after pga change command, I also send SYNC, WAKEUP and SEFLCAL commands. 

    Thank you for your time!

    Best regards, Žiga

  • I have one more question about changing pga settings. Having a 1.25 V reference I've calculated a maximum input voltages for all possible PGA settings. Input voltage range is from V to a couple of uV, so it's necessary to change the pga in order to achieve the highest accuracy.

    The question is when to change the pga for the accurate measurement? Is it the best to change it at 1/2 of maximum input voltage or at 2/3, or at 1/3?

    Thanks!

    Best regards, Žiga
  • Hi Žiga,

    I'm glad the WREG issue is resolved!

    Regarding when to change the PGA gain, I think it depends on what type of performance matters most in your application...

    In general, using the highest gain that you will give you the best accuracy and resolution (up to a point). There is usually a certain limit to how much gain you can apply before noise performance (and likely accuracy as well) no longer improves. Since the PGA contributes gain error and noise to the measurement, you'll see these effects more and more as the gain is increased, until the gain error and PGA noise become the dominate sources of error in the system.

    The trade-off to increased resolution is that the ADC's dynamic range will be decreased (since the input range is exactly halved, but the input-referred noise is not quite halved, for each 2x increase in gain).

    If the continuity or linearity of the measurements is most important to you, then I might suggest using a lower gain where you don't need to switch gains as often, as you'll notice a different gain error each time you change the input range. Many times it's easier to apply additional filtering or post-processing to correct for the noise; where as trying to correct for linearity issues is not straight-forward.

    I know that doesn't directly answer your question, but I hope it provides some useful information that will help your decision.

    Best regards,
    Chris

  • Hello!

    I have implemented the continuous reading from ads1255 and changing a pga during measurment. All working properly except one thing: the ads1255 gives me two incorrect results, after changing a pga. After these two, results are correct. 

    My question is, If i driving the ADC wrong or is this the price of changing the pga during measurments? Therefore it takes about 10 seconds to get data with new pga. Of course there is self-calibration process witch takes 1.3 sec.

    Sample rate is 2.5 SPS. 

    Best regards, Žiga

  • Hi Žiga,

    To the ADC, changing the gain will have the same effect as an input step. For a SINC filter, you will see the input step response described here:

     

    Are you performing a synchronization after changing the PGA?

    Changing the ADC's gain may require a few conversion periods for the digital filter to settle (see table 15 in the datasheet). Synchronizing the ADC clears the digital filter and delay's the /DRDY signal until data is settled (so that you don't need to discard any data).

    NOTE 1: Synchronization will only slightly speed up the settling time as 1-5 conversions periods are still needed for the digital filter to settle; however, it stops the current conversion so that you don't need to wait for the current conversion to complete.

    NOTE 2: If not performing a synchronization, you may need to add 1 additional conversion period to the values listed in table 15, as the table 15 assumes that the input step change occurs at the beginning of a conversion. However, if the input step change occurs during a conversion, you'll need one additional conversion before the data are fully settled. 

     

    Is you input signal changing and do you have an RC filter or other filtering in front of the ADC?

    The ADC's digital filter settling time will be in ADDITION to the settling time required by any external circuitry. Therefore, if you have a large RC filter on the inputs and you input signal changes, you may notice that the data requires additional time to settle (to allow for the capacitor to charge). 

    If you're able to share your data, I might be able to help determine what type of settling issue you're encountering!

    Best Regards,
    Chris

  • Are you performing a synchronization after changing the PGA? Yes, I am. After changing the pga, SYNC, WAKEUP and SELFCAL commands are issue (in that order) and then delay for 1.8 sec (for self calibration), as described in the datasheet for sample rate of 2.5 SPS.

    Is you input signal changing and do you have an RC filter or other filtering in front of the ADC? Input is not changing, as it is under test, for now. Yes there is RC filter in front of the ADC. I will consider the additional time to settle in the future.

    I managed to correct problems. 

    Thank you!

    Best regards, Žiga

  • Hi Žiga,

    I'm glad you were able to resolve the issue! Out of curiosity what ended up being the solution?

    Please let me know if there are another other questions or issues I can help with!

    Best Regards,
    Chris