This works fine except if I send a string of 16 characters. Then no characters are received or one or the whole string. 15 characters or less and 17 and more work fine.
Please edit your post and insert your code inside it, using code tags. The code tags make the code look
like this
when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The "Code: [Select]" feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing.
Also, please post your entire sketch, so we can see what is going on.
wolvekamp:
I would like to share to the whole program but there is a 9000 character limit. So see attachment.
There is a huge amount of stuff in that program that is probably irrelevant to your problem. Can you post a short complete program that illustrates the problem?
While preparing the short program you might even find the solution.
wolvekamp:
I started with the short program (in the first post). When I load this program and send a string with 16 characters then the issue appears.
How do you get away with a baud rate of 500,000? Am I missing something? Also what test characters are you sending? You talk about 15,16,17+ characters. Are they all the same character? Perhaps you are getting stuck on some value.
Have you tested this, by making a direct connection from the transmitter to the serial monitor (or comm program), i.e. bypass the pass through arrangement?
The 500.000 baud rate is for the USB port. That isn't the problem. The issue is what I read from serial port 2. It is a strange problem.
So if I execute on Unix the command:
echo "This is no issue" > /dev/tty.serial0 (17 characters including LF)
I get the response:
This is no issue
if I execute on Unix the command:
echo "This is a issue" > /dev/tty.serial0 (16 characters including LF)
I get the response:
T
if I execute on Unix the command:
echo "This is a issu" > /dev/tty.serial0 (15 characters including LF)
I get the response:
This is a issu
It always works fine except if I send a string of 16 characters. I use the last version of Arduino (1.8.13) on a Mac. Serial Port 2 is connected to a RS232 port on a Unix system.
wolvekamp:
I started with the short program (in the first post). When I load this program and send a string with 16 characters then the issue appears.
This is very confusing.
In Reply #2 I asked if the code in your Original Post would illustrate the problem and if not I asked you to post the code that does illustrate the problem. In response you posted the code in Reply #3 which led me to understand that the code in your Original Reply was irrelevant to the problem.
Now, to avoid any further misunderstanding, are you saying that when you run the short program in your Original Post you get the results that you describe in your Original Post?
...R
PS ... do you have a USB-TTL cable that you could try using with a terminal program such as PuTTY or Minicom. I routinely use Minicom for communicating with my Arduinos - some over the regular USB connection and some with a USB-TTL cable.
I regularly use 500,000 baud for communication between my Arduinos and my PC - both with the regular USB cable and with a USB-TTL cable. It is a speed at which the Atmega 328 has no timing error - unlike 115,200
Sorry about the slight hijack, but I see no option for setting the baud to non-standard baud rates in Tera Term. Is that a feature in Putty, etc? Closest rate is 460,800...
are you saying that when you run the short program in your Original Post you get the results that you describe in your Original Post?
that is the question !
This would clearly be @wolvekamp's answer in Reply #6
I started with the short program (in the first post). When I load this program and send a string with 16 characters then the issue appears.
Perhaps he needs to repeat it. Just because we are all having trouble seeing the issue with the original code posted it doesn't mean he is not experiencing the issue.
My question, what are the characters? There is a big difference between say, it only works with 16 characters when receiving "xxxxxxxxxxxUxxxxxxxxxxxUxx...." and "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...". In the former case, there is a clue to an external cause. In the latter, nothing can be found in the input that could trigger such a consistent response.