Hey All,
I'm rather new to the Arduino community and am understanding very quickly I have a lot to learn.

I appreciate any time or thought towards my issue:
I am trying to interface a TI ADS7817 12-Bit serial ADC to an Arduino. My circuit is rather complex at the moment but the portion I'm working with resembles the attached. I have tried several things with my code, but I only seem to get a constant output of ~1268 (out of a total 4096) from the converter regardless of input. I have reviewed my circuit and determined that everything is connected correctly (to the best of my knowledge) and that the clock is cycling like it should.
If anyone has any input I'm all ears. My code is below. Thanks.
#define CS 10 //Chip selection pin
#define DATAPIN 12 //Data pin
#define CLOCK 13 //ADS 7817 clock
int readvalue;
void setup() {
//Set up pin modes
pinMode(CS, OUTPUT);
pinMode(DATAPIN, INPUT);
pinMode(CLOCK, OUTPUT);
//Ensure ADS7817 is powered off to start
digitalWrite(CS, HIGH); //Pin needs to be high for shutdown mode
digitalWrite(CLOCK, LOW);
Serial.begin(9600); //Initialize serial for debugging
}
int readADS7817() {
int adcvalue=0;
digitalWrite(CS, LOW); //Select the ADS7817
//Cycle clock to ignore two null bits of data transferred
digitalWrite(CLOCK, HIGH);
delay(50);
digitalWrite(CLOCK, LOW);
delay(50);
digitalWrite(CLOCK, HIGH);
delay(50);
digitalWrite(CLOCK, LOW);
delay(50);
//Read the 12 data bits from ADS 7817
for (int i=11; i>=0; i--) {
adcvalue+=digitalRead(DATAPIN)<<i;
//Serial.println(adcvalue, DEC);
//Cycle clock
digitalWrite(CLOCK, HIGH);
digitalWrite(CLOCK, LOW);
}
digitalWrite(CS, HIGH); //Power down ADS7817
return adcvalue;
}
void loop() {
readvalue = readADS7817();
Serial.println("");
Serial.println(readvalue, DEC);
delay(250); //Delay between data sampling streams
}