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.

ADS1248 - communication issue

Other Parts Discussed in Thread: ADS1248

Hello,

I am encountering some problems with the SPI interface to the ADS1248.

SETUP:

The part ADS1248 is connected to the FPGA, so I am able to fully control timings of the interface. The interface is (normally) running at 1MHz, 50%duty cycle, there is plenty of setup/hold time. In general I am able to communicate with the converter, set-up the registers, read-back the data correctly.

The problem is when there is performed the write register (WREG) command to two registers in a row (second parameter =0x01 so two consecutive registers are being written). I am executing the write command to two registers:

0x0A (IADAC0 to select a value of a current source) and to

0x0B (IADAC1 to select a destination of a current source)

The (example) frame looks as follows (DIN pin): 0x0A 0x01 0x09 0x2F (Address, N-bytes, Data1, Data2)

PROBLEM:

The problem is that the Data2 does not (always) reach the destination (register 0x0B)

1) Readback value of that register is not the same as written (readback is a default value of 0xFF instead of written 0x2F).

2) IDAC current is not present on the component pin (Vref previously enabled). The first register 0x0A is written with the correct value.

OBSERVATIONS:

When executing two separate write commands: one to the register 0x0A and the second to the register 0x0B it works as expected.

When SPI interface runs at 1MHz, sometimes the write command gets accepted, when it runs faster then 1MHz it is never accepted

When SPI interface is slowed down to about 600kHz the double write command is accepted, (that really worries me)

Adding some idle time (tested up to 24us) between bytes does not help

SCLK signal observed using a scope (at the ADC input pin) is clean and monotonic, setup and hold times are satisfied

QUESTIONS:

Is there any restriction of witting to two registers using a single WREG command?

Thanks,

Robert

  • Robert,


    Assuming that the oscillator frequency of the ADS1248 is greater than 2MHz (since the SPI is running at 1 MHz), you shouldn't have a problem writing two registers with one command.  

    I wrote a blog earlier this month talking about debugging digital communications, you can find it here:

    e2e.ti.com/.../help-i-can-t-talk-to-my-data-converter-what-s-wrong

    There might be something in there to help you out.

    I would first get an oscilloscope or a logic analyzer and look at the digital communications. At this point, I think you really need to see the digital lines coming out and make sure that they match up with the timing diagrams in the datasheet.

    My suspicion is that you have something wrong in the SPI communications, such as a /CS going high when you don't want it to, or you have the wrong version of SPI (you want to make sure that the SCLK dwells low, and that the DIN is clocked in on the falling edge of SCLK).

    If you still can't see the problem, get the scope shots and post the pictures back here.


    Joseph Wu

  • Robert,

    One thing that was pointed out by a colleague is that he's seen a similar problem when the timing for tsccs is violated. This would be the time from the final SCLK falling edge to the rising edge of /CS. Check that timing specifically to be sure.


    Joseph Wu

  • Hi Joseph,

    thank you for your help.

    The ASD1248 on our board runs with the internal oscillator, 4.096MHz +/-tol. Anyhow, can you please explain why in your opinion the SPI SCLK shall be two times slower than the chip oscillator frequency. In the ADS1248 datasheet the SCLK minimum period is 488ns without any relation to the modulator frequency, the SCLK as I understand it is fully asynchronous to the modulator frequency.

    I worked all week with the oscilloscope connected to the SPI lines. I will be glad to add some scope pictures to the post, additional pair of eyes very often helps... Would you like to see anything specific? As I mentioned before in general I am able to communicate with the part, only writing to two registers in one command causes some difficulties.

    You did very good job writing the blog. After reading it I will mention that I wrtite to registers asynchronous to DRDY_N signal as I am not interested in reading ADC data at that time. Anyhow I tried to correlate unsuccessful writes to DRDY_N and in my opinion there is no any relationship.

    I hope we will be able to resolve the issue soon.

    Thanks,
    Robert
  • Joseph,

    thank you for that suggestion (checking Tsccs), I will certainly verify that. I also tried to work with the CS_N line tied low all the time with some difficulties, but that is a subject for another case.

    Thanks,
    Robert
  • Robert,


    The SCLK can be clocked into the device asynchronously. However, the device uses the oscillator as the master clock, and the SCLK still needs to be clocked into the device's master clock domain. In order for that to happen, it still needs to be slower than the master clock, hence the limitation compared to the oscillator frequency.

    For the scope shots, why don't you grab /CS, DIN, SCLK and DOUT and get the two byte write of the registers. I check first to see that there isn't too much noise and then check the polarity of all the signals. Then I try to read the data (either DIN or DOUT). For that, I really like a logic analyzer, but I can still generally read it off the scope if the resolution is good enough and/or there's enough points to expand it out.

    Writing to the part should be fine when it's asynchronous to the /DRDY signal. It's only when you read the data this might be an issue.


    Joseph Wu
  • Joseph,

    good news, the suggestion to check Tsccs was brilliant. The Tsccs is expressed in oscillator periods and varies with the oscillator frequency, thus should account for the oscillator tolerance, when the internal one is used. After extending Tsccs beyond the worst case possible requirement (1.8us for the internal oscillator) all write commands reach the destination.

    I am pretty confident with that solution:
    - when I performed a write to single register, it was followed by a single NOP command so nCS was extended and all 'single' writes were accepted
    - when the SPI interface was slowed down, the Tsccs was indirectly affected and it caused that the 'double' writes were accepted

    Great work!
    Robert
  • Robert,


    Thanks for letting me know. If you have any other questions, feel free to post back. Good luck with your project.


    Joseph Wu