User manual

Chapter 5: Programming
A total of 32 consecutive address locations are allocated to the board, 17 of which are used. The
UARTs are addressed as follows:
Table 5-1: Address Selection Table
I/O Address Read Write
Base +0 thru 7 COM A UART COM A UART
Base +8 thru F COM B UART COM B UART
Base +10h Board IRQ Status N/A
Base +11 thru 1F N/A N/A
The Read / Write registers for the UARTs match the industry-standard 16550 registers. The Board IRQ
status register is compatible with Windows NT. COM A will set bit 0 hi on interrupt, COM B will set bit 1
hi on interrupt.
Sample Programs
There are sample programs provided with the 104-ICOM-2S board 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 board 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.
Manual 104-ICOM-2S, 104-COM-2S 18