Maker Pro
Maker Pro

Need Help Connecting TTL Data to RS232

D

Doug Kent

I have been doing some research on connecting my laptop to the combus of a
DSC Alarm panel to create a virtual keypad and to better understand what is
happening there. After searching the newsgroups I came across some threads
from people who have tried but it did not appear they had any luck with
their attempts. About 2 years ago I built a circuit connected to a keypad
and wrote a VB program that would read and write to the parallel port
connected to the push buttons to create a virtual keypad. It worked but was
a very poor design. I believe connecting directly to the combus would be a
far better way to communicate. Being able to control the combus would allow
me to interface the alarm system with home automation programs. From my
research and testing it appears the combus on the alarm panel is made up of
Ground, 12 volt B+ line, Data and Clock. I have been able to lock onto the
data stream with my scope using the clock pulse for sync but have not had
any luck finding a converter that will convert the 0 to 12 volt data
stream and clock pulse into RS232 for my computer. I was wondering if
anyone can help me out with a circuit to connect the TTL combus to a RS232
serial port on the computer. After I have connected the computer to the
combus next question is cracking what type of structure.

Any help you can give would be appreciated.

Doug
[email protected]
 
A

Adrian Jansen

If the alarm combus is data and clock, then its totally different from
RS232, and there is no direct way of converting. RS232 doesnt use any
clock, and uses start and stop bits ahead of and behind the (usually) 8 bit
data, at a fixed speed - the baud rate. Synchronous signalling, using clock
and data, usually doesnt use start and stop bits, and may not even have a
fixed clock frequency, so the two systems are completely different.
The only way of making a conversion is something like a microcontroller
which can accept the alarm signals on a clock/data bus, and drive a UART
with what it reads from the data. And likewise for the reverse conversion.
For this you will need a thorough understanding of the alarm combus signals.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
W

Wim Ton

Doug Kent said:
I have been doing some research on connecting my laptop to the combus of a
DSC Alarm panel to create a virtual keypad and to better understand what is
happening there. After searching the newsgroups I came across some threads
from people who have tried but it did not appear they had any luck with
their attempts. About 2 years ago I built a circuit connected to a keypad
and wrote a VB program that would read and write to the parallel port
connected to the push buttons to create a virtual keypad. It worked but was
a very poor design. I believe connecting directly to the combus would be a
far better way to communicate. Being able to control the combus would allow
me to interface the alarm system with home automation programs. From my
research and testing it appears the combus on the alarm panel is made up of
Ground, 12 volt B+ line, Data and Clock. I have been able to lock onto the
data stream with my scope using the clock pulse for sync but have not had
any luck finding a converter that will convert the 0 to 12 volt data
stream and clock pulse into RS232 for my computer. I was wondering if
anyone can help me out with a circuit to connect the TTL combus to a RS232
serial port on the computer.

Your desciption of the combus as between 0 and +12 is not exactly TTL. In
any case, you can connect the combus directly to the RS232 port. As it is a
synchronous signal, I would connect it to the statuslines, like CTS, DSR or
CD and sample the dataline when the clock changes. If the speed is not too
high, you can poll, otherwise you have to use the interrupt op the change of
the statusline. With the scope you ,ay be able to find out the timeing and
wordlength in bits, easing the programming a bit

Wim
 
J

John Fields

I have been doing some research on connecting my laptop to the combus of a
DSC Alarm panel to create a virtual keypad and to better understand what is
happening there. After searching the newsgroups I came across some threads
from people who have tried but it did not appear they had any luck with
their attempts. About 2 years ago I built a circuit connected to a keypad
and wrote a VB program that would read and write to the parallel port
connected to the push buttons to create a virtual keypad. It worked but was
a very poor design. I believe connecting directly to the combus would be a
far better way to communicate. Being able to control the combus would allow
me to interface the alarm system with home automation programs. From my
research and testing it appears the combus on the alarm panel is made up of
Ground, 12 volt B+ line, Data and Clock. I have been able to lock onto the
data stream with my scope using the clock pulse for sync but have not had
any luck finding a converter that will convert the 0 to 12 volt data
stream and clock pulse into RS232 for my computer. I was wondering if
anyone can help me out with a circuit to connect the TTL combus to a RS232
serial port on the computer. After I have connected the computer to the
combus next question is cracking what type of structure.

