[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Serial Communications



In article <1130761732.586444.63170@g43g2000cwa.googlegroups.com>,
anoneds@netscape.net <anoneds@netscape.net> wrote:

> tolsen64 wrote:
>> Does the GS just dump characters if the incoming text is too fast?  Or
>> can that even happen?
>>
>> Here's what I have:
>>
>> GS -> Ethernet Modem -> Internet.
>>
>> When I telnet out to a server (NNTP or SMTP), I lose half the
>> characters in the response, so what i'm getting back is useless.
>>
>> Both the GS and the Ethernet Modem's serial speed is set to 19200.
>>
>> I thought it might be handshaking so I spent the day studying every "GS
>> Handshaking" article I could fine (there are a lot of different
>> versions of the beast).  All of them go from the MINI DIN-8 to DB-25.
>> My Ethernet Modem has a DB-9 connector so I tried to "adapt" by
>> cross-referencing the DB-25 signal names to the same on the DB-9.  But
>> I couldn't get it to work (I couldn't transfer data at all) whichever
>> cable i built.
>>
>> The cable I have working now works great as long as i'm not receiving
>> more than a few characters at a shot.  The BBS currently runs using
>> this cable.  I got this cable working by trial and error and I'd have
>> to ohm it out to tell you what it's pin-to-pin connections actually
>> are.  But it evidently doesn't handshake.
>>
>> The other cable I have is one that I used when I had the GS hooked up
>> through the PC to the internet.  It always worked fine.  I got
>> everything that was coming in (I had internet email working on my bbs).
>>  But that cable doesn't work with the Ethernet Modem.
>>
>> I'm wondering if the Ethernet Modem is just too-darn-fast for the GS.
>> I've tried turning on the Buffering & FIFO options in the Ethernet
>> Modem to no avail.  If I turn on the DTR Handshaking in the Ethernet
>> Modem, I get no communications at all.  It only works if I set it to No
>> Handshaking or Xon/Xoff.  But I still have the problem of losing data
>> when a bunch comes in.
>>
>> It seems as if I have hit a brick wall here...
> 
> You need some sort of CTS-RTS handshaking here. CTS tells the other end
> it is "Clear to Send" some data. RTS tells the other end that it is
> "Requesting to Send" some data.

If you want to do it "by the book" then it's supposed to work like this:

1. Two computers (or terminals) are connected to one another through two modems

2. When turned on, each modem raises its DSR connector.  DSR = Data Set
Ready, and "Data Set" was AT&T's name for "modem".  Thus DSR really
means "Modem Ready".

3. When each computer (or terminal) sees DSR raised, it responds by
raising DTR ("Data Terminal Ready").  This is the first handshake pair:
DSR+DTR.

4. Next, one modem dials the other modem.  When the other modem detects a
"ring signal" on the phine line, it raises its RI line (Ring Indicator).
The RI line can be ignored unless you are communicating through real
modems.

5. The answering modem now "lifts the hook" and the two modems start
commuicating through a carrier.  On early 300, 1200, 2400 etc bps
modems this meant merely sending out a tone of the correct frequency.
Modern modems are much more complex - the two modems perform various
handshakes with one another to agree on baud rate, data compression,
etc, but this is transparent to the connected computers.  When the
connection is readu, both modems raise their CD (or DCD) line
(CD = Carrier Detect, CDC = Data Carrier Detect -- they're merely two
names for the same signal).

6. Now the two computers can start to communicate, so it's time for
the next handshake: the computer (or terminal) raises its RTS line
(Request To Send).  Of the modem is ready to receive data, it raises
its CTS line (Clear To Send).

7. When the computer (or terminal) has received the CTS signal,
it can start transmit on its Tx line.  To receive on the Rx line,
the CTS signal need not be raised.

This is "according to tbe book".  However, things can be simplified
considerably.  Computers usually have their DTR and RTS raised
continuously, and sometimes even ignore the DSR, CTS and DCD from the
modem.


Anyway, a "null modem" cable can be one of these two varieties
(GND = signal ground):


A: Full handshake, 7 wires:

GND ------------- GND

Tx  ------------- Rx

Rx  ------------- Tx

DSR ------------- DTR

DTR ------------- DSR

RTS -----------+- CTS
               |
DCD -+         +- DCD
     |
CTS -+----------- RTS



B: Fake handshake: 3 wires
 
GND ------------- GND

Tx  ------------- Rx

Rx  ------------- Tx

DSR -+         +- DTR
     |         |
DTR -+         +- DSR

RTS -+         +- CTS
     |         |
DCD -+         +- DCD
     |         |
CTS -+         +- RTS


B: usually works quite well - it fools one computer to think the
other computer has raised its DSR and RTS lines.


> My old TI didn't even have RTS hooked up, so we TIers cooked up using
> another signal for that. Of course it isn't automatic like RTS is
> supposed to be, but we can turn it off/on when needed, and get 19,200
> without a problem. Even done 38,400 without much difficulty. Just can't
> get 56k both ways.
> 
> I used a Lantronix UDS-10 (serial-ethernet) on my TI at 38,400, with
> RTS-CTS with no data loss... until I fried my Lan card (probably moved
> it with power cord still plugged in...)


-- 
----------------------------------------------------------------
Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
e-mail:  pausch at stockholm dot bostream dot se
WWW:     http://stjarnhimlen.se/