ICP DAS USA PCI-1202 Series Hardware User Manual page 38

Hide thumbs Also See for PCI-1202 Series:
Table of Contents

Advertisement

// timer2
/* address of timer 2 = wAddrTimer+2*4
address of ctrl
input clock
down count 8 time = 1 μs
down count 65536/8 = 8192 μs --> max 8191 μs
*/
WORD P180X_DelayUs(WORD wDelayUs)
{
WORD wDownCount,wLow,wHigh,wVal;
double fTimeOut;
if (wDelayUs>=8191) return(InvalidateDelay);
wDownCount=wDelayUs*8;
wLow=wDownCount&0xff;
wHigh=(wDownCount>>8)&0xff;
outport((wAddrTimer+3*4), 0xb0);
outport((wAddrTimer+2*4), wLow);
outport((wAddrTimer+2*4), wHigh);
fTimeOut=1.0; // wait 1 to stop
for (;;)
{
wVal=inport(wAddrCtrl)&0x01;
if (wVal!=0) return(NoError);
fTimeOut+=1.0;
if (fTimeOut>6553500.0)
return(DelayTimeOut);
}
}
P1202_DelayUs(...) is designed for PCI-1202H/L/HU/LU
P1602_DelayUs(...) is designed for PCI-1602 and PCI-1602F
PCI-1202/1602/1800/1802 Hardware User's Manual
for Machine Independent Timer
= wAddrTimer+3*4
= 8 M
/* timer_2 mode_0 0xb0 */
/* if the timer is up, this bit will be 1 */
(Ver.4.2, Dec/2009, PMH-014-42)---- 38

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents