Jump to content

RS-232-Bricklet communication with Arduino and usage of the FLOWCONTROL


Recommended Posts

Dear List

I have a strange behavior by the communication between a RS-232 bricklet and an Arduino (TTL-based communication). The communication is only one-way (using only one wire between TX of the bricklet and the RX of the Arduino.

The information sent is a simple ASCII-string terminated with an "\r\n".

The application on the TF-side is written in C#.

Using the setting


the communication only works, if the C#-application is stopped by a debugger-stop and launched again. As soon as the C#-application runs normally (without debugger-stop), the communication is not successfully on the Arduino-side. The code sending the message over the TTL-connection runs in a background-worker-thread. And an additional sleep of the calling thread is not solving the problem (the assumption was, to simulate the debugger-stop.

Using the settings


lets running the data-exchange, but the data are not received correctly.


  • Does anyone has an idea, what could cause this kind of behavior?
  • Do I have to implement a two-way-communication to get it running?
  • Is FLOWCONTROL a good starting-point for any further research to solve the problem?

Looking forward to any ideas and thoughts.



Link to comment
Share on other sites

If you only have TX connected then hardware flowcontrol does nothing, as it needs extra pins connected. With software flowcontrol you also need to turn that on on the Arduino side.

Maybe you're sending the data faster than the Bricklet can transfer it or the Arduino can handle it.

What's the baudrate? How big is the data you send? How long does the Arduino take to handle the data?

Maybe simplify your C# program to just do a single write and make sure that works.

Link to comment
Share on other sites

Dear photron

Thank you very much for the fast replays and the suggestions.

Currently I am using a baudrate of 9600 and the data I am sending are rather small:

  • "123.444;-999.99;-999.99;2199.456;2076.765;-999.99;-999.99;-999.99\r\n"

The values of -999.99 are for further use and eventually replaced later by smaller numerical values similar to the other ones. Each dataset can be sent once every 500msec.

In a simplified C#-application, the approach works. Based on this experience, I implemented it into the main application using a loop sending data constantly instead of once and then the application stops.

The strange thing is, that using a debug-stop allows the Arduino doing the work. But not a paused thread on the side of the C#-application.

Almost 20 years ago, I had to trigger system-calls within C#-applications by a specific system call. As I remember, this call allowed the system to get the internal jobs done. No idea, if this is a similar problem ... and no idea anymore, how we triggered this call then.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...