• 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 » /etc... Data Converters » /etc... Data Converters Forum » ADS1246
Share
/etc... Data Converters
  • Forum
Options
  • Subscribe via RSS

Forums

ADS1246

This question is answered
Hamid Naseri
Posted by Hamid Naseri
on May 24 2012 11:45 AM
Prodigy140 points

I am workign with  ADS1246 data converter. Powering up the chip and using SPI bus I am able to read A2D data. I assume the defult register values allow the converstion take place and I do get reasonable conversition. I would like to write to SYS0 register, so that sampling rate is set to 160sps. I am having trouble with RREG and WREG commands though.   I am using Table 22's commands, however the wrting or reading part  when it comes to registers don't work.   I have tried different vlaues, yet,  when I read SYS0 register back I get 0. Your feedback and comments will be much appreciated.  My code follows. 

Thanks,

Hamid 


spi.write(0x43); // first command: write register SYS0 - address 03h
spi.write(0x00); // second command byte: 0000_nnnn (n is number bytes -1)
spi.write(0x05); // sys0: gain = 1 and 160sps
SYS0_reg1 = spi.write(0x23); // read register SYS0 - address 03h
SYS0_reg2 = spi.write(0x00);
pc.printf("sys0 regiter1 = 0x%X \n\r", SYS0_reg1);
pc.printf("sys0 regiter2 = 0x%X \n\r", SYS0_reg2);
bcs_reg = spi.write(0x00);
spi.write(0x20); // read register BCS - address 00h
bcs_reg = spi.write(0x00);
pc.printf(" BCS contains = 0x%X \n\r", bcs_reg);


while(1)
{
START1 = 1;
Va2d = Vcalculation();
pc.printf(" V= %f \r\n", Va2d);
START1 = 0;
//wait(1);
}

}

ADC a/d converters ADS8327 SPI
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 May 24 2012 19:28 PM
    Verified Answer
    Verified by Tom Hendrick
    Genius17435 points

    Hello Hamid,

    The ADS1246 device has two modes of operation: Read data continuously (RDATAC) and Stop reading data Continuously (SDATAC). 

    When the device is powered up with the START pin high and the RESET pin held high, the device is by default on the RDATAC mode converting at 5SPS (200ms).  When the device is in RDATAC mode, the DOUT output will provide conversion results as the first 24 SCLK's are been fed through. The RESET and START pins must be held high while issuing the RREG and WREG commands.  In order to be able to read register values, and avoid issues where the conversion results are being mixed with register values, you may issue first a SDATAC command (x16h) and then issue the RREG (x2300XXh) command when trying to read the SYS0 register.   

    Notice also that the Read operation is similar to the WREG operation.  The RREG is at least 3 bytes long where:

    1st RREG Command byte is 0010 rrrr where rrrr is the address;

    2nd Command byte is 0000 nnnn; where nnnn is the number of bytes -1

    3rd Byte and above:  Send NOP/dummy byte(s) to read register Data contents..

    In the code above, it appears you are missing the third NOP/dummy byte to read the register contents (?)

    After you have successfully read the register values, you may read the output conversion data by command (Issue RDATA x12h command) or configure the device back into the default Read Data Continuously mode by issuing the RDATAC command (x14h).  The RDATAC and SDATAC modes of operation are described on page 51 of the datasheet.

    Thank you and Best Regards,

    Luis



     

    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