Problem interfacing MCP4921 with Arduino Mega 2560


I am using MCP4921 with Arduino Mega 2560. I have just started using this. I am trying to get 5V output.
Here is my wiring diagram.

The 5V supply and GND are taken from Arduino board.

Here is my code

#include "SPI.h" // necessary library

void setup()
  //set pin(s) to input and output
  pinMode(53, OUTPUT);
  SPI.begin(); // wake up the SPI bus.
void loop() 
    digitalWrite(53, LOW);
    digitalWrite(53, HIGH);

Now first SPI tranfer is 01011000 which sets gain of 2x, buffered Vref, SHDN bit to high, and the DAC data bits to 100000000000.

After doing this I am getting 0V at output. Can you please tell me what is the error?


Check the upper 4 bits and page 24. I don't think 1000 are the bits you want.

bit14-1 -buffered
bit13-0 -gain 2x
bit12-1 - shdn high
bit11 to bit0= 1000 0000 0000 (=2048)

with 2x gain I should get 5V output. I have external Vref as 5V.
I used this logic.