I've got a 16 bit DAC here, which is called DAC8550 (by TI).. I've managed to link it with SPI connection with arduino UNO, But I'm having problem with getting predictable results form it.
This chip expects data to be sent to it in two’s complement format from –32768 to +32767, most significant bit first.
This particular model on power-up voltage is set at midscale.
This DAC requires 3 bytes sent to it. In first byte first 6 bit are 'do not care', last two are for sleep and power-down. Other 2 bytes are for the data.
I've made a for loop to generate values form –32760 to +32760 to be written to DAC and monitored output of a DAC with a multimeter.
The output of from this DAC was loosely correlated with values sent to it.
In my case midrange is at about 2.45v.
This is what I've observed when for loop sent values to DAC:
from -32k to -20k output voltage went up and down about midrange from 2.4 to 2.7
at around -20k voltage jumped to 3.2v
at around -15k voltage dropped to 0
from -15k to about -8k voltage moved up and down between 0 and 0.2v
at around -8k voltage started steadily climbing to midpoint.
from 0 to 7k voltage jumped about midpoint
at around 8k voltage climbed to 3.1v and then dropped back to midpoint
at arouns 16k voltage climbed to 3.6v and then dropped back to midpoint
from around 20k to 32k voltage climbed form midpoint to 4.9v
#include "SPI.h"
int dacCSpin = 10, i;
byte data1 = 0, data2 = 0;
void setup() {
pinMode(dacCSpin, OUTPUT);
SPI.begin();
}
void loop() {
i = 1 - 32760;
for ( i = i; i < 32760; i = i + 10) {
data1 = highByte(i);
data2 = lowByte(i);
digitalWrite(dacCSpin, LOW);
SPI.transfer(0b00000000);
SPI.transfer(data1);
SPI.transfer(data2);
digitalWrite(dacCSpin, HIGH);
Serial.print("sent to DAC: ");
Serial.print(i);
Serial.print(" in binary: ");
Serial.println(i, BIN);
Serial.println(" ");
}
delay (11000);
}
Perhaps I should format values I send to DAC as Two’s Complement somehow? Datasheet specifically mentioned DAC8551 as 'decimal' counterpart to DAC8550.
Will be grateful for any advice!

