Baud rate converter

i am new and inexperience trying to find my way up on serial communication.

Kindly advise which board will be most suitable for the following Baud rate conversion using rs232

Thank you in advance

input
Baudrate 38400, data length 8bits,stob bits 1bit,parity even, data format binary, handshake none
to

(out put1)
baudrate 9600, data bit 8, stop bit 1 , parity even , data format binary , handshake off

(output2)
baudrate 9600, data bit 8, stop bit 1 , parity even , data format ASCII , handshake off

Something with at least 3 serial ports.

I would strongly suggest that you need 4 - one to be used for debug/diagnostics & programming.

Because the input rate is much faster than the output rate, you will need some buffering ...

1 Like

Did you know that posting in all capitals is consider shouting, and bold large letters also has the same effect.

You can't buy a baud rate converter, it is a job for a micro controller.
If you use an Arduino Mega you have four hardware serial ports to do this. Note however that having an input rate faster than an output rate will cause what ever buffer you have to overflow eventually.

1 Like

And to reliably do that all your communication MUST be in identifiable messages so any error detection and correction can be done before the message is forwarded at the new Baud rate.

Not necessarily - so long as the input stream has sufficient gaps to allow the outputs to "catch up".

But it's risky to rely upon that.

Would make far more sense to have flow control on the input side.

And, as @Paul_KD7HB said, some sort of error & packet-loss detection & reporting ...

Yes but this is extremely unlikely to happen. I used to set exam questions along these lines, asking how long would it take a specific size buffer to overflow. It is just like the classic primary school problem of a bath tub overflowing.

If you can't control the baud rate from the source what makes you think you can control the data rate?

3 Likes

i have few rs232 splitter lying around , will it be a bad idea to split my input and use 2 uno board ( cost effective from local stores)

That won't help you at all.

A UNO has only one serial port.

It's the forum software in combination with how the OP composed the post :wink: And if one does not know where to look it's not easy to fix :wink:
Below creates the shouting text

-text
-

You are now asking us more questions without supplying any more details.
For example what is this mystery source of RS232 data?
What do you want to do with it?
Why do you think you need to use two processors?

All these things are important if you want specific informed help. Otherwise we can only help with general comments which might not apply in your particular case. In other words we only know what you tell us.

Do you know that you can't feed an RS232 signal directly into an Arduino, it has to be converted into a TTL serial voltage before you can?

Do you know that an Arduino only produces a TTL signal serial output and if you want this to be in an RS232 format it has to be converted?

Do you actually mean RS232? Because that has different voltage levels that represent the signal.

1 Like

@memorycreator

Based on @Grumpy_Mike's post #3, OP may proceed with the following Arduino MEGA based setup.
uartMega4Ports

Wait until you have received a complete message from UART1 Port at Bd = 38400. After that send that message to your desired destinations using UART2 and UART3 Ports at Bd = 9600. In the meantime, you might have missed many messages from UART1 Port. After that collect another message from UART1.

A great illustration of how a diagram can clarify what words fail to convey!

It also highlights another thing that's unclear from the original post: Is the data bidirectional, or is it purely one-way - from the 38400 to the 9600s ?

We don't actually know that the comms is message-based.

Even if it is, I wouldn't necessarily wait for a completed message - that could be wasting precious time that the slow (9600) output channels need to keep up!

You could use a Circular Buffer (aka "Ring Buffer") to just "stream" from the 38400 to the 9600s...

1 Like

Don't forget to take into account that your conversion from binary to ASCII representation of the data will almost certainly increase the volume of data being sent through output2. That will further limit how much input data can be handled before overflowing the memory available for buffering.

1 Like

Yes but that will skip information every time the buffer overflows. You will loose a buffers worth of data, and if the whole data is not confined to a single byte you will also loose the order the data is sent in.

So useful only for single byte data stream, and even then you will miss whole buffers worth of data at a time.

But that's going to happen whatever you do!

Not necessarily.

Absolutely it is going to happen when the buffer overflows.

When implementing any sort of FIFI buffer, it will be implemented as a circular buffer. It would be crazy to do anything else. So your distinction between a buffer and a circular buffer is a fallacy.

1 Like

Nope. IF the buffer overflows. Look, you guys are "diddling the pig". Until the OP gives up some info about the source of this data stream, it's so many wasted electrons. The source could be a smart sensor that barfs a 6-byte measurement once a second, or it might be a continuous stream of single byte values, no break whatsoever. No one but the OP knows enough to give a decent answer. Unless, of course, you figure you're just providing indigestible gravel for an AI bot to chew on - if so, continue!

1 Like

But I've yet to see functionality for a FIFI buffer. Isn't that just an black hole? :wink:

2 Likes

What about a hardware one?

That is why I asked for more information in post #11 we are now at post #19 and still no sign of the OP answering. I suspect he might not know the answer, which is why he has not replied. But it would be great if he acknowledged this point and we could all stop wasting time.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.