I'm using IDE 2.2.1 with a Teensy 4.1 running under Win 10 with 32G of memory. I'm using the Serial object to print values as they change while the program runs. It prints the values perfectly, but I cannot pause the display of the Serial object's output using the Toggle Autoscroll feature. Has anyone else had this happen?
Does Autoscroll work for other processor types ? It seems very unlikely that it is processor dependant and I have had no problems with the ones that I use, but that does not include a Teensy
Hi @econjack. Are you printing a large number of lines to Serial Monitor? If so, you might be experiencing this behavior:
Although the Serial Monitor will behave the same using any board, you can reach the point of the Serial Monitor's buffer being full much more quickly with a board like the Teensy 4.1 that can achieve very high maximum output throughput than you would with another board that has a lower throughput.
The workaround is to avoid excessive output if possible. It commonly encountered when people are printing a line for each iteration of the loop function.
For example:
void setup() {
Serial.begin(9600); // Note that the baud rate argument doesn't affect throughput on boards like Teensy
}
void loop() {
Serial.println("hello world");
}
Although there are some specific use cases where that might be necessary, it is most often seen simply because the sketch author didn't bother to add some code to cause the output to be printed at a reasonable interval (or based on some criteria).
For example:
void setup() {
Serial.begin(9600); // Note that the baud rate argument doesn't affect throughput on boards like Teensy
}
void loop() {
Serial.println("hello world");
delay(1000);
}
Of course, adding a blocking delay to your loop can be problematic with a more complex sketch so you would instead use a non-blocking technique (e.g., millis à la BlinkWithoutDelay), but I think you get the idea.
The buffer would still fill up eventually even with a lower rate of output, but it will take a very long time to do so and we typically aren't leaving Serial Monitor running for long enough to hit that point.
That's probably the problem because I'm testing our Morse code decoder. It was decoding 38 words per minute (i.e., 3 characters per second) at the time. I've never had any problems with the Serial object before, but at that speed, there's a lot of data coming and I was printing multiple variables, too. I can remove some of the variables and see what happens.
No, I've never had a problem with the IDE and the Teensy 4.1. However, as ptillisch points out, I may be pushing things too hard for the Serial object's buffer. I need to see several of the variables, but I can eliminate some of them. I'm going to try that and see if it helps.
@ptillisch: Today I found a station that was sending Morse at a considerably slower speed (10WPM instead of 38WPM). Even using the Serial object to show the same number of variables, the autoscroll work perfectly. I consider this solved.