• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Data Converters » Precision Data Converters » Precision Data Converters Forum » ADS1248 result fluctuation
Share
Precision Data Converters
  • Forum
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
The Signal blog
  • $core_v2_blog.Current.Name

    Grounding Principles

    Posted 10 hours ago
    by Bruce Trump
    In a previous blog on supply bypassing , I cautioned that poor...
  • $core_v2_blog.Current.Name

    Handy Gadgets and Resistor Divider Calculations

    Posted 8 days ago
    by Bruce Trump
    Handy gadgets make our engineering life easier—the little...
  • $core_v2_blog.Current.Name

    Chopper Op Amps—are they really noisy?

    Posted 15 days ago
    by Bruce Trump
    Chopper op amps offer very low offset voltage and dramatically...

ADS1248 result fluctuation

ADS1248 result fluctuation

This question is answered
K H Tang
Posted by K H Tang
on Apr 23 2012 02:04 AM
Prodigy30 points

Guys, I need some urgent helps here. I am getting an unexpected result when reading ADS1248.

I have wired up ADS1248 to read a 3-wire RTD, as shown in Figure 3, Page 4 of this document: http://www.ti.com/lit/an/sbaa180/sbaa180.pdf

I have hard coded the register to read AN0(+) and AN1(-), I use VREFP1 and VREFN1 as rerference input. I use internal clock (CLK pin grounded), I connect RESET pin to VCC. I separated DRDY and DOUT pins.

My problem is I do not get the desired reading. I am getting randomly fluctuate values from zero to full scale. Furthermore, I do not seem to get 1 mA output to the channels, as I configured, it reads zero.

My simplied code is as shown below. I have verified that the SPI command routine works well (one of the evident is my readback values is the same as my write values, as shown within the code). So please assume SPI works well.

Further info, *sometimes* I am getting (on the oscilloscope ) a capacitor-discharing pattern at the end of the 24- reading pulses. This seems to be telling me that the ADC has not finished outputing data yet?

Can someone look at the following code and possibly tells me what is going wrong? Thanks in advance.

void reset(void)
{
    int i;
    char c[10], c1[10];

    /* to reset SPI */
    ads1248_write_low(RTD_CS_);
    for (i=0; i<5; i++){}
    ads1248_write_high(RTD_CS_);
    for (i=0; i<100; i++){}

    /* then issue RESET command to reset chip */
    ads1248_cmd(RTD_CMD_RESET, 0, 0, NULL);

    /* stop continue data reading */
    ads1248_cmd(RTD_CMD_SDATAC, 0, 0, NULL);

    ads1248_write_high(RTD_START);

    /* set IDAC to 1mA for 3-wire PT-100 */
    c[RTD_REG_IDAC0] = IMAG(6);
    /* connect AIN0 to IDAC1 and AIN1 to IDAC2 */
    c[RTD_REG_IDAC1] = RTD_MUX_CH0;
    c[RTD_REG_GPIOCFG] = c[RTD_REG_GPIODIR] = c[RTD_REG_GPIODAT] = 0;

    c[RTD_REG_MUX0] = RTD_MUX_CH0;
    c[RTD_REG_VBIAS] = 0;
    /* use internal oscillator, internal reference, onboard reference, normal operation*/
    c[RTD_REG_MUX1] = VREFCON_ON | REFSELT(1) | MUX_CAL(0);
    /* PGA=128, Sample rate = 5SPS */
    c[RTD_REG_SYS0] = RTD_PGA(5) | RTD_DR(1);

    for (i=0; i<15; i++)
    {
        /* skip calibration register */
        if (i>RTD_REG_SYS0 && i<RTD_REG_IDAC0)
            continue;

        c1[i] = ~c[i];
        while(c[i] != c1[i])
        {
            ads1248_cmd(RTD_CMD_WREG, i, 1, &c[i]);
            /* read back for verification */
            ads1248_cmd(RTD_CMD_RREG, i, 1, &c1[i]);
            if (i==RTD_REG_IDAC0)
                c1[i] &= 0x0f;
            /* debug */
            if (c[i] != c1[i])
                printf("c1[%d]=%02x\r\n", (int)i, (int)c1[i]);
        }
    }
}

