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.

DAC161S997: Initial Code Help

Part Number: DAC161S997

Hello E2E Experts,

Good day.

I am a coorporating professor with a small senior project team that is striving to utilize your 16-Bit precision DAC.  We have this wired and are testing the SPI, but after many hours we are still not getting any data out of the part.  They are using RP2040 Rasberry Pi as their MCU.  We have checked all base level things (power, clocks, configuration signals, etc).  They have also checked the RP2040 SPI by talking to an arduino board to confirm reading and writing are working.  I wanted to reach out for them to see if you have any simple things that might help get this working quickly.

First, it would be great if there were some support library or some sample code on how to build the SPI interface.  In particular, it looks like the default SPI_TIMEOUT is 100ms, which may mean we are simply watchdogging the part as I believe they are currently trying to do a read every 2 seconds in their test code.  Can you help with this?

Secondly, we have tested two different parts and the behavior is consistent (and odd).  When we write our SPI transaction and expect to get a read back, the DOUT signal appears to start driving high, but basically stops at 0.3mV.  I'm having the students to try and see if they somehow have the MISO pin set to drive low (which could explain this), but the SPI library they are using would be pretty broken if it did.  I'm wondering if there is anything in the configuration of the board that could have the DOUT shorted to something else?  We should not need any pullup on a SPI signal.

Regards,

CSC

  • CSC,

    There isn't much available for example code for the DAC161S997. However, if you go to the TI design for TIDA-0095, there is a zip file for some of the firmware using the MSP430 and DAC161xxxx devices. In the zip file, you can find the DAC161.h abd DAC161.c files. The design folder is at the link below.

    https://www.ti.com/tool/TIDA-00095

    For the SPI timeout error, you can mask that error with MASK_SPI_TOUT in the ERR_CONFIG register to prevent it from affecting the circuit.

    To get this device working to control the current loop, one thing that people often miss is that the LOOP- and the ground node are not the same voltage. LOOP- sits at a voltage below the ground of the device and pulls the set current. If there are problems getting the proper current through the loop, can you please post the schematic?

    The schematic should look like this:


    Joseph Wu