Serial monitor and RX at 1 parallel?

Hello,

I am new here and also a beginner with the Arduino and C language. On the other hand, I can look back on 30 years of professional Java development, so I already know a bit about the subject. :slight_smile:

The following is not clear to me when using “Serial” or I don't know how to program it.

I need to use RX on pin 1 to receive bytes at 57600bps from an external device, but at the same time I want to use Serial.println in tests.

Is this possible in parallel? If so, how should I do it?

Hi @javafrank. Which specific Arduino board are you using?

I have ordered a UNO 3.

I may have already found the solution. There is probably a SoftwareSerial library from arduino

#include <SoftwareSerial.h>

I'll try it out with that.

No, it can't be in parallel, and since it is a common requirement, there must be a standard solution. Your SoftwareSerial library is spot on.

Thanx for your comment. I found out that SoftwareSerial library is part of the arduino kernel.
I have just built it into a code and compiled it. And the compiler didn't complain. :slight_smile:

SoftwareSerial has problems at baudrates above 38400baud
try AltSoftSerial or even better move to a microcontroller with spare hardware serial ports, e.g. Mega, ESP32, RP2040, DUE, etc

Thanks for the tip :+1:, I'll keep it in mind in case SoftwareSerial causes problems.

also keep in mind that SoftwareSerial cannot simultaneously transmit and receive - AltSoftSerial can

maybe a good idea if you describe the project in more detail

This is not a problem because the messages (57 bytes) are expected every 400ms and a short 11-byte response is sent after each message. That's all.

It may be.
Is the external device sending 5V TTL level signal?
Will you be receiving and sending at the same baud rate?

Yes both with 56700bps.

The level is adjusted.

56700 is greater than 38400

I will try it out and switch to another solution if necessary. Unfortunately, the 56700bps is the default.

Then change processors to one that has 2 or more hardware serial., Post 7 gives you a list.

are you sure the level from the device is TTL either 5V or 3.3V - not RS232 or RS485
if you input RS232 directly into the UNO you will probably damage it

The level of the device is RS485, which is why a level converter is used in between.

I assume you have a RS485 to TTL converter and know how to interface the UNO to it?

I believe that's 57600.

Ooops, you're right. :grin: