Description
DAC 16 bit single channel SnipCard for Archiduino System (or Arduino, if used as breakout board).
This SnipCard gives Archiduino an accurate 16 bit DAC thanks to the AD5662 made by Analog Devices. With breadbording cables you can easily adapt it to work with every Arduino board model.
Techical specifications:
The AD5662, a member of the nanoDAC family, is a low power, single, 16-bit buffered voltage-out DAC that operates from a single 2.7 V to 5.5 V supply and is guaranteed monotonic by design.
The AD5662 requires an external reference voltage to set the output range of the DAC. The part incorporates a power-on reset circuit that ensures the DAC output powers up to 0 V (AD5662x-1) or to midscale (AD5662x-2), and remains there until a valid write takes place. The part contains a power-down feature that reduces the current consumption of the device to 480 nA at 5 V and provides software-selectable output loads while in power-down mode. (from AD5662 datasheet).
The 16 bit DAC SnipCard voltage reference is provided by a LT1236 made by Linear Technology.
The LT® 1236 is a precision reference that combines ultralow drift and noise with excellent long-term stability and high output accuracy. The reference output will both source and sink up to 10mA and is almost totally immune to input voltage variations. The LT1236 combines both superior accuracy and temperature coefficient specifications without the use of high power, on-chip heaters. The LT1236 references are based on a buried zener diode structure which eliminates noise and stability problems with surface breakdown devices. Further, a subsurface zener exhibits better temperature drift and time stability than even the best band-gap references. (from LT1236 datasheet)
Document reference
SnipCard DAC 16 bit V0.4 schematic
Driving a serial DAC with Arduino IDE example
/*
ARCHIDUINO TEST DAC
The purpose of this firmware is to send some values to the new Archiduino DAC 16 Bit SnipCard.
The SnipCard is built with Analog Devices AD5662 DAC
*/
const byte SCLK = PC3; // SERIAL CLOCK PIN
const byte SYNC = PD4; // SYNC PIN
const byte DATA = PC2; // SERIAL DATA PIN
int incomingByte;
String readString;
//------------------------------------------------------------------------------------
void setup() {
pinMode(SCLK, OUTPUT);
pinMode(SYNC, OUTPUT);
pinMode(DATA, OUTPUT);
digitalWrite(SYNC, LOW);
digitalWrite(SCLK, HIGH);
Serial.begin(57600);
shiftOut(0);
}
//------------------------------------------------------------------------------------
void loop()
{
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the String readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() >0) {
int n = readString.toInt(); // convert readString into a number
Serial.print ("You typed: ");
Serial.print(n, DEC);
Serial.print (" % equivalent to ");
int q = 65535 * n / 100; // convert the percentage in absolute value
float f = 5.0 * n / 100.0; // convert the percentage in Voltage value
Serial.print(f, 4);
Serial.println (" volts");
shiftOut(q);
readString="";
}
}
//------------------------------------------------------------------------------------
void shiftOut(long myDataOut) {
int i=0;
int pinState;
digitalWrite(SCLK, LOW); // set SCLK to LOW
digitalWrite(SYNC,LOW); // as well as SYNC
for (i=23; i>=0; i--) {
if ( myDataOut & (1 << i) ) {
pinState= 1;
}
else {
pinState= 0;
}
digitalWrite(SCLK, HIGH); // a tick to the CLOCK
digitalWrite(DATA, pinState); // write the bit
digitalWrite(SCLK, LOW); //
}
digitalWrite(SYNC, HIGH);
digitalWrite(SCLK, HIGH);
}
// -----------------------------------------------------------------------
int readline(int readch, char *buffer, int len) {
/*
This routine is made by:
Reading Serial on the Arduino
*/
static int pos = 0;
int rpos;
if (readch > 0) {
switch (readch) {
case '\n': // Ignore new-lines
break;
case '\r': // Return on CR
rpos = pos;
pos = 0; // Reset position index ready for next time
return rpos;
default:
if (pos < len-1) {
buffer[pos++] = readch;
buffer[pos] = 0;
}
}
}
// No end of line has been found, so return -1.
return -1;
}
// END CODE HERE************************
This operation yields:
.









