Hello there
I'm working in a project where I have to use SPI protocol to comunicate with a DAC088S085. So, I'm using a arduino nano for the job but it's not going well so far.
I'm using Arduino version 1.6.8 to program.
This is the code I'm using to for a test but it is not working. When i measure the DAC's output there is nothing going on.
#include "SPI.h"
#define DATAOUT 11 //MOSI
#define DATAIN 12 //MISO - not used, but part of builtin SPI
#define SPICLOCK 13 //sck
#define SS 10 //ss
void setup() {
// put your setup code here, to run once:
SPI.begin();
pinMode(DATAOUT, OUTPUT);
pinMode(DATAIN, INPUT);
pinMode(SPICLOCK, OUTPUT);
pinMode(SS, OUTPUT);
digitalWrite(SS,HIGH);
SPCR = (1<<SPE)|(1<<MSTR)|(1<<CPHA);
delay(10);
digitalWrite(SS ,LOW);
SPI.transfer(0x0FF0);
SPI.transfer(0x1C00);
SPI.transfer(0x2800);
SPI.transfer(0x3400);
digitalWrite(SS,HIGH);
delay(10);
digitalWrite(SS ,LOW);
SPI.transfer(0xA00F);
digitalWrite(SS,HIGH);
}
In the picture you can see the circuit, blue line is ground and red line 5v.
here is the DAC's datasheet http://www.ti.com/lit/ds/symlink/dac088s085.pdf
I really need help cause I'm running out of time.
thank you in advance.