Teensy long Serial.print is trunked

2n3055

Well-known member
Hi,

Long text is trunked. If you download it many times you will see rarely the full text.


Code:
void setup() {
  // put your setup code here, to run once:
delay(1000);
Serial.print("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
Serial.flush();
}

Most of the time you get :
Code:
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the

I tried to expand the serial buffer: https://forum.pjrc.com/threads/54773-Inreasing-USB-Serial-Buffer-Teensy-3-2?p=194517&viewfull=1#post194517. Without succes.

Why ??

Thanks
 
Hi,

Long text is trunked. If you download it many times you will see rarely the full text.


Code:
void setup() {
  // put your setup code here, to run once:
delay(1000);
Serial.print("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
Serial.flush();
}

Most of the time you get :
Code:
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the

I tried to expand the serial buffer: https://forum.pjrc.com/threads/5477...fer-Teensy-3-2?p=194517&viewfull=1#post194517. Without succes.

Why ??

Thanks

Sadly, that's nothing you could fix.

I'm looking for the popcorn right now....
 
Before I jump into trying to reproduce this, can you tell me which Teensy model you're using, and which operating system & version? Please also confirm which version of Teensyduino you have (to check, click Help > About in Arduino) so I can know which code you're really running on the Teensy side.
 
Last edited:
I've tried that code on a Teensy 4.0 with TD 1.56 and Arduino 1.8.19 with Serial monitor on a PC.
It worked 20 times in a row.

Pete
 
Seems to work every time with Teensy 4.1 used with Ubuntu 20.04 running Arduino 1.8.19 + Teensyduino 1.56.

screenshot.png
View attachment 27482
 
Just tried on a T_3.6, ALSO a T_4.1, with slight code MOD - to assure SERIAL is online before printing. It worked properly on T_3.6 - minor glitch on T_4.1 - maybe a Teensy_SerMon issue with overflow?:
Code:
void setup() {
  // put your setup code here, to run once:
  delay(1000);
[B]  while ( !Serial );[/B]
  for ( int ii = 0; ii < 10; ii++ ) {
    Serial.println("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
    Serial.flush();
  }
  Serial.print(" \n SECOND group - NO FLUSH \n\n");
  for ( int ii = 0; ii < 10; ii++ ) {
    Serial.println("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
  }
}
void loop() {
  // put your main code here, to run repeatedly:

}

Output from T_4.1 where last line looks SHORT and TENTH line missing?
Restarting T_4.1 this did not REPRO - Both sets of TEN lines match:
Code:
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
 
 SECOND group - NO FLUSH 

If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit anther receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active.
 
Also tried it several times with Windows 10. Every time I see this:

capture.png

Admittedly, I just opened the serial monitor on a Windows 10 machine and then took the same Teensy 4.1 which I had just programmed on Linux and plugged it into the Windows machine. Unplugged and reconnected the USB cable several times, always with the serial monitor responding as you can see in the screen capture.

Willing to try more... but waiting for more detail like exactly which Teensy model and operating system to use for reproducing this issue.
 
First code may be printing before Sermon is online on the machine at hand with just a 1 sec delay()

Line seems to have about 730 characters.

The FAST USB T_4.1 seems to be overwhelming the SerMon on repeat

Moved the second loop that would fail to LOOP on 2 sec wait between with 100us delay to prints and it is running fine - 30 minutes of output no observed missing text errors.
10 us delay was not enough in those sets of 10. Added index print to help line counting:
Code:
void setup() {
  // put your setup code here, to run once:
  delay(1000);
  while ( !Serial );
  for ( int ii = 0; ii < 10; ii++ ) {
    Serial.println("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
    Serial.flush();
  }
}
void loop() {
  // put your main code here, to run repeatedly:
  delay(2000);
  Serial.print(" \n SECOND group - NO FLUSH \n\n");
  for ( int ii = 0; ii < 10; ii++ ) {
    Serial.print( ii );
    Serial.println(" If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
    [B]delayMicroseconds( 100 );[/B]
  }
}
 
You need to update your versions of the Arduino IDE and Teensyduino. Currently, they are Arduino 1.8.19 and TeensyDuino 1.56.
Which MAC? (might be important)

Pete
 
Sorry, I re-open this thread because it doesn't work!!!!

Now Teensyduino 1.56 Arduino 1.8.19. On MAC (10.14.6, iMac LAte 2015) USB-> serial converter FTDI232.

With this code:
Code:
void setup() {
Serial.begin(9600);
delay(1000);
Serial.print("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
//
  for ( int ii = 0; ii < 10; ii++ ) 
  {
    Serial.println("If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. ");
//Serial.flush();  /no change !
delayMicroseconds( 100 );
  }
}


Code:
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active. 
If begin(baud) is called after serial data is already incoming, any 0 data bit may be mistakenly detected as the first start bit, resulting in corrupted reception. If started out of sync, the receiver needs an idle time of 9 bits between a stop bit and the next start bit to get into sync. Certain 100% bandwidth utilization patterns may never sync, which is a fundamental limitation of serial communication.This simple example shows how to use both the UART and USB Serial at the same time. Both are monitored for incoming bytes, and when either receives data, the results are printed to both.This simple example shows how to use both the UART and USB Serial at the same time. It may also be used while the serial port is active.

Only the first reply is complete !!! After it stops at the same place !!!

Try to extend the delay to 1000 or/and flush, no change !

Same result with Teensy 3.6 , Teensy 4 and Teensy 2.
 
Last edited:
On MAC (10.14.6, iMac LAte 2015) USB-> serial converter FTDI232.

I don't understand what a FTDI USB-Serial converter has to do with any of this. You're using Serial.print(), which transmits with USB virtual serial built into Teensy. That communicates directly to your Mac over the USB cable plugged into Teensy. To use hardware like a FTDI USB-Serial converter, you would wire that converter to TX1, RX1, GND and then use Serial1.print() rather than Serial.print(). But your code isn't using Serial1 at all.

Pete called it with Serial.print() vs Serial.print().

And regarding "After it stops at the same place !!!", the output you showed has the text printed 10 times. That seems to correspond perfectly with "for ( int ii = 0; ii < 10; ii++ )" that runs the Serial.println() function 10 times.

From everything we can see (no photos, no idea how FTDI hardware is connected) everything you've shown seems to be working as it should.
 
I don't understand what a FTDI USB-Serial converter has to do with any of this. You're using Serial.print(), which transmits with USB virtual serial built into Teensy. That communicates directly to your Mac over the USB cable plugged into Teensy. To use hardware like a FTDI USB-Serial converter, you would wire that converter to TX1, RX1, GND and then use Serial1.print() rather than Serial.print(). But your code isn't using Serial1 at all.

Pete called it with Serial.print() vs Serial.print().

And regarding "After it stops at the same place !!!", the output you showed has the text printed 10 times. That seems to correspond perfectly with "for ( int ii = 0; ii < 10; ii++ )" that runs the Serial.println() function 10 times.

From everything we can see (no photos, no idea how FTDI hardware is connected) everything you've shown seems to be working as it should.


Sorry my mistake !!
I haven't see the first serial.print !

Topic closed !!

Sorry and thanks!
 
Back
Top