3.11 Other Functions
3.11.1 P1602_DelayUs
z
Description:
This is a
machine independent timer
.
This function can be
used to create the
settling time
delay
or used as a
general purpose machine
independent timer. This function will refer to the current active OME-PCI-1602
board. Use the P1602_ActiveBoard(….) to select the active board.
z
Syntax:
word P1602_DelayUs(WORD wDelayUs);
z
Input Parameter:
wDelayUs : number of us to delay, 8191 Max
wDelayUs=1
Æ
delay 1
µ
s
wDelayUs=1000
Æ
delay 1000 us = 1 ms
wDelayUs=8191
Æ
delay 8191 us = 8.191 ms (maximum delay)
wDelayUs=8192
Æ
invalid delay (will return error)
z
Return Value
:
NoError : OK
ExceedBoardNumber: invalid board number
FindBoardError : cannot find the OME-PCI-1602 board
InvalidDelay :
dwDelayUs
> 8191
z
Demo Program : DEMO1.C
z
Long Time Delay :
WORD DelayMs(WORD wDelayMs) // maximum delay=4294967.295 sec
{
WORD wDelay,wRetVal
wRetVal=0;
for (wDelay=0; wDelay<wDelayMs; +)
=P1602_DelayUs(1000);
return(wRetVal);
}
63
Summary of Contents for OME-PCI-1602
Page 37: ... Demo Program DEMO9 C 37 ...