programming ADS 1232 without spi (mega2560)

Hello
I’m having trouble interfacing ADS1232 chip with my Arduino MEGA2560.

I have this so far

int data = 9;
int sclk = 10;
int pdwn = 11;
int clkin = 12;
int SPEED = 13;

void setup() {
  // put your setup code here, to run once:
  analogWrite (A0, 3);
  analogWrite (A1, 500);
  pinMode(SPEED, OUTPUT);
  pinMode(clkin, OUTPUT);
  pinMode(data, INPUT);
  pinMode(sclk, OUTPUT);
  pinMode(pdwn, OUTPUT);
  digitalWrite(SPEED, LOW);
  digitalWrite(clkin, LOW);
  digitalWrite(data, HIGH);
  Serial.begin(9600);

}                         

void loop() {
    digitalWrite(sclk, HIGH); //enter standby
    delay(100);
    digitalWrite(sclk, LOW); //wake up
    //wait for data ready
    if (digitalRead(data) == LOW);
    byte highBYTE = shiftIn(data, sclk, MSBFIRST);//shift all three bytes in
    byte midBYTE  = shiftIn(data, sclk, MSBFIRST);
    byte lowBYTE  = shiftIn(data, sclk, MSBFIRST);
    digitalWrite(sclk, HIGH); // polling pulse
    digitalWrite(sclk, LOW);
    Serial.println(highBYTE);//print all three bytes
    Serial.println(midBYTE);
    Serial.println(lowBYTE);
    
    }

I get a constant printed value of 255.

Here’s the datasheet http://www.ti.com/lit/ds/symlink/ads1231.pdf

Also this thread was for a similar chip, but his code didn’t work for me either. http://forum.arduino.cc/index.php/topic,128823.0.html

Thanks in advance for your help.

  if (digitalRead(data) == LOW);Semicolon ?

Thanks for your comment.
I delete semicolon and this error was occurred:

C:\Users\PC\Documents\Arduino\sketch_nov19b\sketch_nov19b.ino: In function ‘void loop()’:

sketch_nov19b:34: error: ‘highBYTE’ was not declared in this scope

Serial.println(highBYTE);//print all three bytes

^

exit status 1
‘highBYTE’ was not declared in this scope

I was edited with this:
// Serial.println(highBYTE);//print all three bytes

But the result is still the same:

Serial print:
255
255
255
.
.
.

 if (digitalRead(data) == LOW)
    byte highBYTE = shiftIn(data, sclk, MSBFIRST);//shift all three bytes in
  byte midBYTE  = shiftIn(data, sclk, MSBFIRST);
  byte lowBYTE  = shiftIn(data, sclk, MSBFIRST);
  digitalWrite(sclk, HIGH); // polling pulse
  digitalWrite(sclk, LOW);
  Serial.println(highBYTE);//print all three bytes
  Serial.println(midBYTE);
  Serial.println(lowBYTE);

Which code lines will be executed if digitalRead(data) returns LOW ?
Will highBYTE be declared if digitalRead(data) returns HIGH ?
Which code lines will be executed whatever digitalRead(data) returns ?

Note that I have Auto Formatted the code to emphasise the problems

I'm going to use this chip for Measure the output voltage of a photo diode (100 m V to 800 m V)!!!

Is it possible?

Can you answer the questions in post #3 ?

UKHeliBob:

 if (digitalRead(data) == LOW)

byte highBYTE = shiftIn(data, sclk, MSBFIRST);//shift all three bytes in
 byte midBYTE  = shiftIn(data, sclk, MSBFIRST);
 byte lowBYTE  = shiftIn(data, sclk, MSBFIRST);
 digitalWrite(sclk, HIGH); // polling pulse
 digitalWrite(sclk, LOW);
 Serial.println(highBYTE);//print all three bytes
 Serial.println(midBYTE);
 Serial.println(lowBYTE);



Which code lines will be executed if digitalRead(data) returns LOW ?
Will highBYTE be declared if digitalRead(data) returns HIGH ? 
Which code lines will be executed whatever digitalRead(data) returns ?

Note that I have Auto Formatted the code to emphasise the problems

thanks for this but i’m beginner to programming and only want to display result in serial monitor

thanks for this but i'm beginner to programming and only want to display result in serial monitor

and the answers to the questions ?

Suggestion 1. Always put { and } round the block of code to be executed as a result of testing a value even if there is only one line of code.

Suggestion 2. Put each { and } on its own line with nothing else

Suggestion 3. After doing 1 and 2 above Auto Format your code in the IDE

I'm going to use this chip for Measure the output voltage of a photo diode (100 m V to 800 m V)!!!

Is it possible?