PDA

View Full Version : Is the world ready for TTL RS-232 serial?



hansknec
- 22nd July 2005, 16:31
What do I mean? What I'm really asking is has anybody out there found a PC or MAC or UNIX machine that will not communicate with a PIC directly? We have always had the option of putting the 20K resistor on an input pin and receiving the data from another "true" RS-232 device and I have yet to find a platform that will not receive the TTL level signals transmitted from the PIC. If the USART receive pin is used, we would need a converter (MAX232 or equiv), or a simple FET to invert the signal.

The reasoning behind this question deals with hanging multiple PIC's on a single RS-232 network. I've been doing just that for 15 years now and have not had any failures or communication errors in my workplace (an industrial environment). I am now going to manufacture a device that will go to market and I'm debating (with myself) whether or not I should place a MAX232 on each device. If I do then I immediately limit myself to the number of devices I can hang on a single serial port because the RX pin on a MAX232 has a 5K input impedance. Without the MAX232 I could easily parallel 20 PICS on one line without any problems. I know what you're thinking... why not put a RS-485 interface instead? Well I did that and I actually end up getting more comm errors than with no converter chip at all. There seems to be an added complexity with RS-485 in which the end termination needs balancing resistors based on the number of devices you have connected. I'm starting to get the impression from trade journals that industry is moving away from 485. The end user of my product might use between one and twenty units on a single serial port and I want the comm link to be stable for all situations.

I welcome your comments and exeriences.

John

NavMicroSystems
- 25th July 2005, 20:42
John,

when RS232 (V.24) was designed there was a good reason for using +/- 12V Levels.

If you want your product to be compatible with any other RS232 (V.24) Device
you should have level-shifters (and stick to the specs).

If you want to connect 20 (or more) devices to a bus
with almost no limitation in bus lenth
(with proper termination)
RS-485 is a good choice.



...has anybody out there found a PC or MAC or UNIX machine that will not communicate with a PIC directly?


This is not a matter of the operating system, it is a matter of hardware design.

(...and I have found several boxes with really bad designed interfaces)

There is no free lunch:
Of course you can make your interface more tolerant
(in terms of voltage levels),
but at the same time you make it less tolerant to failure.

hansknec
- 25th July 2005, 21:36
You're right of course. But I'm really reluctant to send out a RS-485 system based on my own experience with the termination problems. Its also harder on the end user because they will need a 232 to 485 converter for each network. I should probably do some reading, but I would think I could get an RS-232 chip and tri-state the drive to high Z, and thereby effectively allow multiple units to sit in parallel. The down side is that I haven't found any 232 recievers with a high input Z. They all seem to have 5K by design.

John

NavMicroSystems
- 25th July 2005, 23:02
... I'm really reluctant to send out a RS-485 system based on my own experience with the termination problems. Its also harder on the end user because they will need a 232 to 485 converter for each network

There is no big difference:
You'll either need an RS232 Level Shifter or RS485
Transceiver.


RS232 is actually not designed for your kind of application.

However,
a number of Listeners on a the same bus with a single Talker shouldn't be much of a problem.
(Even boosting the fanout of a standard driver is no real problem)
But you should bear in mind that you are most likely running off specs
and the price you have to pay is less compatibility and reliability.

With more than one Talker it is going to be difficult.

(There is no standard RS232 Driver with Open Drain).

Imagine the following scenario:

You presume: any device your product could be linked to is within the specs,
so there shouldn't be much of a problem if your product is slightly off specs.

Now the Designer at the other end has had the same thought
and is as well slightly off specs (but the opposite way)

Guess what:
Those two devices will (most likely) not be able to talk to each other!
(Worst case they could even destroy each other!)

So again:
there is a reason for standards being exactly defined.
And a good design is supposed to be within the specs.

hansknec
- 26th July 2005, 03:09
With more than one Talker it is going to be difficult.

(There is no standard RS232 Driver with Open Drain).


But there are many RS232 tranceiver chips that have controllable shutdown modes that put the transmitter in a high Z mode and still pass the receive characters. (See MAX2211E) My PICs only respond when specifically addressed and asked a particular question. My code would only enable the transmitter when it has determined that it's time to talk. The master station (PC) polls all slaves (PICS) in sequence and only skips if a reply is not sensed within a specified time period.

I understand your wanting me to stay within the specs of the standard, but in my mind I'm secretly hoping that you and others would agree that such a system could indeed operate reliably using RS232. I am really not very fond of RS-485. I avoid it like the plague when purchasing instrumentation from others, and I would expect that many of the potential customers would feel the same.

I have purchased some RS-232 devices from ZABER.com (linear actuators) that use standard RS-232 to one or many devices in series. They had an interesting approach to their networking of the devices where only the first device would receive the true RS-232 signal and then it would retransmit the signal to the next one down the line. In this approach all devices had to actively pass the signal regardless of whether or not they were the intended target.
I guess there are about a bazillion ways of doing it.

NavMicroSystems
- 26th July 2005, 11:43
...In this approach all devices had to actively pass the signal regardless of whether or not they were the intended target.
I guess there are about a bazillion ways of doing it.
I wouldn't like this solution, because if one device on the bus fails all others further down the line would be disconnected.

Sure, there are many ways...

I don't know why you dislike RS485 that much, it is proven to be reliable.

And of course you can setup a bus using a kind of RS232,
but if it is off specs don't call it RS232,
because RS232 implies it is within the RS232 specs.
(And people may tend to hook it up to standard RS232 devices, which may cause problems)

Imagine you connect a standard driver (that drives the line to +/- 12V in idle state) to "your" kind of bus . . .

If you call it John'sSerialBus
noone would hook it up to a standard serial port without having had a look at the Manual first (hopefully).

hansknec
- 26th July 2005, 15:23
I wouldn't like this solution, because if one device on the bus fails all others further down the line would be disconnected.
I agree.


Imagine you connect a standard driver (that drives the line to +/- 12V in idle state) to "your" kind of bus . . .
I Agree.
I thought it would be clearly apparent that the user could only connect my devices because the 9-pin serial gets converted to RJ-11 and would only be able to plug into my network. Each device on my network has two RJ-11 sockets that allows the units to be daisy chained on to the network (in parallel).

My existing devices are RS-485 now and they work, but I was just trying to come up with a simple to integrate RS-232 solution to save the end user some $$.
-John

hansknec
- 26th July 2005, 15:56
http://pdfserv.maxim-ic.com/en/an/AN723.pdf

A detailed tutorial about this very discussion. I wish I had googled "multidrop RS-232" before posing the question, but instead I had googled "multiple RS-232 devices on a single network", which got me nowhere.

So the end answer is that there are specific RS-232 Tranceivers designed just for the very purpose of developing a multi-drop RS-232 system (that remains within the EIA-232 standard)

The MAX3322E is one chip designed for this purpose. ($3 each)

Thanks for your input Bruce. I will now have to weigh all my options and perhaps order a dozen of these chips to build a prototype network.

-John