# Why is my MCP4822 DAC not outputting 0 V?

As part of my MIDI to CV project I am using an MPC4822 (datasheet) two channel 12 bit DAC. After much toil I have everything working as planned but for the fact that even when initialised with values which should give an output of 0v, the minimum I'm seeing at either Vout is 0.56v That's half an octave I'm missing. Why is this happening?

    void loop() {
mode = digitalRead (modePin);      // GET MODE
if (mode != prevMode) {
setVoltage (DAC1, 0, 1, 0);       // INITIALISE BOTH DAC CHANNELS FOLLOWING MODE SWITCH
setVoltage (DAC1, 1, 1, 0);
}
prevMode = mode;
mode ? mode1() : mode2();

}
................

void setVoltage(int dacpin, bool channel, bool gain, unsigned int mV)
{
unsigned int command = channel ? 0x9000 : 0x1000;

command |= gain ? 0x0000 : 0x2000;
command |= (mV & 0x0FFF);

SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
digitalWrite(dacpin,LOW);
SPI.transfer(command>>8);
SPI.transfer(command&0xFF);
digitalWrite(dacpin,HIGH);
SPI.endTransaction();
}


• is there an opamp in the signal path? Show us your schematic. – Brian Drummond Dec 19 '17 at 23:32
• No op amp, just an Arduino, Optocoupler for the midi input and the DAC and a DMM – Sir Cute Dec 19 '17 at 23:36
• Are other values output correctly? And what happens in shutdown mode? – CL. Dec 20 '17 at 8:28
• @CL Not using shutdown but I'll take a look . Max output is 4.569v which is about 0.5v higher than the data sheet says for internal Vref at 2x gain. – Sir Cute Dec 22 '17 at 1:49
• This sounds like a 0.5 V offset. Is there any pullup? There might be a ground problem. Show your circuit. – CL. Dec 22 '17 at 6:57