125 lines
7.1 KiB
Plaintext
125 lines
7.1 KiB
Plaintext
|
||
|
||
|
||
<<<<< On The Topic of 450 Baud! >>>>>
|
||
by Scott Loftesness
|
||
May 28, 1983
|
||
|
||
Many users have asked about using 450 baud with this RBBS system.
|
||
Typically, they are asking why such an option exists (the N option on the
|
||
main RBBS menu) when their modem and IBM-PC BASIC don't appear to support
|
||
such a speed.
|
||
|
||
They are correct about IBM-PC BASIC not supporting 450 baud. In
|
||
fact, the ROM BIOS routines in the PC don't support 450 baud as an option
|
||
either. It's not that IBM or Microsoft skipped the speed when they developed
|
||
the PC, but the fact that 450 baud is not a standard communications speed
|
||
for the RS-232-C interface. The next higher 'standard' speed above 300
|
||
baud is 600 baud, followed by 1200 baud, etc. As a result, 450 baud is
|
||
not supported on most personal computer systems.
|
||
|
||
As it turns out, however, most 300 baud modems will run at somewhat
|
||
higher speeds - up to, guess what!, 450 baud in most cases. Although a
|
||
somewhat higher error rate can be expected when you "push" a 300 baud modem
|
||
to 450 baud, the error rate is typically still low enough to not be any
|
||
kind of serious problem to file transfer and message passing operations.
|
||
In fact, using the XMODEM file transfer protocol, errors which do occur
|
||
are normally detected by the check sum error detection scheme used by XMODEM
|
||
and simply force a re-transmission of the block originally received in
|
||
error.
|
||
|
||
Since the speed advantage of 450 over 300 baud can be substantial,
|
||
and since we are all interested in doing the most work in the least amount
|
||
of time with the equipment at hand, many users have implemented 450 baud
|
||
as an option which can used with their "home-grown" communications programs.
|
||
(Note that standard IBM-PC communications packages don't support 450 baud
|
||
either - such as PC-Talk III). I'll describe how 450 baud can be
|
||
implemented from a programming standpoint shortly. But first, let's get
|
||
rid of a few erroneous impressions about modem operation.
|
||
|
||
Your Hayes 300 baud SmartModem (or a Hayes 1200 running in 300 baud
|
||
mode) is capable of receiving modem commands and data at up to 1200 baud.
|
||
What this means is that the microprocessor in the Hayes is programmed to
|
||
automatically look for the AT command sequence - and performs automatic
|
||
baud rate detection at the speed you happen to be sending the command
|
||
sequence to the modem. This capability, for example, is used in the RBBS
|
||
code to send the various modem commands at 1200 baud - to minimize the time
|
||
spent sending them!
|
||
|
||
Your Hayes 300 will even try to send data across the line at 1200
|
||
baud - if you open your communications line at that speed and attempt to
|
||
go to data mode. However, the 300 is not capable of handling data at that
|
||
speed - in fact, it can only transmit and receive data at up to slightly
|
||
more than 450 baud - with any reasonable error rate. Since the Hayes doesn't
|
||
care at what rate is receives data (anything from 1 to 1200 baud is
|
||
acceptable), it is possible to transmit data to the modem and have the
|
||
modem transmit it to the phone line at any of those speeds. However, 450
|
||
baud is the reasonable upper limit for data communications with the Hayes
|
||
300.
|
||
|
||
Now that we understand the workings of the Hayes modem, let's talk
|
||
about how we can get the PC to send data from its RS-232-C Asynchronous
|
||
Communications Adapter at 450 baud. As mentioned earlier, 450 is not an
|
||
acceptable option to either the BASIC OPEN statement or to the direct
|
||
BIOS calls for asychronous communications. However, as always, almost
|
||
*anything* is possible using software! The IBM ACA uses an 8250 chip which
|
||
is capable of running at speeds from 1 to 19,600 baud (officially, only
|
||
up to 9600 baud, but that's another discussion!). The 8250 includes an on-chip
|
||
software programmable baud rate generator - which actually determines the
|
||
speed used to send and receive data across the RS-232-C interface. This
|
||
baud rate generator can be programmed to run at *any* baud rate between
|
||
1 and 19,600 baud. The IBM-PC ROM BIOS routines, however, were programmed
|
||
to only support the "standard" RS-232-C speeds. Since BASIC uses the BIOS
|
||
routines, BASIC only supports those same "standard" speeds.
|
||
|
||
However, it is possible for you to program the 8250 to run at any
|
||
speed you like. In this case, we are only interested in programming it to
|
||
run at 450 baud. Programming the baud rate generator in the 8250 consists
|
||
of loading the baud rate generator on the chip with a "baud rate divisor"
|
||
- which takes the clock frequency and divides it by the number you provide
|
||
to come up with the baud rate itself. (Those of you with Technical Reference
|
||
manuals for the PC can read all about this on pages 2-135 to 2-137). The
|
||
divisor is a two byte value - which is stored into two one byte registers
|
||
within the 8250 chip. First, we need to determine what the baud rate divisor
|
||
should be for 450 baud operation. Take it from me that the value is X'0100'.
|
||
Next, we need to get this value from a BASIC program into the 8250 itself.
|
||
Fortunately, BASIC includes the OUT statement - which allows us to send
|
||
data to the various I/O ports on the system. The 8250 uses several of these
|
||
ports - for the baud rate divisior, modem control, and for actually
|
||
sending and receiving the data across the RS-232-C interface.
|
||
|
||
The baud rate divisor ports are X'3F8' for the least significant
|
||
byte and X'3F9' for the most significant byte - when using the COM1 port.
|
||
(COM2 addresses are X'2F8' and X'2F9' respectively. Before we can load
|
||
these divisor ports, however, we must load another value to another port
|
||
to indicate that we are setting the baud rate divisor. This third port is
|
||
the Line Control Register and is port X'3FB' (X'2FB' for COM2). The high
|
||
order bit (X'80') of the LCR controls access to the baud rate divisor
|
||
registers. When this bit is 1, we can load the baud rate divisors. When it
|
||
is 0, the 8250 resumes operation with the baud rate loaded. The following
|
||
sequence of BASIC statements will load the baud rate divisor registers:
|
||
|
||
OUT &H3FB,(INP(&H3FB) AND &H80) 'Enable divisor registers.
|
||
OUT &H3F8,0 'Low order byte of X'0100'
|
||
OUT &H3F9,1 'High order byte of X'0100'
|
||
OUT &H3FB,(INP(&H3FB) OR &H80) 'Disable divisor registers.
|
||
|
||
Adding this code to a BASIC program will cause the COM1 port to
|
||
immediately switch to 450 baud operation.
|
||
|
||
Switching to other speeds is just as easy. The only thing you
|
||
need to know is the baud rate divisor required for that speed. Here are
|
||
a few of the common divisors (see the full table in the Tech. Ref.):
|
||
|
||
300 X'0180'
|
||
450 X'0100'
|
||
1200 X'0060'
|
||
|
||
I hope this discussion has helped to clarify the subject of 450
|
||
baud operation. Perhaps with this help, you can make some simple changes
|
||
to whatever communications program you're running which will allow you to
|
||
use your Hayes 300 at a speed which will allow up to 50 per cent faster
|
||
communications!
|
||
|
||
|
||
|