Go Down

Topic: DAC Offset (Read 635 times) previous topic - next topic

dgelman

I am just running a simple script because I noticed that the DAC output is a little off.

Code: [Select]
int DACPIN = DAC0;

void setup() {
  pinMode(DACPIN,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  for (int i = 0; i <= 4095; i = i+5){
    analogWrite(DACPIN,i);
    delay(20);
  }
}


I am seeing a minimum value of 0.52V and a maximum of 3V. Shouldnt I be seeing 0 to 3.3V?


Thank you,
Dialup is the future.

Grumpy_Mike

Quote
Shouldnt I be seeing 0 to 3.3V?
No what you are seeing is correct. See the data sheet it in effect says that there is an offset.

dgelman

No what you are seeing is correct. See the data sheet it in effect says that there is an offset.
What section in the datasheet? If you dont mind pointing me in the right direction.

Thanks,
Dialup is the future.

Grumpy_Mike

on page 1059 of SAM3S datasheet, it is said that the voltage range of the DAC is from (1/6) x VADVREF to (5/6) x VADVREF.

Go Up