DAC will not output more than 2.17V

void setup() {
  pinMode(A0,OUTPUT);
  analogWriteResolution(10);  

}

int counter = 0;
void loop() {
  counter++;
  if (counter>1000)
   counter = 0;
  analogWrite(A0,counter);
  delay(50);
}

As stated in the title, DAC output gets "stuck" at 2.17V, while the counter keeps counting (from about 600 to 1000).
What am I missing?

Thanks!

Remove the pinMode() command as this forces the pin digital and causes problems with the DAC function. This was discussed here: Re: Arduino Zero DAC (Analog Output) Cutoff Below the Rail Voltage

Good Luck