Using Arduino uno to program DAC for output voltage-- serial monitor BLANK

Hi everyone,

I'm trying to program a DAC (DAC8552) to output the voltage that I input. Right now, I have it hooked up to an oscilliscope, and it seems that my SYNC and SCLK pins are doing what they're supposed to, but my DIN pin is not. In trying to troubleshoot I've been trying to see the output in the serial monitor, but its turning up blank. Even when I put Serial.print("Hello") in various places in my program, nothing is printing.

Here's my code without the Serial.println command. Where should I put it?

#define SYNC 8
#define SCLK 9
#define DIN 10

void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);

}

void loop()

{

dacfunction(200);

}
void dacfunction(int value){
// A total delay of 4 ms = 1/0.004 = 250 Hz…

digitalWrite(SYNC, HIGH);
delay(2);
digitalWrite(SYNC, LOW);
delay(2);
dinfunction(0);
dinfunction(0);
dinfunction(1);
dinfunction(1);
dinfunction(0);
dinfunction(1);
dinfunction(0);
dinfunction(0);
delay(100);

{bitreading(200);}

}

void dinfunction(int val)
{
digitalWrite(SCLK, HIGH);
delay(2);

if (val == 0) {
digitalWrite(DIN, LOW);}
if (val== 1) {
digitalWrite(DIN, HIGH);}

delay(2);

digitalWrite(SCLK, LOW);
delay(2);

}

void bitreading(int value)
{

for (int i = 0; i <15; i++)

{digitalWrite(SCLK, HIGH);
delay(2);

if (bitRead(value, i) == 0){
digitalWrite(DIN, LOW);}
else {
digitalWrite(DIN, HIGH);}
delay(2);

digitalWrite(SCLK, LOW);
delay(2);

}

}

Thank you!

Also if you see any problems with the code, like I said the DIN isn't doing what its supposed to...

dac.ino (1.15 KB)

Have you got a Serial.begin() command in your real code ?

haha you can tell i'm new to arduino. Thank you both!! That fixed the problem