Go Down

Topic: Routing RS-232 with Arduino (Read 764 times) previous topic - next topic

r_keates

Hi guys

Pretty new to Arduino, however i've been given a challenge, and from what i've seen so far, i'm hopeful that the Arduino might be able to achieve what I need to do. The scenario is this:

- 1 RS-232 source (audio processor unit)
- 2 RS-232 receiver (video switchers)

The RS-232 source (sound processor) has only one RS-232 port, but I need to control the 2 video switchers separately. The video switchers use a predefined set of RS-232 Hex strings to switch particular inputs to outputs (8 x 8 matrix switcher, so 64 "switch" hex strings).

What i'm hoping to achieve is this:

- We fire a serial string out from the audio processor (HEX or ASCII), this would be a custom string such as Unit2Input1Output5 , to the Arduino, which would be listening on one serial port. Once it sees this command come in, I need it to fire the relevant command ("Input 1 to Output 5" in this instance) to the relevant video switcher (switcher 2 in this case).

Essentially I want the Arduino to act as an RS-232 signal router, listening for commands and using (I'm guessing here) a lookup table or similar to translate the incoming command to the correct output command, and to the right RS-232 output port. Alternatively I can send the signals out to the video switchers using serial over IP, but the incoming signal from the audio processor will always be hardwired RS-232.

I have an Arduino Mega, and a few premade PCBs with a DB9 socket and MAX232 ICs on board (RS Components MAX232 PCB)

Can anyone tell me whether what I'm trying to achieve is even possible? I don't want to spend days working on this only to find out that what i'm asking it to do is outside the Arduino's capabilities.

If you need any information or clarification jut ask

Thanks in advance

Rob  :)

KeithRB


jrdoner

If you're dealing with 5 v. TTL RS232, you might just set up an arduino with pins 0, 1 as your incoming, and establish two software serial ports on four other pins.   This assumes that the RS232 from your source matches the Arduino's idea of RS232 is.    Easy enough to test.  Check for voltage compatibilty, get some incoming data, and try to parse it.

If your dealing with 12 v. RS232, then you'd need some additional circuitry but I think 12v. to 5v. RS232 converters are readily available.

So if its hardware compatible, you get messages in on serial 0, and send 'em out as specified on the two SW serial ports.

MorganS

Read Serial Input Basics - Updated to get some ideas on how to parse the commands coming from the source into the Arduino.
"The problem is in the code you didn't post."

allanhurst

 The old RRS2q32 standard used -12..+12v signalling ( a long time ago)

The MAX232 from maxim was the standard way to interface to 5v.

regards

Allan.

lastchancename

#5
Aug 23, 2016, 05:06 am Last Edit: Aug 23, 2016, 05:07 am by lastchancename
So if its hardware compatible, you get messages in on serial 0, and send 'em out as specified on the two SW serial ports.
Ignore this.
If you're using the MEGA boards (chips) - they have FOUR hardware serial ports on-chip.
Far easier and more reliable than using software serial. (and use less code space)

Otherwise the suggestions above are all valid.
You can buy RS232 i/o breakout boards on eBay for <$5.00 each - connect directly to the HW serial pins on the MEGA boards. Nothing else needed.
Experienced responders have a nose for laziness, (they were beginners once)... Sure, there are trolls, chest-beaters, and pretenders - but the help you'll get here is about as good as it gets - if you try to help youself!.

sterretje

If you're dealing with 5 v. TTL RS232, you might just set up an arduino with pins 0, 1 as your incoming, and establish two software serial ports on four other pins.   This assumes that the RS232 from your source matches the Arduino's idea of RS232 is.    Easy enough to test.  Check for voltage compatibilty, get some incoming data, and try to parse it.

If your dealing with 12 v. RS232, then you'd need some additional circuitry but I think 12v. to 5v. RS232 converters are readily available.

So if its hardware compatible, you get messages in on serial 0, and send 'em out as specified on the two SW serial ports.
When using a Mega (as OP does), there is no need for SW serial ;)
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

r_keates

Thanks for the replies everyone - it's nice to know that i'm on the right track with this!

Is it permissable to post on here to ask if there are any developers who might be interested in taking this on as a paid project, or am I likely to get kicked off the forum?!

I'd like to get it done fairly speedily and at present I just don't have enough knowledge of the programming languages involved to get the project to the point I need it to be at.

Thanks

Rob

sterretje

You can ask in the gigs & collaboration section.

Or you can try something and ask for help here or in the programming section when you get stuck.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Paul_KD7HB

In the early 1980's I designed and programmed a communications front-end-processor based on an Apple II. It let Data General mini-computers pretend to be main-frame computers.

I highly recommend you add a two-line LCD display to your project so you can display the incomming message on one line and the outgoing message on the second line. Debugging will be infinitely easier.

Paul

Go Up