Page 10 Electronics Design • Manufacturing
S
i
Once the initialization process has occurred and the system has assigned
an address range to the PCI3IPmm card, the software will need to
determine what the address space is. We refer to this address as base0
in our software.
The next step is to initialize the PCI3IPmm. The main control register is
written to for clock selection, and interrupt mask. The default of no
interrupts enabled and 8 MHz operation will be valid in many cases.
Programming
The following is the initialization sequence that we use for our test software
in an NT environment. We use a program called WinRT to do the low level
accesses to the hardware. We use MS Visual C++ in conjunction with
WinRT to write our test software. Please feel free to copy the following set-
up code or to consider purchasing our engineering kit, which comes with
our test suite.
#include "G_ALL.h"
unsigned long int base0, address, data, iWinRTlength;
unsigned long int data_in, data_s, data_out, errorCode, error;
unsigned long int reg, reg_copy, result, i, j;
long int pci3ip_init() {
HANDLE hWinRT = WinRTOpenDevice(0, FALSE);
WINRT_CONFIGURATION configBuf;
DWORD iWinRTlength;
if (WinRTGetConfiguration(hWinRT, &configBuf, &iWinRTlength) != 0)
{
base0 = configBuf.memMin;
Your Software Goes Here accesses are relative to base0
WinRTCloseDevice(hWinRT);
return(0);
}
else
printf("Error: %d\n", GetLastError());
WinRTCloseDevice(hWinRT);
return(1);
}