# TTL / RS-232 conversion circuit

Discussion in 'Electronic Basics' started by Will, Jul 1, 2005.

1. ### WillGuest

Hi All,

I am interfacing a ham radio to a computer to program it and I have been
looking at various TTL / RS-232 conversion circuits. However I happen to
have a commercial ADMS programming cable I use with my Yaesu VX-7R radio
(ham radio). This cable also handles this type of conversion so I am
thinking why reinvent the wheel when I can utilize this existing circuit
which is already integrated into the D-sub shell of this cable.

Thus my question:

These generic circuits appear to RS-232 logic levels (+/-12VDC) on pins 2 &
3 of a DB9 connector and converts them to 0 & 5VDC. Which TTL voltage
corresponds to a logic 0 and which to a logic 1? On the RS-232 side, the
data pins use negative logic, so +3 to +12 VDC is logic 0 and -3 to -12VDC
is logic 1. Does the TTL data input use positive logic instead ( logic 1 is
+5VDC and logic 0 is 0VDC)?

What is the industry convention when terminating the TTL side of this cable
to a stereo plug. ... is the tip conductor logic 1 or logic 0? Once I
determine this, then I will use this existing conversion cable and simply
wire the stereo plug conductors to their respective TXD and RXD pins on my
Yaesu FT-857.

Lastly, what happens if one connects the TTL level TX conductor to the TXD
i.e. wires crossed in error

Thanks for any and all info!

73's Will

2. ### Larry BrasfieldGuest

Conventions differ on this between different signals
in the RS-232 standard. The modem control and
status signals are normally active low in the TTL realm.
If you want to deem that "TTL high = logic 0", that is
up to you. The data signals are normally considered
to be at the mark level for a high level in the TTL realm.
That is level usually considered a '1' when considered
to be a number at all.
All TTL<-->RS-232 translators that I have seen are
inverting, and they are used for both the data and the
status/control signals with every serial interface device
I have seen. Without having looked at your equipment,
I can say that if your translators invert, they are quite
likely to be doing the right thing.
I've not seen stereo plugs used for RS-232. But it makes
no sense to call the tip logic 1 or logic 0. Why would such
a limited number of conductors be wasted conveying a
constant value?
Go for it, I say.
No permanent harm, just some frustration and maybe
mystefication when it does not work as you want.
You're welcome.

3. ### CheapscateDaveGuest

I can't say for sure if it's a standard but cables for RS232/TTL to
glucose testers use the tip as RX and small ring is TX and last is
common or ground .If you want a simple 1 chip solution look at the
DS275 from Dallas.

Dave

4. ### WillGuest

Hi Larry / the group,

I've done some more experimenting with my commerical grade cable used with

I've run a number of tests to using a standard 9-pin RS-232 cable (no
conversion) and measured/monitored the TXD and RXD lines on a dual channel
scope to serve as a reference.

As expected, RS-232 data lines idled in a marking state of -11V. Then using
a Windows Hyperterminal session @ 4800 bps, 8 data bits, 1 stop bit, set my
time base on my scope to reflect 208 us/DIV sweep so each bit duration
consume one graticule division. I then monitored the voltages on this line
as I held down and pressed various keys while observing their binary
equivalent on an ASCII chart. I observed 10 bits as expected (1 start bit,
8 data bits, 1 stop bit) and the levels behaved as I would expect.

I captured the screen shots of my scope for each of the characters I used.
I then hooked up my RS-232 / TTL conversion cable for the Alinco unit (not
following:

1. No logical start or stop bits are observed.
2. On some keys, the binary codes produced predictable results, i.e. the
letter U which has alternate bits set (01010101). The TTL output was
comparable, but at ~ 3.5V.
3. TTL levels ranged from 0 to 3.5V unlike RS-232 levels (+/-11V)
4. Not all voltage sequences while monitoring the TXD TTL-level conductor
matched its corresponding bit sequence observed when using the RS-232 (non
conversion) cable.
5. As I recall the RS-232 standard (many years ago for me), the whole
concept of serial communicaitons was asynchronous in nature and hence each
byte was enveloped by a start and stop bit(s) to sync the tx'er and the
rx'er. However, on the TTL side, it appears as though there is no concept
of start and stop bits ( at least logically). Yes, I understand that
there's either 0 or 5V. That's it. But there is no asynchronous start/stop
bits utilized on the TTL side.
6. Since the TTL-side voltage transitions did not always correspond to the
RS-232 equivalent (ie voltage transition intervals), I am wondering if some
sort of encoding scheme is used (NRZ, NRZI, etc) ???

What should data in the RS-232 realm on pin 3 look like after being
converted into TTL level voltages? In some cases, the RS-232 logic level 1
(-11V) seemed to correspond to 0V in the TTL realm. In other cases, it
seemed to correspond to 5V. ?

-W

PS: As for the stero plug, the tip did correspond to RS-232 RXD and the
ring conductor did correspond to RS-232 TXD. Since RS-232 is full duplex
(TXD/GND and RXD/GND pairs), I guess it stands to reason that this
conversion circuit still maintains two separate and distinct paths for
sending and receiving data.

PPS: Not sure I follow about the constant voltage level waiting a conductor.
Since the TTL signals seem to correspond in some relation to the originating
RS-232 data byte, the TTL level signal was only constant in voltage for the
duration of a bit, but it changed in magnitude (0 or 5V) accordingly.

5. ### CheapscateDaveGuest

You could try a wrap jumper..With TTL side connected jumper RS232 TXD
to RXD and scope signals. Then disconnect TTL and connect RS232 and
jumper TTL TXD to RXD and scope signals. You should see the original
and converted signal in each direction.
Dave

6. ### Larry BrasfieldGuest

You're welcome.
I suggest you use a dual trace o'scope. I believe you will find,
if you trigger on one signal while looking at the other, (and do
not use the "alternating" display mode that analog o'scopes
usually have), that they have the same logical state at all times
except for the effects of propagation delay.

[snip]
You asked: "What is the industry convention when terminating the TTL side
of this cable to a stereo plug. ... is the tip conductor logic 1 or logic 0?"
The question makes little sense, so neither does the answer. What you
meant to ask may have made sense, but those words do not.

[Snip confusing top-posted stuff.]

7. ### MikeGuest

Hi Larry / group,
Actually, I see what you mean now re: the tip. I guess it was one of those
things where its clear in my mind but not properly captured on "paper". I
should have wrote: is the tip conductor TXD or RXD. My apologies. From
my testing so far, I have found that the tip is in fact RXD, thus ring is
TXD. Sorry for the confusion!

-W

8. ### mikeGuest

YMMV, 'cause there ain't no standard that everyone adheres to.
My experience has been that I can always make radio interfaces work
with inverting ttl translation.
I also use opto-isolators with appropriate reverse protection and
current limiting. Works for low data rates and helps with my paranoia
mike

--
Return address is VALID but some sites block emails