---
It may very well be that what's on the alarm system's com bus may not
be readable as a valid RS-232 signal, even if the 0 to 12V data signal
is translated to the >±3V <±15V levels expected of RS-232. The reason
is that the RS-232 protocol requires that each transmitted data byte
be set up and transmitted in a certain way, which requires no clock
signal to be transmitted along with the data. If you need help
understanding the protocol, there are zillions of tutorials on the
web, or just ask and someone here (probably me) will surely explain it
to you.
 
S

scada

Doug Kent said:
I have been doing some research on connecting my laptop to the combus of a
DSC Alarm panel to create a virtual keypad and to better understand what is
happening there. After searching the newsgroups I came across some threads
from people who have tried but it did not appear they had any luck with
their attempts. About 2 years ago I built a circuit connected to a keypad
and wrote a VB program that would read and write to the parallel port
connected to the push buttons to create a virtual keypad. It worked but was
a very poor design. I believe connecting directly to the combus would be a
far better way to communicate. Being able to control the combus would allow
me to interface the alarm system with home automation programs. From my
research and testing it appears the combus on the alarm panel is made up of
Ground, 12 volt B+ line, Data and Clock. I have been able to lock onto the
data stream with my scope using the clock pulse for sync but have not had
any luck finding a converter that will convert the 0 to 12 volt data
stream and clock pulse into RS232 for my computer. I was wondering if
anyone can help me out with a circuit to connect the TTL combus to a RS232
serial port on the computer. After I have connected the computer to the
combus next question is cracking what type of structure.

Any help you can give would be appreciated.

Doug
[email protected]

Doug,
You may be able to connect the RS232 directly to the Alarm serial input. The
RS232 standard will usually accept TTL level input - outputs. The spec.
calls for around +3V to +12V as a "Space" and -3V to -12V for a "Mark"
however in most cases the mark will be detected at 0V. Several things you
will need to experiment with, such as the data is usually transmitted on the
PC (DTE) pin 3 and Received on Pin 2. Although sometimes RTS and CTS are
used. Normally RTS and CTS are used for "Handshaking" although. Signal
ground is on pin 5. You probably are not going to need to use handshaking
for this simple communication, but it is a possibility. Next you need to
know what speed to talk at! You will need to experiment with that. I would
try talking in "ASCII" at 8 bits, no parity, 1 error bit (commonly know as
8N1. If that doesn't do it try 7N1. You can try sending-receiving with
Windows HyperTerminal. I use "Docklight", I have had it for awhile but don't
have the web address. Anyway Docklight has some nice features to help you
debug the code, like switching to Binary, ASCII, Hex, etc.. I'm sure a
Google search will bring many free terminal programs.

If the Alarm input connector is a DB9 Female then it is likely (but not
always) a DCE input. The PC's connector is a DTE, so you can use a "Straight
through" cable. If the Alarm connector is Male it is likely that you will
need a "Null modem" cable. Basically a Null Modem cable just crosses the TX-
RX , and the Handshaking lines. Google "Null modem" for the pin out if you
want to make your own. You can also get a "Serial port Monitor" I think
Radio Shack carries them. You can monitor the activity on the pins by
viewing the LED's. If for some reason you still need to create the 0-12V
pulse, then you can use the "max232" IC, or the old standby 1488 & 1489
Receiver and Driver (I believe I read that Jim Thompson designed!) and
change the 5V to 12 using a couple of your favorite NPN transistors in
common emitter configuration. Hope this gets you started, best of luck...
 
Top