• 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 » ADS1247 SPI problem
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 4 days 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 11 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 19 days ago
    by Bruce Trump
    Chopper op amps offer very low offset voltage and dramatically...

Forums

ADS1247 SPI problem

This question is answered
abc xyz
Posted by abc xyz
on May 15 2012 10:00 AM
Prodigy50 points

Hi there,

I found a very strange behaviour in terms of ADS1247 SPI communication, any TWO command string must be kept sending to ADS1247within 80ms otherwise ADS1247 return rubbish, for example I send command string: 0x2b 0x00 0x00, which is to read register 0xb(IDAC1), then I get a byte 0xff which is correct default value. However If I wait for 80ms then send exactly same command string again I end up with getting 0x00 from ADS1247. If I constantly send command string within 80ms ADS1247 always returns 0xff. Is this real behaviour or something I got wrong?

Thanks.

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 15 2012 12:19 PM
    Genius17435 points

    Hi,

    The device has two modes of operation: Read data continuously (RDATAC) and Stop reading data Continuously (SDATAC).  The device is by default on the RDATAC mode converting at 5SPS (200ms).  When the device is in RDATAC mode, the output will provide conversion results as the first 24 SCLK's are been fed through.

    It is possible that the device is in the RDATAC mode, and the device is still issuing the last byte of the conversion result when you are trying to read the register content.  In order to 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 command. 

    Please let me know if this does not solve the issue.

    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.
  • abc xyz
    Posted by abc xyz
    on May 15 2012 14:53 PM
    Prodigy50 points

    Thanks for your reply. I have tried your suggestion but it still doesn't work. To clarify my problem, I list my code below(to be easier for understanding, I list pseudo code):

    1.  Initialise my CPU(Atmel CAN128) SPI interface  as well as IOs for RESET, CS and START pins

    2. RESET pin low, START pin low, CS high

    3. Wait for 20ms(as requested in the datasheet)

    4. RESET pin high, START pin kept low

    5. CS low

    6. Send command string to read register 0xb from ADS1247: 0x2b, 0x0, 0x0 // also tried command string 0x16, 0x2b, 0x0, 0x0, return a correct value, which is 0xff

    7. After the last byte sent out, one byte data returned: 0xff, which has been verified that it is correct default value

    8. CS high

    9. Wait for 100ms, this is my application required

    10. CS low //start the second register reading

    11 Send the same command string as step 6, which is 0x2b, 0x0, 0x0 // also tried command string 0x16, 0x2b, 0x0, 0x0, return a incorrect value, which is 0

    12 CS high.

    P.S the twice try should give exactly same value 0xff however for some reasons it doesn't.

    I can't find any problem from the code above. I appreciate if you can point out any issue in my code.

    Thanks,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • abc xyz
    Posted by abc xyz
    on May 15 2012 16:02 PM
    Prodigy50 points

    Finally I found answer, my revised pseudo code to read register as below:

    1.  Initialise my CPU(Atmel CAN128) SPI interface  as well as IOs for RESET, CS and START pins

    2. RESET pin low, START pin low, CS high

    3. Wait for 20ms(as requested in the datasheet)

    4. RESET pin high, START pin kept low

    5. CS low

    very important  to be added here: START high

    6. Send command string to read register 0xb from ADS1247: 0x2b, 0x0, 0x0 //  return a correct value, which is 0xff

    7. After the last byte sent out, one byte data returned: 0xff, which has been verified that it is correct default value

    very important  to be added here: START low

    8. CS high

    problem fixed!!! but why? 

    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 May 15 2012 16:36 PM
    Genius17435 points

    Hi,

    The START pin can be used to control the conversions on the device.  Pulsing START can be used to trigger conversions; or the START pin can be hold high to configure the device to convert continuously.

    Setting the START pin low will put the device in sleep mode or power down mode. When the START pin is low,  only the RDATA, RDATAC, SDATAC WAKEUP and NOP commands can be issued.  You may refer to the SPI communication during sleep mode on page 37 of the datasheet.

    Thank you for letting us know that the issue was resolved,

    Best Regards,

    Luis

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • abc xyz
    Posted by abc xyz
    on May 16 2012 04:26 AM
    Prodigy50 points

    Sorry again, 

    I can't get it working reliably with the way mentioned in my previous reply, sometimes it returns unexpected value.

    What I'm wanting is farely simple, 

    1. get rid of sleep mode or something like power down mode, I just like the chip to work as normal

    2. set IDAC to 250uA to AIN0 and AIN1

    3. 5 SPS

    4. GAIN 128

    5. just using standard SPI interface, i.e. CS SCLK, SDO and SDI, do NOT use any other pins like START, RESET, DRDY

    how should I do?

    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 May 16 2012 11:39 AM
    Verified Answer
    Verified by Luis Chioye
    Genius17435 points

    Hi,

    I recommend placing 10k or 100k pull up resistors on the RESET pin and the START pin so they always default high.  The device offers a RESET SPI command, however, I personally always prefer to assign a  GPIO to control the RESET pin, since this may allow a more robust solution.   With the START and RESET pins pulled high,  the device will power up in the default condition in RDATAC mode,  PGA=1, data rate 5SPS, AIN0 to positive input, AIN1 to negative input, Internal Reference off and IDACs off. 

    - After the device supplies has been powered up and the controller has been initialized:

    1) Toggle the RESET pin low, and Release RESET high

    2)  Issue a WREG command to write the MUX1 register to turn on the internal 2.048V reference; enable the onboard reference for conversion; and to write the SYS0 register to set the device to PGA=128, 5SPS:

    x42013070h.

    (Note: In order to use the IDAC's; the internal reference must be tuned on; in this example the internal reference is turned on and also used for conversions)

    3)  Issue a WREG to configure the IDAC0 and IDAC1 registers: 250uA IDAC1 to AIN0 and the second IDAC2  to AIN1

    x4A010301h

    4)  If you want to read the registers, issue a Stop Data Continuous command first; so the conversion results are not mixed with the register values

    x16h

    5) For example, if you want to read the IDAC0 and IDAC1 registers;

    x2A01xxxxh 

    The device should return the IDAC0 and IDAC1 registers values.  Of course, you will need to set the CS pin low while the SPI commands are issued.

    If you continue to have issues, please provide oscilloscope shots of the CS, DIN, DOUT, SCLK pins while issuing WREG and RREG commands.

    Best Regards,

    Luis

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • abc xyz
    Posted by abc xyz
    on May 17 2012 06:40 AM
    Prodigy50 points

    It's working now!

    Many thanks for your help.

    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