Page 5-1
Manual 00650-521-1
Chapter 5: Programming
Sample Programs
There are sample programs provided with the PCI-RS422 card in C, Pascal, QuickBASIC, and
several Windows languages. DOS samples are located in the DOS directory and Windows
samples are located in the WIN32 directory.
Initialization
Initializing the chip requires knowledge of the UART’s register set. The first step is to set the baud
rate divisor. You do this by first setting the DLAB (Divisor Latch Access Bit) high. This bit is
Bit 7 at Base A3. In C code, the call would be:
outportb(BA3,0x80);
You then load the divisor into Base A0 (low byte) and Base A1 (high byte). The
following equation defines the relationship between baud rate and divisor:
Desired Baud Rate = (UART clock frequency) ÷ (32
(
divisor)
When the Baud jumper is in the X1 position, the UART clock frequency is 1.8432 Mhz. When the
jumper is in the X4 position, the clock frequency is 7.3728 Mhz. The following table lists popular
divisor frequencies. Note that there are two columns to consider depending on the position of the
Baud jumper.