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.

SPI comm with a DAC

Other Parts Discussed in Thread: TLV5610, DAC8568

Hi all, I'm using F28335 SPI channel to send a frame to a Analog Devices DAC. As far as I know the frame content is OK, but I still don't get any voltage variation at DAC output.

Has anybody had this problem in the past ?

I sent a question do AD support, but no response until now.

Thanks,

Marcelo

 

  • You have not had any response here, either, it seems.

    This would appear to be one of the following:

    • PCB design or manufacturing problem - like some wires are crossed or wrong signals or bad solder connections or clocks or power supplies
    • Incorrect configuration of the SPI peripheral on the DSP or the DAC
    • Software is sending the wrong information to the SPI peripheral
    • The F28335 has detected a Brand-X device and is laughing at your choice (just joking, of course)

    energy_freek said:

    Has anybody had this problem in the past ?

    Yes, every one of us has had a new board brought up that does not smoke when you turn on the power but still does not work as expected. My recommendation is to proceed in the order that I listed above.

    PCB design or manufacturing problem:

    • Go back to the schematic and make sure you drew it right
    • Ohm-out a blank board (if you have one) to make sure the layout is right from pad to pad
    • Where possible, visually inspect the solder connections
    • Verify the right amount of power supply current is being drawn (inverse smoke test)
    • Check the power supplies to everything you are testing, and the clocks, and the resets
    • Confirm the DSP is alive and well by hooking up JTAG and checking around the device

    Incorrect configuration of the SPI peripheral on the DSP or the DAC:

    • Look at the actual SPI register settings to make sure they are right
    • Do a bit-by-bit comparison to the User's Guide to make sure you have the right settings
    • Look at app notes and example drivers to see how they configured the SPI and compare to yours
    • Use an oscilloscope to look at the SPI signals on the board, using either a software loop or manual commands through CCS
    • Verify that all signal look the way the F28335 says they should, then see if they look like the DAC's datasheet says they are expected to look
    • If there is a known register on the DAC that you can read, setup a loop to do that and look at the signals on the scope, esp. to see if the right data or any data is being driven back

    Software:

    • Only after you have verified that you can communicate with the DAC, start looking at the software
    • Double-check all of the programming you have selected for the DAC against the DAC datasheet

    The good news is that SPI is a standard that should work between the devices. Good luck.

  • it turns out that the new PCB layout has a missing connection to the external DAC reference preventing the output to be updated. It is solved now, but cost me a few hours to realize it.

    By the way, for this SPI link I have to update 8 channels in sequence. I needed to include a 20us interval between the SPI frames to keep them separated. Is there a way to make this interval smaller ?

    Thanks,

    Marcelo

     

  • Good work on finding the solution for your board!

    Why do you need to separate the SPI frames? At what clock frequency is your SPI running?

  • the DAC I'm using has 8 channels and I need to keep a minimum interval at the end of one SPI frame befores starting the next one for the slave selection signal, this interval ensures the command at the frame has been understood and processed.

    Currentelly I'm using a 1.5MHz clock but I intend to raise this frequency for the next prototype. The communication is with peripheral at the same PCB, so I don't expect to have issue with the

  • One solution to your forced delay is to try the SPIFFCT.FFTXDLY field to set a delay. I have not used it, but it looks like this is what it must be intended for.

    Another solution is to move to a more flexible DAC like the TLV5610. The TLV5610 can use the SPI interface and still require the spacing between words, or it can use the McBSP interface on the F28335 and will no longer require that craziness. With the McBSP, the Frame Sync (FS) starts the word and can go away anytime during the transfer; it acts as a Start signal rather than an Active Data signal, so it is not required to stay active during the whole transfer nor to go inactive for a short time.

    If you are not using both McBSPs already, this may be an attractive solution.

    Which DAC are you using right now? What speed and resolution do you need, or other features?

  • the time interval is not the problem, I just would like to keep it at the minimum value. I tried to use a 10us interval but didn't work. But it is ok to keep the 20us if it is the minimum.

    I'm using a Analog Devices AD5668 with 16bits resolution.

    I have never used McBSP, I will take a look at it.

     

  • With my friendly salesman's hat on, I have to point out that you can use the TI DAC8568 as a direct replacement. The DAC8568 may cost a few dollars less and it may have some better spec on INL accuracy,  reference, and possibly glitch.

    With my technical hat back on, either device will have the same requirement of the SYNC signal going high between words. Please let me know if the SPIFFCT.FFTXDLY field works. That will be the easiest way to get exactly the right signaling and not waste any processing time, plus it will be less likely to add any jitter.

    According to my calculator, 1.5 MHz gives you an SPICLK period of .67 us. For a 32-bit word to shift out, that will take over 21 us, so even a delay of 20 us is not enough unless you also have DSP processing time that adds in.

    The McBSP solution will only work if you go to a DAC that supports it, but none of our 16-bit DACs do, sorry. It is possible that it can be configured some special way to get what you want for SPI, but standard McBSP does not look like it will do.

  • I need sample code in 'C' for the DAC8568, could somebody please paste it here.

     

  • I desperately need some sample code,  for DAC 8568 IC( unable to configure it). Guys from TI Pl help me out.

  • Sansu,

    I would search and then post, on the Data Conversion forum, not the MCU forum.

    http://e2e.ti.com/support/data_converters/default.aspx