Problems using serial port

  for(i=0; i<6; i++) {
    if (Serial1.available()) {
      int inByte = Serial1.read();
      Serial.write(inByte);
      if(inByte==13) { digitalWrite(21, LOW); }
    }
  }

How fast do you think it will run through this loop if there are less than 6 bytes to read? Why is the loop iteration count set to 6? If it is because that is the number of bytes you need to wait for and read, you need to add the wait for part.
while(Serial1.available() == 0) { // Do nothing } at the top of the for loop, and get rid of the if statement.