MAX11040K Not reading data or setting register

Hello everybody,

I wrote the library and functions for MAX11040K, but I don’t read any data from adc. Is there any mistake on my circuit. The circuit is in attachment.

I want to read data from one, so I connected the other channel to GND.

Here is my code.

#include <SPI.h>
#include "MAX11040K_lib.h"		// MAX11040K definitions.

#define MAX11040K_CS_PIN 4
#define MAX11040K_CS_LOW digitalWrite(MAX11040K_CS_PIN,LOW);
#define MAX11040K_CS_HIGH digitalWrite(MAX11040K_CS_PIN,HIGH);

void MAX11040K_Config(void)
{
  unsigned char conf;
    MAX11040K_CS_LOW;
    SPI.transfer(MAX11040K_CS_PIN, 0xE0);
    conf = SPI.transfer(MAX11040K_CS_PIN, 0);
    MAX11040K_CS_HIGH;
  Serial.print("First config settings:");
  Serial.println(conf, BIN);

  delay(10);

    MAX11040K_CS_LOW;
    SPI.transfer(MAX11040K_CS_PIN, 0x60);
    SPI.transfer(MAX11040K_CS_PIN, 0x80); // shutdown firstly
    MAX11040K_CS_HIGH;



  delay(10);

    MAX11040K_CS_LOW;
    SPI.transfer(MAX11040K_CS_PIN, 0xE0);
    conf = SPI.transfer(MAX11040K_CS_PIN, 0);
    MAX11040K_CS_HIGH;
  Serial.print("My config settings:");
  Serial.println(conf, BIN);

  delay(10);

    MAX11040K_CS_LOW;
    SPI.transfer(MAX11040K_CS_PIN, 0x60);
    SPI.transfer(MAX11040K_CS_PIN, 0x64); // reset,enable24bit,pdbuf
    MAX11040K_CS_HIGH;

  delay(10);

    MAX11040K_CS_LOW;
    SPI.transfer(MAX11040K_CS_PIN, 0xE0);
    conf = SPI.transfer(MAX11040K_CS_PIN, 0);
    MAX11040K_CS_HIGH;
  Serial.print("My config settings:");
  Serial.println(conf, BIN);
}



void MAX11040K_Reading_Data(void)
{
  int i = 0;
  int j = 0;
  unsigned long CH0_RES = 0;
  unsigned long buff = 0;
  unsigned char emp[12];

  Serial.println("Reading data:");
  //Reading data
  MAX11040K_CS_LOW;
  SPI.transfer(MAX11040K_CS_PIN, MAX11040K_READ_DATA_REG);
  while(i<4)
  {
  buff = SPI.transfer(MAX11040K_CS_PIN,0);
  CH0_RES = (CH0_RES << 8) + buff;
  i++;
  }
  for(j = 0; j < 12; j++)
  {
    emp[j] = SPI.transfer(MAX11040K_CS_PIN,0);
  }
  MAX11040K_CS_HIGH;

  //Two's complement
  CH0_RES = 0xFFFFFF - CH0_RES;
  CH0_RES = CH0_RES + 1;

  Serial.print("CH0: ");
  Serial.println(CH0_RES, BIN);
  // Serial.print("CH1: ");
  // Serial.println(result[1], BIN);
  // Serial.print("CH2: ");
  // Serial.println(result[2], BIN);
  // Serial.print("CH3: ");
  // Serial.println(result[3], BIN);
}

void setup()
{
  unsigned char conf;

  Serial.begin(9600);
  SPI.begin(MAX11040K_CS_PIN);
  pinMode(MAX11040K_DRYD_PIN, INPUT);
  pinMode(MAX11040K_CS_PIN, OUTPUT);
  digitalWrite(MAX11040K_CS_PIN, OUTPUT);
  SPI.setDataMode(MAX11040K_CS_PIN, SPI_MODE2); // ADC CPOL=1 CPHA=0
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(MAX11040K_CS_PIN, 21);       // arduino DUE

  MAX11040K_CS_HIGH;

  Serial.println("sending...");

  MAX11040K_Config();

  delay(10);

}

void loop()
{
  MAX11040K_Reading_Data();
  delay(1000);
}

//end