synchronous to async RS-232 serial Converter

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
I am performing some initial research into developing a small box that can bi-directionally convert synchronous (clocked) RS-232 to the more standard asynchronous format than be used to interface with a variety of standard async serial interface devices such as Serial over IP, desktop computers, etc. Please note that I am a SW engineer, but have a decent understanding of digital signaling and some electronics knowledge under my belt, but not to this extent.

Unfortunately the modem that we need to interface to still uses sync serial data. The communications to/from the modem would be half duplex. The rates can be any of the following: 2400, 4800, 8000, 9600, 16k, 19.2k, 32k, 38.8k, and 56k. This device would have to provide a clock to the modem. On the other side of the device, the async side would be a standard,say 56K 8-1-n, IO. I am not sure if we would have to modify the async speed or could leave it static at the highest rate.

I am looking to see if:
1. Is this feasible or am I overlooking something?
2. Is the a micro-controller that would provide the majority of the capabilities needed for this solution with a minimum of external components?
3. What would a solutions high level block diagram consist of. I am guessing a USART/UART, PIC microcontroller (or other), power, IO for speed configuration, clock.
4. Could you point out some specific components that could be applicable to this effort? There are so many models of microcontrollers out there that I would never know how to downselect.

I appreciate the help. Thanks.
Tom
 

MrChips

Joined Oct 2, 2009
30,708
Use an MCU that has at least two USARTs or one each, USART and UART.

If you are communicating at different rates you may have to consider how you will implement buffering and flow control.
 

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
I will have to take into account the buffering. I am thinking that the synchronous would be the critical speed, with the Async being the next speed higher. Buffering data that would need to go to the Sync side.

I was watching a youtube video https://www.youtube.com/watch?v=TbKW8vFe-Aw regarding Serial interfacing on a PIC and the presenter mentioned that the Sync side of the USART could only provide 1 data line and a clock. I am not sure if this is standard on most PICs? So would this data line be used for both input and output? The device I am integrating to has a TXD, RXD, CTS, RTS, RXC (Clock out), TXC (Clock In) and DCD, so would it be easier to have 2 USARTs to handle the both the TX and RX?

I have started to look at Microchips MAP engine to select something for testing on a breadboard.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
As it is a trivial task I would be tempted to use a fast PIC to monitor and decode the incoming sync data (by software), then use the hardware USART to transmit the async serial data out.

As long as the input speed <= to the output speed a buffer should not be needed. The only time that will matter is when the input baudrate is 56k.
 

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
What would you define as a "Fast PIC"? So you would just feed in the clock and tx data on a pair of GP pins for RX traffic? For TX, the signal would be another pin and reversing the clock to outbound?
 

THE_RB

Joined Feb 11, 2008
5,438
A PIC18F at the typical top speed 40MHz HSPLL should do that with no dramas.

It just needs to manually check the incoming CLK and DAT on it's pins (an extremely easy task) then use the inbuilt USART TX to send async serial data out.

The only issue i can see is buffering in the case where incoming data is faster than the chosen USART output baudrate. If you use a high enough output baudrate that issue just won't occur.
 

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
Fantastic, This is a great starting place for me to work. Hopefully I can find a PIC18F in a DIP package for breadboard testing. The MAP system does not seem to have a package setting, even though some people mentioned using it.
 

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
I have another question that related to my initial question.

The orginal reason I wanted to convert from Sync to Asyc, was to take advantage of all the hardware that is designed for "regular" RS-232. The hardware in particular I was interested in was something like a DeviceMaster RTS, which is a multiport RS-232 to Ethernet. It even supports looping port to port, so we could route traffic from modem to other hardware, or directly to a computer with driver SW on it.

Now that I am thinking about it, I did a quick google and apparently PIC18 can actually have Ethernet (minus Phy and Magnetics) built in. I have not had a change to review this in further detail, but this seems like a logical shortcut to my final goal.

Just found the PIC18F97J60 Family. Interesting.

Anyone had any experience with these? any specific models?

We are currently using a VERY expensive rack mounted system to perform the same task, and would like to bring it in-house if possible.
 
Last edited:

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
I would like to get both a standard MC to test with and also one of the ethernet enabled ones. I can find the standeard MC in a DIP format, but the ethernet one is 64/80/100-Pin TQFP Packaged.

Could someone point me to the most viable adapter to convert the 64 pin to DIP? I have been able t osolder SMD leads in the past, so It should not be too hard.
 
Last edited:

Thread Starter

thomaskuhn

Joined Jan 21, 2009
20
Quick question.

I am looking at the Olimex devboard on sparkfun which uses the PIC18F67J60. The thing that sucks, is that the single EUSART is wired up to the MAX232 chip, but only wired for typical asynchronous communication. When I start developing would it be easier to completely bypass the EUSART and use another generic GPIO set? Is there a way to easily cut the traces and wire the EUSART to a separate dev board? How much work is the EUSART doing for my particular application?
 
Top