hello ,
i need to use the DAC at very low voltage, and to get it work from 0 volts .
so i change the analog reference to INTERNAL to have a lower step
but the output from DAC always start at 2.8 mV even when i'm sending analogwrite = 0, after the step is 0.3mV which correspond to 1.2 / 4096
i read the kinetis 66 datasheet and it's write at page 52 that the offset is corresponding to "±0.4 ±0.8 %FSR " but i don't know what is fsr
if someone can explain me the offset and if there a way to avoid this offset
i need to use the DAC at very low voltage, and to get it work from 0 volts .
so i change the analog reference to INTERNAL to have a lower step
but the output from DAC always start at 2.8 mV even when i'm sending analogwrite = 0, after the step is 0.3mV which correspond to 1.2 / 4096
i read the kinetis 66 datasheet and it's write at page 52 that the offset is corresponding to "±0.4 ±0.8 %FSR " but i don't know what is fsr
if someone can explain me the offset and if there a way to avoid this offset
Code:
int fadeAmount = 1; // how many points to fade the LED by
int bright = 0 ;
void setup() {
// put your setup code here, to run once:
analogReference(1);
analogWriteResolution(12);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(A21, (int)bright);
Serial.println(bright);
// change the brightness for next time through the loop:
bright = bright + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (bright <= 0 || bright >= 5) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(2000);
}