Instruction manual

AMPDIO DRIVERS
Page 30
any other application. Provision is also made by TCsetDiffCounters to specify the clock and gate
connections for both timer/counters.
The functions TCgetDiffCount and TCgetRatio can be called at any time after TCsetDiffCounters,
and these two functions latch and read the current count values of the timer/counters, using the
read-back command, and return the difference and ratio of the two count values respectively.
Function TCfreeDiffCounters can be called when finished with the differential counter, and releases
the timer/counter pair so they become available for use by another application.
3.1.2 Monostable Multivibrator
Mode 1 of the 82C54 timer/counter provides a digital one-shot output. This can be used to
implement a monostable multivibrator pulse. In this mode, the output of the timer goes low at the
falling edge of the first clock succeeding the gate trigger, and is kept low until the counter value
becomes 0. Once the output is set high, it remains high until the clock pulse succeeding the next
gate trigger.
Function TCsetMonoShot allows you to specify a timer/counter and a monostable pulse duration
(in seconds). See section 6.4.8.1. The function calculates the initial count value required to
generate the specified pulse length, and programs the timer/counter accordingly. Normally, the
counter/timer's internal clock source is selected automatically by the function, but in the case of the
legacy cards, the user must ensure the relevant jumper settings are selected correctly for one of
the following ranges of possible pulse duration times:
Output pulse duration range Input clock frequency
Min Max
200 ns 6.5 ms 10 MHz
0.2 s
65 ms 1 MHz
2.0 s
650 ms 100 kHz
20 s
6.5 s 10 kHz
0.2 ms 65 s 1 kHz
It is the responsibility of the user to provide the external gate signal to trigger the monostable
output.
3.1.3 Astable Multivibrator
An extension of the monostable multivibrator is to have two such timer/counters each generating
an output pulse of specified duration, but each being triggered by the end of the other
timer/counter's pulse. By adjusting the two pulse duration times, an astable multivibrator waveform
with a given frequency and mark-to-space ratio can be attained.
This application is implemented in function TCsetAstable see section 6.4.8.2. The msratio
argument to the function specifies the mark-to-space ratio, and this is defined as follows:
mark-to-space ratio = mark time / overall period
The function registers the timer/counters as being 'in use' and unavailable for any other application.
Function TCfreeAstable can be called when finished with the astable multivibrator, and releases
the timer/counters so they become available for use by another application.
The output of each timer/counter must be connected externally via the user connector, SK1, to the
gate input of the other timer/counter.
The TCsetAstable function calculates the input clock frequencies and counter divide ratios (CDRs)
for the two timers and normally makes the selections automatically. However, for some boards the