Possible RX / Serial issue Help

Hi,

Im trying to use my Arduino Uno R1. I have not had any success getting response from the RX. when i run a while(Serial.available=0), it will hang there forever. I have also tried doing an iteration of serial reads in my set-up just to ensure there was nothing in the buffer when i ran the "available" command.

Any thoughts or ideas? Any suggestions on how i would test if my RX is broke? I have extra Atmel chips. I have tried replacing it with a new one, and it doesnt seem to fix the problem.

The example on the site doesnt work. I am using a USB to Arduino cable E101344-C. I believe this should allow me to do both RX/TX. I have used it for past projects, but dont recall if they required Serial.reads.

int incomingByte = 0; // for incoming serial data

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}

void loop() {

// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();

// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}

What you have seems more complicated than it need be

void setup()
{
    Serial.begin(9600);
    Serial.println("OK then, you first, say something.....");
    Serial.println("Go on, type something in the space above and hit Send, or just hit the Enter key"); 
}
 
void loop()
{
  while(Serial.available()==0)
  {}
  delay(500);
  Serial.println("I heard you say:      ");
  while(Serial.available()>0)
  {
    Serial.write(Serial.read());// note it is Serial.WRITE
  }
  Serial.println("");
}

OK. I have made simpler tests. Although I did try this and also posted this as this is an official arduino code on their website.

when i run a while(Serial.available=0), it will hang there forever.

That isn't valid syntax.

The example on the site doesnt work. I am using a USB to Arduino cable E101344-C. I believe this should allow me to do both RX/TX. I have used it for past projects, but dont recall if they required Serial.reads.

Can you elaborate on this point?