Miles Sound System SDK 7.2a

AIL_set_timer_divisor

The function AIL_set_timer_divisor programs a timer for callback service at a rate which is given in terms of the constant value that would normally be used to program the IBM PC's 8253 Programmable Interval Timer chip for the desired interrupt rate, if the application were to access the chip directly.

void AIL_set_timer_divisor(
  HTIMER timer,
  U32 PIT_divisor
);

In Parameters

timer
is a handle to the timer to program.
PIT_divisor
is the value which would normally be used to program the PIT chip directly at the desired rate.

Discussion

When this function is used to program a timer, the timer's frequency is given by 1193181 / PIT_divisor Hz.

Any one of three functions may be used to program a timer's callback rate. These functions are AIL_set_timer_period, AIL_set_timer_frequency, and AIL_set_timer_divisor. All three of these functions perform exactly the same task, but accept their values in different units. AIL_set_timer_divisor is useful primarily as an aid in porting applications to MSS which formerly accessed the timer chip directly, or when timer service must be "stolen" from the MSS system for any reason.

In practice, the fastest possible rate will be substantially slower than the theoretical value due to the host system's interrupt-processing overhead. MSS may exhibit internal stack overflows if any timer is programmed for a rate of more than a thousand or so calls per second. This does not necessarily indicate a fault in either the DOS extender or MSS, but is a sign that the PC hardware in use is incapable of keeping up with the demands of very-high-speed timer service in protected mode.

Under normal circumstances, the programmed timer service rate will exhibit a long-term accuracy of better than ± 100 parts per million (ppm). This accuracy figure may be somewhat degraded under certain environments such as Microsoft Windows.

The fastest possible timer period available under the Windows MSS API is 5 milliseconds (200 Hz) by default. This period limit may be changed to as little as 1 millisecond (1000 Hz) by changing the AIL_MM_PERIOD preference value immediately after calling AIL_startup.


Group: Timer Services
Related Functions: AIL_interrupt_divisor, AIL_register_timer, AIL_set_timer_divisor, AIL_set_timer_frequency, AIL_set_timer_period, AIL_startup
Related Basic Types: HTIMER, MILES_PREFERENCES, U32, void

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.