first time use a DAC chip

Dear all, I am trying to use a DAC chip ad5551 controlled by serial monitor. I am not familiar about SPI and stuff related, can anyone helps me ?Many thanks.

See http://tronixstuff.com/2011/05/13/tutorial-arduino-and-the-spi-bus/ and the follow-on article that it links to near the bottom of the main text.

See page 14 of the datasheet. http://www.analog.com/static/imported-files/data_sheets/AD5551_5552.pdf Put this in a loop or function or whatever. The data may be from an array, from an external source, calculated on the fly, a table in Progmem, whatever.

digitalWrite(ssPin, LOW);
SPI.transfer(highByte(your_int_of_data)); //  upper 2 bits should be 00
SPI.transfer(lowBYte(your_int_of_data));
digitalWrite(ssPin, HIGH);

CrossRoads: See page 14 of the datasheet. http://www.analog.com/static/imported-files/data_sheets/AD5551_5552.pdf Put this in a loop or function or whatever. The data may be from an array, from an external source, calculated on the fly, a table in Progmem, whatever.

digitalWrite(ssPin, LOW);
SPI.transfer(highByte(your_int_of_data)); //  upper 2 bits should be 00
SPI.transfer(lowBYte(your_int_of_data));
digitalWrite(ssPin, HIGH);

Thank you, but can I transfer the data in one time? why does the data have to transfer two times? thanks.

why does the data have to transfer two times?

Because the data is wider than the single byte that "transfer()" allows.

If you could see the data on a 'scope or logic analyzer you would see all 16 bits go out at once.

CrossRoads: If you could see the data on a 'scope or logic analyzer you would see all 16 bits go out at once.

Can you tell me how to connect the DGND ? To the digital ground of Arduino and then together with Agnd or just ignored it? Thanks.

Normally the Analog and Digital grounds are tied together at the DC source to the DAC and only at that point.

Doc