4.10 Using the Timer Function
The I-7188XB(D) can support one main time tick, 8 StopWatch timers
and 8 CountDown timers. The I-7188XB(D) uses a single 16-bit timer to
perform these timer functions, with a timer accuracy of 1 ms. The
InstallUserTimer()
function can be used to install a custom timer
function and the function will be called at 1 ms intervals. The system
timer of the MiniOS7 will call INT 9 every 1 ms and call INT 0x1C every
55 ms. The timer function of the library is linked to associated with
called by hooked to INT 9 and will call any custom timer function.
The
TimerOpen()
function is used to start the I-7188XB(D) timer, and
this function must be inserted at the beginning of the program. The
TimerClose()
function is used to stop the timer. The sample code is as
follows:
unsigned long time iTime;
InitLib(); /* Initiate the 7188xb library */
TimerOpen();
/* Begin using the 7188XB timer function */
while(!quit)
{
if(Kbhit())
TimerResetValue(); /*
Reset
the
main time ticks to 0 */
iTime=TimerReadValue(); /* Read main time ticks */
}
TimerClose(); /* Stop using the 7188XB timer function */
Refer to the demo programs in the
CD:\Napdos\7188XABC\7188XB\Demo\BC_TC\Timer folder for more
information.
I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,
7MH-020-10
) ---
67
Summary of Contents for I-7188XB Series
Page 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...
Page 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...
Page 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...
Page 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...