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.

ADS131E06: Corrupted data with RDATA command

Part Number: ADS131E06


We are attempting to use the RDATA command from a ColdFire V1 to a single ADS131E06 without monitoring the DRDY signal; monitoring this signal would add considerable complexity into the system and we are willing to accept there will be timing jitter in the results. The ADS131 is using the internal oscillator (2.048 MHz) and an external reference. The chip is configured at power up (RESET, SDATAC, CONFIG1 = D2h, D4h, or D6h, START, all timing constraints duly observed).

We issue the RDATA command at about 1 msec intervals. However, we occasionally see corrupted data values returned by the RDATA command. Most of the time, the value of all channels are corrupted, but occasionally, it seems that only the data in some channels is corrupted (on these rare cases, no observed pattern of which channels). The corruption can take almost any form; there is no discernible pattern to the erroneous data. For example, it is not just a matter of bits being shifted one way or the other. The four most significant bits of the status register are always correct (the rest of the status register is currently ignored). Changing the output data rate (in CONFIG1, register 1, bits 0-2) changes the frequency of the observed errors. When the rate is set to 1 ksps, we see an average error rate of about 1 in every 128000 queries. At 4 ksps, the rate averages about 1 in every 26000 queries. At 16 ksps, the rate averages about 1 in every 7000 queries. These values are averaged over many minutes with millions of queries (again, the queries are at a 1 kHz rate); there is no observable pattern to when the errors occur.

While this chip shares a SPI bus with other chips, all other chips have been disabled during this testing. SPI bus speeds between 1 MHz and 13 MHz have been tested with no apparent influence on the frequency of the corrupted data. Delays have been added to ensure that tCSSC and tSCCS are many times longer than the minimums in the data sheet (delays of about 10 usec were tested); the additional delays seemed to have no effect on the rate of erroneous data being returned (it is believed that the original timing already met the minimum delays). Some tests have read registers 00h through 00Ch immediately before issuing the RDATA command; the returned register values are always the expected values, even when the immediately ensuing RDATA command yields corrupted data.

The same error rate has been observed when the normal input is selected in the MUX of each channel (CHnSET register bits 0-2) as well as when the MUX is set to use the shorted inputs (value = 001). Most tests have been performed with the MUX selecting the shorted input. As we are in very early testing, we are in a benign electrical environment; there have been no noise issues with the rest of the system (including other chips on the same SPI bus).

With the SPI parameters making no apparent difference in the reported error rate, along with the reported register values always being the expected values (and almost all of the data values seeming to be correct), I do not believe that there is an issue the with SPI bus or configuration.

The correlation between the output data rate of the ADS131 and the error rate lead me to believe that there is some other timing-related issue with when the RDATA command is issued. According to section 9.5.3.10 of the data sheet (p. 37), there are no restrictions on when the RDATA command can be issued (unlike using the RDATAC command, which must avoid an area near DRDY falling). In fact, the following quote is from that section:

RDATA is best suited for systems where register settings must be read or the user does not have precise control over timing. Reading data using the RDATA command is recommended to avoid data corruption when the DRDY signal is not monitored.

However, the same section recommends that DRDY go low before issuing the RDATA command, making me wonder if there is a keep out zone, similar to the RDATAC command, where issuing the RDATA command may return corrupted data. Looking at the observed error rates, it would seem to be about 16 * tCLK cycles.

Can you tell me if there is a keep out zone for the RDATA command, or give me other ideas about what may be going wrong?