void calibrate(int type)
{
    ads1248_cmd(type, 0, 0, NULL);
}

main()
{
    unsigned long ul;
    
    reset();
    calibrate(RTD_CMD_SELFOCAL);

    while(1)
    {
        /* check if conversion done */
        if (DRDY_PIN & RTD_DRDY_)
            continue;
            
        /* issue a READ command and read back to ul */
        ads1248_cmd(RTD_CMD_RDATA, 0, 2, (unsigned char *)&ul);
        
        /* issue a SYNC command to restart conversion*/
        ads1248_cmd(RTD_CMD_SYNC, 0, 0, NULL);
        
        /* print out ul */
        printf(reading=%ul\n", ul);
    }
}


ADS1248
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Luis Chioye
    Posted by Luis Chioye
    on Apr 23 2012 11:19 AM
    Genius17435 points

    Hi K H,

    If the IDAC is not giving you the programmed current 1mA output, it may be worthwhile to check if the internal reference is turning on by measuring the voltage at VREFOUT.. The VREFCOM pin needs to be connected to GND (or may be connected to AVSS).  What voltage are you applying to the Analog supplies (AVDD/AVSS)?

    Are you using the ADS1248EVM evaluation board or is this your own board? If you can post a schematic, showing the supply connections and the VREFCOM connection this will help. 

    I will look through your code to see if I can find any issues.

    Best Regards,

    Luis

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • K H Tang
    Posted by K H Tang
    on Apr 24 2012 04:07 AM
    Prodigy30 points

    Lius,

    Thanks for the reply. I have measured the VREFOUT as +2.5V, with VREFCOM connected to AVSS (which is shorted to DGND).

    Anyway, my routine now miraclely works. What I did was, I switched the registers writing order from register 15 to 0.. i.e.

    Instead of:

        for (i=0; i<15; i++)...

    I do this:

        for (i=15; i>=0; i--)...

    Can someone explain why is that so? This does not seem to be a documented feature... or I overlooked it?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Luis Chioye
    Posted by Luis Chioye
    on Apr 24 2012 15:46 PM
    Verified Answer
    Verified by K H Tang
    Genius17435 points

    Hello K H,

    Your previous description mentioned that you were not able to obtain 1mA out of the device and the results were fluctuating between zero and full-scale; which may be related to the internal reference not being turn on.  On the post above, you have mentioned that you have measured 2.5V from the VREFOUT pin, however, the internal reference of the device is 2.048V. 

    Can you please post a schematic?  The VREFOUT pin requires a bypass capacitor between 1uF to 47uF.  The internal reference should measure 2.048V.

    Can you post an oscilloscope plots of the SPI connections while reading the conversion results, and while writing the registers?  (SCLK, CS,  DIN, DOUT,  DRDY)

    Best Regards,

    Luis

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • K H Tang
    Posted by K H Tang
    on Apr 25 2012 05:16 AM
    Prodigy30 points

    Hello Luis,

    Here is the re-make version:

    Regarding the internal reference voltage of 2.5V, I am puzzled too. FYI, the system is designed for 3-wire RTD, which uses IDAC, and according to the document http://www.ti.com/lit/an/sbaa180/sbaa180.pdf, page 3:

    "The internal reference must be turned on for the IDAC to function, even though an external reference channel is used."

    Hence, I have turned on the internal reference (VREFCON=01) and selected REF1 input pair (REFSELT=01). I am not sure, in this case, whether it uses internal or external reference voltage. I am just blindly following the instruction given.

    UPDATE: I have added a capacitor of 2.2uF accross VREFOUT and VREFCOM as per your suggestion. It now reads 2.048V, with that I am getting a much more sensible and stable output, although I am still left with the question of why it works by reversing the registers writing order.

    Thanks for the help, much appreciated.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use