AnsweredAssumed Answered

LTC2668 control with Raspberry Pi 3

Question asked by analoghb on May 27, 2018
Latest reply on May 29, 2018 by Clarence.Mayott



I have DC2025A-A demo board for 16 bit LTC2668. The board has the option to be used with QuickEval with extra boards but I don't have them. According to the manual, DC2025A can be used with micro controllers by using SPI. My problem is I cannot get it work.


I have Raspberry Pi 3, Model B. SPI is enabled, and wiringPi installed on it. I have tested SPI by using a cable between MOSI-MISO pins, as well as another DAC (single channel) demo board. According to these tests the SPI communication on the Raspberry Pi works. 


Below is the summary of steps I have taken for the DC2025A board:


1- The pin connection between DC2025A and Rasberry Pi is as follows:

CS to SPI0 (Pin 24)

SDI to SPI0_MOSI (Pin 19)

SCK to SPI0_SCLK (Pin 23)


2- Jumper positions on DC2025A --> default (Internal reference, MSP0 ->1, MSP1 ->1, MSP2 ->1)

3- Power --> V- and GND tied together, and +5V-GND is applied to V+-GND from Raspberry Pi with pins 4 and 6.

4- No power connection to AVP, but OVP is tied to +5V from Raspberry Pi with pin 4.

4- wiringPi connection settings: CS = 0, rate = 500000 Hz


After these connections I send write and update command for channel 0 to set a voltage (say 2 V).

I used LTC2668 code files to adapt


LTC2668_write(LTC2668_CS,LTC2668_CMD_WRITE_N_UPDATE_N, selected_dac, dac_code);


command line. In the Raspberry Pi C++ code (that is using wiringPi) I have the following part for setting a voltage on channel 0:


unsigned char buffer[4];

buffer[3]= 0;

buffer[2] = 0x30;//write and update for channel 0

buffer[1] = 0x66

buffer[0] =  0x66


wiringPiSPIDataRW(CS, buffer, 4);


After this command I see no change in the output voltage of channel 0.


I'd appreciate any comments or help to shed light on what I might be doing not correctly.