johnwasser, thanks, that resolved some issue, but now other problem occurs.
Here is my code:
pinMode (SPI_DAC_CS_PIN, OUTPUT);
for (int b=0;b<4095;b++)
//Prepare to output 2 bytes: SPI CS assert LOW, DAC latch set high.
// send in the value via SPI:
SPI.transfer((b>>8)); // High byte
SPI.transfer((b&0xFF)); //Low byte
//Assert CS low
//Now set the DAC to load register to output (LD Low->High).
delayMicroseconds(10);//Set a delay to simplify scope analysis
delay(200); //200ms delay between cycles
The DAC is 12-bit, so, by datasheet, should get values between 0 and 4095. When we send some zeroes before valuable data, the DAC input shift register just shifts that zeroes to the left out of register, so only 12 bits remain.
That code is supposed to go from 0 to 4095, resulting in 0-to-4.095V "saw" with delay between each cycle.
The problem is that DAC seems to read only 11 bit, so I get not single "saw", but a double "saw". Attached is info from my scope:
So I'm curious: Does the SPI send something other than my 2 bytes to line? Maybe some control bits between each of my byte?