1
votes

I want to use an Arduino (either Mega ADK or Due) to control an external 16-bit DAC chip. (I have the evaluation board for the DAC chip). It says that the chip can be programmed using its Serial Peripheral Interface and it seems like from what I have read online, that this is possible to do with the Arduino.

But I do not know where to start. I have been searching for anything that may be helpful for about a week now, but I have come up short. I haven't been able to find any tutorial or help guide to figure out how to program the Arduino to communicate with the chip.

If anyone could provide any material that would be helpful in learning SPI, I would greatly appreciate it.

The manual for the DAC chip I am using is here: http://cds.linear.com/docs/en/datasheet/2754f.pdf I believe the important page on programming the chip is page 15.

The manual for the evaluation board I am using is here: http://cds.linear.com/docs/en/demo-board-manual/dc1546af.pdf

Once againg, any help would be extremely helpful as I have never done any programming between devices using SPI. Thanks.

1
SPI should not be confused with "serial" or "serial interface", which are typically assumed to be RS-232 rather than SPI. SPI is a master-slave interface. One node is the master, and the other nodes respond to it. Slave devices are typically passive, e.g. such as a Flash chip, that only send data as a response when the master requests it. But there are ad hoc schemes for the SPI slave device to signal the SPI master, typically using a GPIO interrupt on the master.sawdust

1 Answers

0
votes

Start with this for basic SPI & choosing your board (Due): Arduino SPI

You have an intense little evaluation board. Start with figuring out the hardware connections. On connector J1, (page 5 - eval board) pins 4, 5, 6, & 7 are SCK, MISO, CS, & MOSI. I'm going to assume power and the jumpers can be worked out by you. The DACs are defaulted to Manual Span. That lets you know that all your commands/controls will take place over the SPI interface.

You'll need to know what the SPI mode is. Based on the datasheet (pg 8, note under pin SDI) and a wikipedia, SPI Wiki, the SPI mode is 0 (SPI_MODE0).

So hooking up the Arduino and getting that far is a bit on its own. Time to take a breather.

If you chose the Due, you have (according to Arduino), the extended SPI command set so you can generate your commands as 24 bits (3 bytes - 3 transfer() commands)

Using the 24-bit example from pg. 15 of the DAC datasheet. You would do something like:

a.

SPI.transfer(10, 0x2F, SPI_CONTINUE)
SPI.transfer(10, 0x00, SPI_CONTINUE)
SPI.transfer(10, 0x03, SPI_LAST)

c.

SPI.transfer(10, 0x20, SPI_CONTINUE)
SPI.transfer(10, 0x00, SPI_CONTINUE)
SPI.transfer(10, 0x01, SPI_LAST)

e.

SPI.transfer(10, 0x3F, SPI_CONTINUE)
SPI.transfer(10, 0x80, SPI_CONTINUE)
SPI.transfer(10, 0x00, SPI_LAST)

Hope this helps. Don't mind me if anything is off. Quickly put this together.