Hi,
I am working on a home brew SBC and am trying to build a serial cable for
it. Are there any RS-232 serial port gurus who could help me plumb out a
custom cable?
The SBC serial connection works but as it currently is configured it only
works as 3 wire serial with no flow control (ie, RD, TD, & GND pins).
I would very much like to make the serial cable and SBC support hardware
flow control. Having the DSR/DTR pins connected should allow it. However
the PC is expecting CTS/RTS hardware flow control.
I find it better to think in terms of 'handshake in' and 'handshake out'
pins for things like this. Sure it's completlely mangling the RS232 spec,
but any use of hardware flow control does that (at least according to the
spec I've read).
In your case :
On the PC, Handshake out is RTS (prssuambly asserted whrn the PC is ready
to receive). Handshake in is CTS (the external device asserts this when
it is readt for the PC to send something to it)
On the SBC, handshake out is DTR (asseted when the SBC is ready to
receive I guess), handshake in is DSR (asseted by the PC when it is ready
to receiv soemthing from the SBC).
My SBC UART is wired so that the RD, TD, DTR, DSR, and GND pins are brought
to the serial connector. I probably should have brought CTS & RTS out but
it is too late to change it now.
I have wired a cable like this which works for 3 wire serial (no flow
control)
PC DB25 (9 to 25 pin cable) SBC (25 pin female)
2 TD----------------------RD
3 RD----------------------TD
7 GND---------------------GND
6 DSR---------------------DTR
20 DTR---------------------DSR
That would, I think, work for hardware flow control if the PC was using
DSR/DTR flow control, not RTS/CTS.
Obviously this cable does not support hardware flow control because when I
try to connect with hardware flow control enabled, I can see the SBC boot
message on the terminal screen but cannot send characters from the PC to the
SBC.
So I have been experimenting trying to figure out how to fix this. I got
the data sheet for the 16C550 and a serial port breakout box. After much
combinations, I discovered that if I connect a jumper between the PC serial
port pins 5 (PC CTS) and pin 20 (SBC DSR) then the serial port *DOES*
support hardware flow control. At least it appears to. I get the feeling
though that I am mixing dissimilar control signals and it is confusing me.
My question is, does the above configuration with the PC CTS and SBC DSR
connected really use hardware flow control or is it just "faking out" the PC
and/or SBC UART? As a follow on, are both sides actually getting hardware
flow control or is it just one side or the other?
This is my new and improved serial cable with *appears* to support hardware
flow control. Is there any way to test this?
PC DB25 (9 to 25 pin cable) SBC (25 pin female)
2 TD----------------------RD
3 RD----------------------TD
7 GND---------------------GND
6 DSR---------------------DTR
20 DTR----+----------------DSR
5 CTS----+
Alas that's 'Faking it' I think. DTR is an output on the PC, it's being
sent back to the PC's CTS (which is the handshake in line), so the PC is
always being told it can transmit (I assuem DTR is aserted all the time
by the PC). And by connecting that to DSR on the SBC, you're telling the
SBC that it can send any time it likes.
How about the following :
PC SBC
TxD ---------- RxD
RxD ---------- TxD
Gnd ---------- Gnd
RTS ---------- DSR
CTS ---------- DTR
DSR--+
DTR--+
-tony