Serial locks up when no Serial.read() ?

Status
Not open for further replies.

Jp3141

Well-known member
Simple program outputting some characters. If I type into the serial port (either with Serial Monitor or Coolterm), it frequently hangs when the buffer contains ~30 characters -- not always, but maybe when I cross a 30 (32 ?) threshold within one loop.

Code:
void setup() {Serial.begin(9600);}

int i=0;
void loop() {
 //Serial.println(i++);
 Serial.println(Serial.available());
 //while (Serial.available()) Serial.read();
 delay(100);
}

when I enable the Serial.read(), it is 'better' but sometimes still fails.

I this expected ? Even if I don't expect to receive characters in my program, should the Teensy lockup in this way ?

Using Arduino 1.6.7 on OSX 10.9.5; Teensy 3.2
 
..i tried it, i can't see any fail or hang.

Which OS you are using ? Is it a MAC ?

edit: oops, you mentioned it.

MAC has some problems. Its a Bug in the OS.
 
Status
Not open for further replies.
Back
Top