Hi everyone,
I have a really strange problem with my MKRZERO Arduino. One of the most important things I need to do for my project is to have a perfect control on the DAC. It’s not really easy to find a lot of datasheets on this model, I only use the information below:
[https://store.arduino.cc/usa/arduino-mkrzero
The Circuit Operating Voltage is 3.3V, and the DAC is supposed to be 10 bits. So normally, I should be able to create steps of 3.3/1023 Volt. In order to test that, I used the code below. (This is not the complete code, I only wrote the important steps, I know that this code cannot work by itself)
pinMode(A0,OUTPUT); //W_Voltage
analogWriteResolution(10);
for (float i=0; i <= 1023; i++){
delay(500);
analogWrite(A0,i);
delay(500);
Serial.println(i);
}
If I connect a voltmeter between the ground and my A0/DAC Output, I can see by observing the Serial.println(i) on the computer that my DAC evolves in cycles of 2^8 - 1 = 255 steps. Which means that I read a 0V at step 0, step 256, step 512, etc… But it’s not my main problem. The weirdest thing is, my DAC stops at 2.2V, which is related to the 175 step in my cycle of 255 steps. Whatever I do, my DAC cannot reach 3.3V. It is the same if I try this command.
analogWrite(A0,1023);
I will only read 2.2V, just like in my last test. Did this happen to anyone else? I would be really glad if you could tell me what you think, because this a huge problem for, I mainly bought that Arduino for that, and if that does not work i’m kinda blocked.
Thank you so much for your help!
Sincerely yours,
Maxime Mano.](https://store.arduino.cc/usa/arduino-mkrzero)