Try changing the for loop to this:
uint32_t adc_read = 0;
for(int i=0; i< 32; i++)
{
digitalWrite(AD7780_SCK, LOW);
delayMicroseconds(10);
digitalWrite(AD7780_SCK, HIGH);
if(a = digitalRead(AD7780_MISO)) {
adc_read |= 1;
}
adc_read <<= 1;
delayMicroseconds(10);
}
// If the status byte is sent first use this
uint8_t stat;
stat = adc_read >> 24;
adc_read &= 0xffffff;
// If the ADC reading is sent first use this
uint8_t stat;
stat = adc_read & 0xff;
adc_read >>= 8;
The datasheet doesn't really say whether the status byte is sent before or after the ADC reading so I've added code for both possibilities. Pick whichever one is correct.
Pete