outp(wB3*4,0x80); /* latch counter_2 */
l=inp(wB2*4); /* delay starting two clks */
h=inp(wB2*4);
for (count=32767;count>0;count--){
outp(wB12,0x80);
/* latch counter_2 */
l=inp(wB8);
h=inp(wB8);
if (h>=0x80) return NoError;
}
return TimeOut;
}
//--------------------------------------------------------
void AdPolling(UCHAR channel, UCHAR gain, WORD delay)
{
outp(wB0x18,0); // Select Mode 0
outp(wB0x10,channel);
outp(wB0x14,gain);
P1002_Delay(delay);
outp(wB0x1c,01); // A/D software tirgger
}
void SetupTimer(WORD wChannel, WORD wCoef)
{
WORD cmd;
wChannel=wChannel&0x03;
cmd=0x34+(wChannel<<6);
outpw(wB3*4, cmd);
outp(wBwChannel*4, (UCHAR)(wCoef&0xff));
outp(wBwChannel*4, (UCHAR)(wCoef>>8));
}
//=========================================================
void main()
{
int i,j;
WORD wBoards,wRetVal,wPLX;
PCI-1002 User’s Manual (Ver. 2.4, Mar./2004, PPH-015-24) ---- 40