PCI-COM422 User’s Guide
page 27
Chapter 3: Programming
Sample Programs
There are sample programs provided with the 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.
Windows Programming
The card installs into Windows as COM ports. Thus the Windows standard API
functions can be used. In particular:
CreateFile() and CloseHandle() for opening and closing a port.
SetupComm(), SetCommTimeouts(), GetCommState(), and SetCommState() to
set and change a port’s settings.
ReadFile() and WriteFile() for accessing a port.
See the documentation for your chosen language for details.
Under DOS, the process is very different. The remainder of this chapter describes DOS
programming.
DOS Programming
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(BASEADDR
+3,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)
On the card, the UART clock frequency is 1.8432 MHz. On the next page is a table for
the popular divisor frequencies.
Содержание PCI-COM422
Страница 1: ...PCI COM422 User s Guide May 2006...
Страница 8: ...page 8 PCI COM422 User s Guide This page intentionally left blank...
Страница 14: ...page 14 PCI COM422 User s Guide This page intentionally left blank...
Страница 18: ...page 18 PCI COM422 User s Guide Block Diagram DB50M Only one serial channel shown...
Страница 23: ...PCI COM422 User s Guide page 23 Figure 3 Low Profile Option Selection Map...
Страница 36: ...page 36 PCI COM422 User s Guide This page intentionally left blank...