Thank you very much for your assistance.

  • Hi Brian,

    Welcome to our e2e Forum! Just for completeness, can you provide the rest of the register settings you are using for the ADS131E06?
  • Tom -

    The following register values would have been set/read for many of the tests. Output data rate in CONFIG1 was sometimes changed, and the PGA gain in various CHnSET may have also been changed in a few tests.

    ID: D1h
    CONFIG1: D4h
    CONFIG2: E0h
    CONFIG3: 41h
    FAULT: 00h
    CH1SET: 11h
    CH2SET: 11h
    CH3SET: 11h
    CH4SET: 51h
    CH5SET: 11h
    CH6SET: 11h
  • Thank you Brian. With the input shorted configuration, can you tell use what the returned values are during the portions of your tests when you see the errors? There are no restrictions on the issuance of RDATA command that I am aware. Is /CS being held low through the entire read cycle?
  • /CS is being held low during the entire RDATA command:
    1. /CS is set low
    2. 12h is written to SPI
    3. 21 bytes are read in from SPI
    4. /CS is set high.

    Here are some sample values, using the input shorted configuration, that have been read clearly containing errors; this has been interpreted as two's complement, sign + 23 bits, per section 9.5.1 of the data sheet, channel 1 through channel 6:

    -3956896 -4019042 -8152 62033 -3873294 -887
    8387827 -932 -824 -907 -1047 -876
    -3932946 1252447 -31538 8388607 0 131199
    4193530 3144801 1047753 4193382 8387577 2094222
    8388607 17443 1047745 1047701 8388555 -787303
    2096370 1047650 -3670845 261250 2096101 8388607
    523501 -4195229 5242190 -115615 8388607 7404707
    8387822 523365 5242062 7787088 -1044 8387734
    8387821 5241969 -826 2096251 8387566 4193433
    2096373 -4195221 -4195125 -192 -6292502 8387738
    15 23786 -816 8388607 2096111 -881
    8388607 -941 -820 -934 8388607 8388607
    -1835196 -529857 8126335 -802 -1050 -1480576
    -2 1047644 490712 1047644 8387564 -874
    4160360 -840 -822 -808 -4194984 -131780
    8323071 8387711 -814 -230152 8388607 -1
    4193522 7339107 5242074 2096215 -4195346 -867
    1047799 -921 8388607 8388602 5242878 8388599
    -81 -917 8387793 -960 7741745 -551
    2153727 -8388608 128 -930 -1032196 -2556768
    -1 -920 6290638 -897 -1034 -890
    2096377 588897 -1 -253330 -4030472 7994511
    -3958040 -4021329 -8030 61684 -3873354 -924

    Here are some examples where I'm not sure if the values are wrong or if there are just some unusually high noise levels:

    -1805 -913 -827 -897 -1073 -816
    -74 -945 -823 -937 -10 -31
    -7 -909 -818 -897 -1031 -1

    Thanks for looking into this.
  • It appears that all of the RDATA reads containing corrupted data have a similar timeline, as shown in the attached scope shot.

    The top, yellow, trace is SCLK. The first burst is writing the RDATA command to the ADS131; the following bursts are reading each byte of data from the ADS131.

    The middle, pink, trace is /DRDY. Every example of corrupted data shows /DRDY falling between the read of the first byte of the status register and the second byte of the status register.

    The bottom, blue, trace is not of interest here; it is used as a trigger to capture the desired signals.

    I am still working to determine how much variation there is in the timing that separates good and corrupted reads. Since the microcontroller is not synchronized with the ADS131, all timing cases will be encountered sooner or later.

  • Hi Brian,

    Is it possible to zoom out a bit on that screen shot you captured? I am curious to see when DRDY went low before you issued the RDATA command and when it went low again after you started reading data. I am also assuming that those SCLK bursts each contain eight transitions, is that assumption correct? Is there any way you can reduce the low dwell time between SCLKs?
  • Tom -

    The ADS131 was configured for a 4 ksps data rate in that screen shot, so DRDY went low considerably before the beginning of the screen shot; the DRDY pin timing agrees with the expected sample rate quite well. As noted before, we only query the ADS131 every 1 msec, so there are three samples that will go unacknowledged in between every RDATA command. We set the ADS131 to the higher sample rate to reduce the phase lag of the digital filters, even though we're not able to use the data in an ideal manner.

    You are correct in your assumption that each SCLK burst contains eight transitions; this is a single byte being transferred (sorry, I should have mentioned that). Every instance of data corruption examined showed a very consistent timing pattern, with DRDY falling consistently in a roughly +/- 50 nsec window after the last falling edge of SCLK, as shown in the screen shot. A few examples of correct data were seen where DRDY fell between the first and second status register bytes, but those examples had significantly different timings (I never saw enough examples of good data to say how different the timing needed to be).

    As soon as I saw the correlation between the DRDY transition and the corrupted data, I started trying to influence the timing of the pauses between the SCLK bursts / bytes. I could reduce the length of the pause to about 1/3 or 1/2 of what I showed in the screen shot, but I cannot get it faster than that. I did not collect solid statistics on the rate of data corruption with that smaller pause, other than that it was still too high for our purposes. Significantly extending the pauses did not help any, and quite likely made the problem worse (to the surprise of no one); once again, I did not collect enough samples to have confidence in the rate. Changing the length of the pauses also changed the timing of DRDY falling relative to the last falling edge of SCLK, as well as the next rising edge of SCLK. In other words, I could not say that DRDY falling 600 nsec after the last falling edge of SCLK would cause corruption for all pauses, nor could I say that DRDY falling 1100 nsec before the next rising edge of SCLK would result in corruption for all lengths of pauses. As the length of pause changed, so too did the timing of concern.

    Over the weekend, I ran a fix whereby the microcontroller tracks the timing of the DRDY pin and, if it sees that there is some danger of hitting the timing that causes the corruption, it will pause before issuing the RDATA command and avoid the timing of concern (this is the simplest solution I could find, given the set of constraints we have). This fix ran over the weekend for more than 65 hours without detecting a single instance of corruption. In this same configuration without the fix, corruption was detected every 25 - 30 seconds on average, with about 2 or 3 minutes being the longest interval ever seen between corruption events. While I would prefer not to have to do this workaround, it is an acceptable fix in our application.

    I am interested to hear any thoughts you may have on all of this.

    Thanks!

  • Hi Brian,

    In the latest screen capture you sent, can you also tell us what SDO was for the first batch of SCLKs when DRDY went high the first time and then again what SDO was on the second instance? Did it output the status word twice?
  • Tom -

    I will get that information, but it will likely be late tomorrow before I can run that test.

    Thanks for continuing to help with this.
  • Tom -

    Here are the bytes received from the RDATA command. The first byte listed is received while sending the RDATA command byte (12h), so there is one more byte here than described in the data sheet response. I used a scope on a selection of responses to verify that the microcontroller was interpreting the incoming bytes correctly. You will note that the ADS131 always sends C0 while the RDATA command byte is being sent. The status register seems valid and doesn't seem to be repeated. With the configuration we have, I would not expect any bits in the status register to be set (other than the most significant pair of bits that are always set).

    For this data, the ADS131 was configured to use shorted inputs, at a 4 ksps rate. All other configuration is the same as was noted in an earlier post. The timing between 1-byte (8-bit) SCLK bursts would be the same as shown in the scope shot earlier.

    Here is a selection of responses believed corrupted:
    C0h C0h 00h 00h FFh FEh EBh FFh FCh 7Fh FFh FCh C9h FFh FCh 7Eh FFh FBh EBh FFh FEh 85h
    C0h C0h 00h 00h BFh FCh EEh 7Fh FCh 5Ch 0Fh FCh CEh 7Fh FFh EFh 7Fh FBh E5h 7Fh FCh 99h
    C0h C0h 00h 00h 3Fh FCh F3h 2Fh FCh 70h FFh FCh CCh 7Fh FFh FFh FFh FBh E7h 7Fh FFh FFh
    C0h C0h 00h 00h 7Fh FCh EFh 0Fh FCh 62h 4Fh FCh D3h 01h FCh 8Ch 00h 00h 01h 0Fh FCh A6h
    C0h C0h 00h 00h 03h FCh FFh 02h ECh 70h C0h FCh CAh 7Fh FFh FFh 03h FBh F4h FFh FFh FFh
    C0h C0h 00h 00h 7Fh FEh F3h FFh FCh 6Ah 1Fh FCh CEh 1Fh FCh 95h 7Fh FBh F3h 7Fh FEh 9Bh
    C0h C0h 00h 00h 3Fh FCh F8h 03h FCh 5Dh 07h FCh CCh 01h FCh 81h 0Fh FBh F2h 28h 08h 00h
    C0h C0h 00h 00h 1Fh FCh F2h 03h FCh 61h 0Fh FCh C8h FFh FFh FEh 1Fh FBh FBh 7Fh FCh A0h
    C0h C0h 00h 00h C0h 9Fh FFh FFh FCh 7Bh FFh FEh D5h FFh FCh 6Fh FFh 41h 14h FFh EFh AAh
    C0h C0h 00h 00h 8Fh FCh F0h 00h 00h 20h 01h FCh C9h 7Fh FFh FFh 77h FFh FFh 7Fh FFh FFh
    C0h C0h 00h 00h 00h 00h 00h FFh FCh 5Eh FFh FCh D6h FFh FCh 7Fh FFh FFh FFh 7Fh FFh FFh
    C0h C0h 00h 00h 3Fh FCh EEh BFh FCh 66h 07h FCh C5h 07h FCh 75h 07h FBh E1h 7Fh FFh FFh
    C0h C0h 00h 00h FFh FFh FFh 7Fh FCh 6Bh FFh FCh D5h FFh FCh 75h FFh FBh EAh FFh FCh FEh
    C0h C0h 00h 00h 1Fh FCh F0h 2Fh FCh 61h 0Fh FCh D3h 1Fh FCh 85h 5Fh FBh F2h FFh FCh 96h
    C0h C0h 00h 00h FFh FFh F8h FFh FCh 66h BFh FFh 98h FFh F9h 53h B7h 10h 90h 9Fh F8h ABh
    C0h C0h 00h 00h BFh FCh EFh 7Fh FCh 6Bh 4Fh FCh CEh 03h FCh 74h 7Fh FBh F4h 7Fh FFh FFh
    C0h C0h 00h 00h FFh E3h F7h FFh FCh 62h FFh FDh 75h FFh FCh 75h FFh FFh D3h FFh FBh 63h
    C0h C0h 00h 00h F9h 9Ch F2h B0h 01h 6Bh A7h FDh 4Dh 7Fh FCh 80h 7Fh FFh FFh 00h FCh 9Bh
    C0h C0h 00h 00h BBh FCh FEh FFh FCh B2h FFh FFh FFh FFh FCh 4Bh FFh FBh E7h FFh FFh 1Dh
    C0h C0h 00h 00h 00h 00h 09h FFh FCh 6Ch FFh FCh CDh FFh FFh EFh 7Fh FFh FFh 7Fh FFh FFh
    C0h C0h 00h 00h DCh 3Eh 31h BDh 95h 6Fh 7Fh AAh 6Eh FFh E1h 76h 7Fh FEh 6Eh FFh FCh A2h
    C0h C0h 00h 00h 1Fh FCh EBh 07h 5Ch 22h 0Fh FCh D0h 7Fh FFh FFh 1Fh FBh F3h CBh FCh 98h
    C0h C0h 00h 00h 7Fh FFh FFh FFh F9h 61h FEh A5h C3h FFh FFh 68h 08h 86h C0h FFh FCh 93h
    C0h C0h 00h 00h B3h 7Eh 7Bh FFh FCh 5Dh FFh FCh A4h FFh FCh DBh FFh F9h AAh FFh FDh C9h
    C0h C0h 00h 00h 7Fh FCh FFh 7Fh FCh 64h 7Fh FFh FFh 1Fh FCh 7Bh BFh FBh E5h FFh FCh 96h
    C0h C0h 00h 00h 01h BDh F0h 7Fh FFh FFh FFh E6h D5h E3h FCh 8Dh FCh 3Ch 75h 00h 00h 02h
    C0h C0h 00h 00h 3Fh FCh EEh 02h FCh 5Dh 07h FFh F3h 01h FCh 89h 0Fh FBh E5h FFh FCh FEh

    For reference, here are some responses that are believed good, from the same data set:
    C0h C0h 00h 00h FFh FCh FBh FFh FCh 68h FFh FCh D3h FFh FCh 82h FFh FBh F1h FFh FCh AAh
    C0h C0h 00h 00h FFh FCh E4h FFh FCh 64h FFh FCh CBh FFh FCh 84h FFh FBh EEh FFh FCh 9Bh
    C0h C0h 00h 00h FFh FCh EEh FFh FCh 70h FFh FCh C8h FFh FCh 78h FFh FBh E4h FFh FCh 9Fh
    C0h C0h 00h 00h FFh FCh F5h FFh FCh 58h FFh FCh CEh FFh FCh 85h FFh FBh F3h FFh FCh 93h
    C0h C0h 00h 00h FFh FCh F0h FFh FCh 68h FFh FCh CBh FFh FCh 79h FFh FBh F1h FFh FCh A2h
    C0h C0h 00h 00h FFh FCh FEh FFh FCh 69h FFh FCh D0h FFh FCh 77h FFh FBh ECh FFh FCh 96h
    C0h C0h 00h 00h FFh FCh EFh FFh FCh 64h FFh FCh D4h FFh FCh 80h FFh FBh EFh FFh FCh A3h
    C0h C0h 00h 00h FFh FCh F8h FFh FCh 63h FFh FCh C1h FFh FCh 7Dh FFh FBh E7h FFh FCh A4h
    C0h C0h 00h 00h FFh FCh F7h FFh FCh 68h FFh FCh CBh FFh FCh 8Ah FFh FBh E6h FFh FCh 92h
    C0h C0h 00h 00h FFh FCh F5h FFh FCh 61h FFh FCh C5h FFh FCh 7Ah FFh FBh F3h FFh FCh A3h
    C0h C0h 00h 00h FFh FCh F5h FFh FCh 7Ah FFh FCh D0h FFh FCh 7Fh FFh FBh EBh FFh FCh 93h
    C0h C0h 00h 00h FFh FCh E4h FFh FCh 66h FFh FCh C1h FFh FCh 81h FFh FBh EAh FFh FCh 9Dh
    C0h C0h 00h 00h FFh FCh F8h FFh FCh 61h FFh FCh C9h FFh FCh 8Ah FFh FBh F2h FFh FCh 99h
    C0h C0h 00h 00h FFh FCh E9h FFh FCh 67h FFh FCh CFh FFh FCh 84h FFh FBh EFh FFh FCh 90h

    Let me know if there is any more information I can provide.
  • With Tom's help offline, this was tracked down to /DRDY falling within 3.4 usec of the RDATA command being issued, and the status register not being completely read by the time /DRDY falls. This time is approximately 8 * tCLK (or 2 * tUPDATE), as we are using the internal fCLK of 2.048 MHz. It is not clear that meeting this timing always corrupts the results, but corrupted results were never seen unless this timing was met.

    There are two effective workarounds; (1) delay issuing RDATA until /DRDY has fallen, or (2) reissue RDATA if /DRDY falls before the status register is read. Quite likely, being fast enough to read the data is also effective.

    Many thanks to Tom for all of his help!