Listening Serial Ports

Hi, guys. I need your help.I want to listen Serial ports by using Arduino. I have 6 Serial Channels and I need to listen these channel and be sure which channel is working. How can I do that? Can I listen this channel by using digital inputs? If I can do that Arduino uno or nano is adequate for my project.

Or Do I have to use a devices which has a 6 Serial ports? Like 2 Arduino Mega?

Are you wanting to read the data from each channel or do you wish to know which of them are active only.

I just need to know which is active

You can probably just bit bang it then, no need for real serial ports. Either digitalRead or do port reads for speed if you have to - just look at which pins are changing.

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Hi, guys. I need your help. I have 6 Serial Channels and I need to listen this channel and be sure which channel is working? How can I do that? Can I listen this channel by using digital inputs? Or Do I have to use a devices which has a 6 Serial ports? Like 2 Arduino Mega?

@aalptekin, your topic has been moved to a more suitable location on the forum; see About the Installation & Troubleshooting category.

Some of the newer Arduino boards based on ARM processors might support up to 6 serial interfaces. The processor on e.g. the MKR Zero (SAM D21) does support 6 serial interfaces but I do not know how many are connected to the pins on the board.

Based on your other thread (I did not follow it to the end), a detection of a falling edge might be sufficient to determine the presence of serial data; that would either indicate a start bit or toggling of data bits. For that, any pin should do.

1 Like

Duplicate topics merged

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

1 Like

I responded to the removed post, so will try again!
What is the voltage being used for each of the 6 signals you wish to monitor?
How are you going to be notified when a channel is active?
Do also need to know when a channel becomes not active? What is the time frame to determine that?
Paul

The channels are working on RS-232 level. That means -+12 Voltage level. I will use RS-232-TTL converter to take data to Arduino. My question is how can i check the channel activitiy. Can I use digital input pins for it?

With the adapter, of course you can if you can define what activity is and isn't.
Paul

I guess that is described in Serial communication detecting :wink: 15 seconds no data.

Or a long stop bit!

I would use pin change interrupts, and keep track of how long it has been since the last changes on each pin. No changes means no traffic. “Some changes” could be assumed to be traffic, or subject to additional analysis for a better guess. Actual serial traffic has a least two changes per character.

Pin change Interrupts on 6 ports simultaneously may strain the capabilities of an Uno , unless the bit rates are pretty low, and/or you re-write the pinChange interrupt code.

I'm with the bangers here.

What baud rate are the serial lines? This might make a difference.

Also, with some gate inputs you won't need to convert RS-232 in any official approved manner. I've run RS-232 with a series current limiting resistor into PIC gates… I leave it to the heavies to propose an adequate solution but it should take but a few components per channel. Certainly a MAX232 thing per channel is overkill.

Direct port access might help, scoop up all 6 channels at once.

a7

Thank you, the baud rate can change but usually it is 19200 and 200. I think to use 3 MAX 232 because max232 has 2 serial converter ports. Do you have any suggest? How can I check the channel is working or not ?

Since all you're looking for is activity, you don't really care if you miss a bit or two. For a first experiment, just digitalRead from the pin that one of your channels is transmitting to. Serial.print what you got - HIGH or LOW. Try that with the transmission running and not running.

I am not sure which way up the signal is coming out of the MAX232, but I'll guess that you're looking for a high bit. When you see one, you can say that there's activity on the channel.

Every time you see a high bit, note the time using millis, using a separate variable for each channel. If it's been a while since you saw one, then the channel has become inactive.

At TTL level, a start bit is LOW; so to detect a start bit, you want to detect a change from HIGH to LOW. And a permanent HIGH would indicate no start bit so no data.

You don't need any MAX232s, you can run RS232 signals into Arduino inputs with a few components.

Perhaps as few as one current limiting resistor, I know this works on other microprocessors, with Arduino you may want to need a few more.

I won't use the old trick of posting something wrong in order to get one of yous to post a correct diagram; would someone please post a plausible RS232 resistor(s) diode(s) cpacitor(s) to Arduino circuit?

As for polarity, change be change. If you watch for change, and infer activity from such change, it doesn't matter what the idle state of the line is.

a7

You might also google variously using

RS232 activity indicator monitor

turns up many relatively simple ways of doing it in hardware.

Scanning 19200 and being sure of catching changes, and doing anything else, might be a bit too much work for the software approach, I’m too lazy to do your back of the envelop evaluation of the possibility of success.

a7