0

I am attempting to program an Arduino to interface with a DAC, specifically the AD7390 made by Analog Devices.

I have tried using the SPI library as a means of realising the interface but am confused by the PIN layout of the DAC. It provides me with SCK, SDI, CLR and LD pins.

The LD (Load Strobe) PIN is used to transfer buffers from the chip's on-board shift register to its DAC register.

The CLR PIN is used to forcibly clear the DAC register.

The documentation claims that the device is SPI compatible but, using these PINs with the Arduino Mega2560 as a micro-controller, only partially works and I am concerned that the circuit requirements of the SPI library are not being satisfied. In SPI documentation, a SS (slave select) PIN is universally mentioned but is not present with my device.

As I have managed to get the CLR PIN working, consistently and as expected, I wonder if a manual approach - i.e. using shiftIn() instead of the SPI library - is the way to go.

Any suggestions or advice would be appreciated.

1

The AD7390 data sheet timing diagrams show that /LD is in effect a slave select, but an active high one.

Specifically, it says that while /LD is high, each rising clock edge causes "Shift-Register-Data Advanced One-Bit", while when it is low, the shift register data is transferred to the DAC.

So basically you would need to use SPI in a mode where the slave select is controlled by software and asserted with the opposite of the usual polarity, but the actual shifting of the data can be accomplished with the hardware SPI engine.

It does not seem that you are always required to use the /CLR input - if you don't want to use it, wire it high. Otherwise, you can connect it to a GPIO, take it low, and then raise it so that the rising edge causes an asynchronous clear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.