PCIe-ICM-4SM User Manual
15
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 p
orts and serial devices. If you haven’t used
this program yet, do yourself a favor and run this program to test your COM ports.
Windows Programming
The card installs into Windows as COM ports so standard API functions can be used.
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)
Prescaler
2
M-
1
*(Sampl
N
)
SampleClock 16 -
SCR
,
(SCR = ‘0h’ to ‘Ch’)
M
CPRM, (CPRM = ‘01h’ to ‘02h’)
N
CPRN, (CPRN = ‘0h’ to ‘7h’)
Table 5-1: Baud Rate Generator Setting
Содержание PCIe-ICM-2S
Страница 11: ...PCIe ICM 4SM User Manual 11 ...