background image

PCIe-COM-8SM / -4SM User Manual 

14 

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 so standard API functions can be used: 
 

►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) 

Prescaler 

2

M-

1

 *(Sampl 

N

SampleClock  16 - 

SCR 

, (SCR = „0h‟ to „Ch‟) 

CPRM, (CPRM = „01h‟ to „02h‟) 

CPRN, (CPRN = „0h‟ to „7h‟) 

Table 5-1: Baud Rate Generator Setting 

 

Summary of Contents for PCIe-COM-8SM

Page 1: ...X 858 550 7322 contactus accesio com www accesio com MODELS PCIe COM 8SM PCIe COM 4SM PCIe COM485 8 PCIe COM485 4 PCIe COM422 8 PCIe COM422 4 PCI Express Multi Port Multi Protocol Low Profile Serial C...

Page 2: ...of ACCES nor the rights of others IBM PC PC XT and PC AT are registered trademarks of the International Business Machines Corporation Printed in USA Copyright 2010 by ACCES I O Products Inc 10623 Rose...

Page 3: ...or or parts not excluded by warranty Warranty commences with equipment shipment Following Years Throughout your equipment s lifetime ACCES stands ready to provide on site or in plant service at reason...

Page 4: ...HS compliance RoHS 12 VHDCI connector 12 Chapter 4 Address Selection 13 Chapter 5 Programming 14 Sample Programs 14 Windows COM Utility Program 14 Table 5 1 Baud Rate Generator Setting 14 Table 5 2 Sa...

Page 5: ...e provided via an available cable The board features a x1 lane PCI Express connector which can be used in any length PCI Express slot Features Eight or four port PCI Express serial communication cards...

Page 6: ...lled in small embedded systems The card can be used in both a standard profile chassis or in a low profile chassis when used with the correct mounting bracket Our PCI Express COM 8SM and 4SM cards shi...

Page 7: ...5 card with breakout cable PCIe COM422 8NC Eight port RS 422 or 4 wire 485 card without breakout cable PCIe COM422 4 Four port RS 422 or 4 wire 485 card with breakout cable PCIe COM422 4NC Four port R...

Page 8: ...e specified contact factory with your precise requirement Other specials conformal coating custom software RJ 45 connectivity special breakout boxes etc we will work with you to provide exactly what i...

Page 9: ...lease refer to this document for extensive information and guidance on software tools and programming support at your disposal CD Software Installation The following instructions assume the CD ROM dri...

Page 10: ...ounting bracket screw Make sure that the card mounting bracket is properly screwed into place and that there is a positive chassis ground 6 Install a cable onto the card s bracket mounted connector 7...

Page 11: ...ast RS 232 transceivers F The standard RS 232 transceivers used are capable of speeds up to 460 8kbps which is adequate in many applications For this factory option the board is populated with high sp...

Page 12: ...power state Wake Up is asserted Extended temperature T This factory option is for use in harsh environments and is populated with all industrial rated components specified at a minimum temperature ran...

Page 13: ...ease note for 4 port card versions the ports will be installed as COM A COM B COM C and COM H The breakout cable will have the corresponding port labels near the DB9 connectors The Vendor ID for all c...

Page 14: ...Timeouts 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...

Page 15: ...h 60h 19 200 0h 30h 28 800 0h 20h 38 400 0h 18h 57 600 0h 10h 115 200 0h 08h 921 600 0h 01h Table 5 2 Sample Baud Rate Setting We re define the parameter of Baudrate on DCB structure Bit 30 28 User De...

Page 16: ...and COM H PIN RS 232 RS 422 and 4 Wire RS 485 2 Wire RS 485 1 DCD TX 2 RX TX 3 TX RX TX RX 4 DTR RX TX RX 5 GND GND GND 6 DSR 7 RTS 8 CTS 9 RI Table 6 1 DB9 Male Connector Pin Assignments on Standard...

Page 17: ...ut cable In case you wish to connect directly to the 68 pin connector the pins translate as follows DB9 pins To VHDCI pins Ch A Ch B Ch C Ch D Ch E Ch F Ch G Ch H 1 37 41 45 49 53 57 61 65 2 1 5 9 13...

Page 18: ...ve FIFO 16C550 compliant Character length 5 6 7 or 8 bits Parity Even Odd None Space Mark Stop interval 1 1 5 or 2 bits Flow control RTS CTS and or DSR DTR Xon Xoff ESD protection 15kV on all signal p...

Page 19: ...his manual or just want to give us some feedback please email us at manuals accesio com Please detail any errors you find and include your mailing address so that we can send you any manual updates 10...

Reviews: