On 8/27/12 11:31 AM, Jochen Kunz wrote:
On Mon, 27 Aug 2012 08:30:59 -0700
Al Kossow<aek at bitsavers.org> wrote:
I was thinking on the drive in about the old
smart cables, It
would be interesting to take an AVR with USB interface and make
a serial dongle that would sense if the other end is driving
pin 2 or 3, then flip the direction of the signals appropriately.
It could also handle RTS/CTS or CTL-S/CTL-Q handshaking directly
and generate a serial break.
All you need for this is readily available.
Core USB stack, purly done in software:
http://www.obdev.at/products/vusb/index.html
RS-232C adapter using the USB-CDC protocol based on V-USB:
http://www.recursion.jp/avrcdc/
You can do it in a cheap low end AVR that is even considerably cheaper
then a FTDI chip.
A Maxim MAX214 will handle the DCE/DTE switching part.
The other trick is to detect if either RX or TX is being driven
externally. If neither is driven, it isn't connected to anything.
Just poll until one of the two pins goes active.
A couple of small LEDs for monitoring, and you're done..
I've got a bunch of Micropendous boards from another project that I could
glue a MAX214 onto.
It is about $50 in parts, but it seems like a really useful gadget.