User`s guide

9 Targeting DOS for Real-Time Applications
9-8
The fastest sample rate you can define is determined by the minimum value
from which the counter can count down. This value is 3, hence the fastest
sample rate that the 8254 is capable of achieving is:
This corresponds to a minimum base step size of
However, bear in mind that the above number corresponds to the fastest rate
the timer can generate interrupts. It does not account for execution time for the
model code, which would substantially reduce the fastest sample rate possible
for the model to execute in real time. Execution speed is machine dependent
and varies with the type of processor and the clock rate of the processor on the
target PC.
The slowest and fastest rates computed above refer to the base sample times in
the model. In a model with more than one sample time, you can define blocks
that execute at slower rates as long as the sample times are an integer multiple
ofthebasesampletime.
Modifying Program Timing
If you have access to an alternate timer (e.g., some I/O boards include their own
clock devices), you can replace the file
drt_time.c with an equivalent file that
makes use of the separate clock source. See the comments in
drt_time.c to
understand how the code works.
You can use your version of the timer module by redefining the
TIMER_OBJS
macros with the build command. For example, in the Real-Time Workshop
page of the Simulation parameters dialog box, changing the build command
to,
make_rtw TIMER_OBJS=my_timer.obj
replaces the file drt_time.c with my_timer.c in the list of source files used to
build the program.
1.193 10
6
× 3÷ 410
5
× Hz
1410
5
×÷ 2.5 10
6
× ondssec