Chapter 5: Programming; Sample Programs; Windows Com Utility Program; Windows Programming - Access PCIe-COM232-8 User Manual

Pci express multi-port low profile serial communications cards
Table of Contents

Advertisement

Chapter 5: Programming

Sample Programs

There are sample programs with source-code provided with the card in a variety of common
languages. DOS samples are located in the DOS directory and Windows samples are located
in the WIN32 directory.

Windows COM Utility Program

WinRisc is a COM utility program provided on CD with the installation package for this card
that is very useful when working with any serial ports and serial devices. If you haven't used
this program yet, do yourself a favor and run this program to test out your COM ports.

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.
In DOS the process is identical to programming 16550- compatible UARTs.
Baud Rate Generation
The built-in Baud Rate Generator (BRG) allows a wide range of input frequency and flexible
Baud Rate generation. To obtain the desired Baud Rate, the user can set the Sample Clock
Register (SCR), Divisor Latch Low Register (DLL), Divisor Latch High Register (DLH) and
Clock Prescale Registers (CPRM and CPRN). The Baud Rate is generated according to the
following equation:
The parameters in the equation above can be programmed by setting the "SCR", "DLL",
"DLH", "CPRM" and "CPRN" registers according to the table below.
Setting
Description
Divisor
DLL + (256 * DLH)
M- 1
Prescaler
2
*(SampleClock + N)
SampleClock 16 - SCR , (SCR = '0h' to 'Ch')
CPRM, (CPRM = '01h' to '02h')
M
CPRN, (CPRN = '0h' to '7h')
N
Table 5-1: Baud Rate Generator Setting
PCIe-COM232-8 User Manual
13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pcie-com232-4

Table of Contents