[GreenKeys] USB -> RS232 update
teletype at buzbee.net
teletype at buzbee.net
Wed Apr 19 10:57:32 EDT 2006
Thought I'd give an update to the list to close out my investigations into
the use of USB to RS232 dongles for teletype control. To recap, most new
PCs are dropping RS232 serial ports in favor of USB ports. This causes a
problem for teletype control programs like HeavyMetal, which rely on
old-style serial ports based on 16550 UARTs. One possible solution was to
use common and inexpensive USB to RS232 adapters, and this is what I was
looking into.
So, what I've found:
1. All of the common and cheap adapters I've seen are based around the FTDI
converter chips. They will not work for our purposes. The FTDI converter
uses a 14-bit baud-rate divisor with a 3 MHZ input clock. The largest
possible divisor will yield ~183 baud. We need to go down to 45.5 baud.
The most recent FTDI chips internally generate their reference frequencies,
so there doesn't appear to be a way to trick them into slowing down.
2. It looks like the short-term solution is just to use an old/cheap PC.
3. Long term, we'll probably need to go down the path Gil hinted out
earlier - ethernet to RS-232/loop. I'm currently using a commercial gadget
that does this for another project of mine, the Lantronix UDS-200 device
server - and it is a nice, slick solution. However, the devices in this
class that I'm aware of won't support our odd baud rates. However, there
are a lot of microcontroller solutions out there that come with ethernet
support (such as the Rabbit family), so a custom teletype solution shouldn't
be too much of a problem.
4. I'm a bit embarassed to report that the way HeavyMetal was setting up
the odd baud rates on Windows these past 5 years was silly (I was going
behind Windows' back and directly fiddling with the UART). The normal
Windows COMM api can handle custom baud rates just fine. My problem was
that the Perl SerialPort module I was using was too agressive on error
checking and disallowed custom baud rate setting. I've modified the
SetSerial module to allow this to work, and will be feeding my changes back
to the original author. Meanwhile, I'll be including the modified module in
my HeavyMetal distribution for those folks who are using the HeavyMetal Perl
script rather than the pre-compiled Windows version.
5. Sometime in the next week or two I'll do another HeavyMetal release with
the new SerialPort changes.
...Bill Buzbee
http://www.buzbee.net/heavymetal
More information about the GreenKeys
mailing list