analogWrite Arduino DAC1 output like pwm digitalWrite

I use analogWrite(DAC1,Output) in my code, but I find it like digital pulse output, rather than expected analog continuous curve, i don’t know why, forgive a fresh people in C language.

double Setpoint, Input, Output;
PID myPID(&Input,&Output,&Setpoint,2,5,30,DIRECT);
void setup() 
  Input= analogRead(A0);
  Setpoint = 3000;
  // put your setup code here, to run once:


void loop() {
  Input = analogRead(A0);
  Serial.print("Input = ");
  Serial.print("Output = ");
  // put your main code here, to run repeatedly:



I have some Arduino Due borads, so there is DAC1 pin


like that

Sorry, I have tried it just now, but it's not useful, then the output in oscialloscope are very small. A proportion reduce to 255/4096.

I do not have a Due so I cannot comment directly.

The documentation at
in the third paragraph says

The Arduino Due supports analogWrite() on pins 2 through 13, plus pins DAC0 and DAC1. Unlike the PWM pins, DAC0 and DAC1 are Digital to Analog converters, and act as true analog outputs.

But in my code, the analogWrite(DAC1, Output)still output signal like PWM, some pulses

anyone can help me?


Note that the voltage range on the DAC output is 0.55V to 2.75V for 0 to 4095 in code. (1/6 to 5/6 of Vcc)