Instruction manual
Table Of Contents
- INTRODUCTION
- GETTING STARTED
- MAKING THE CONNECTIONS
- USING THE PC215E
- STRUCTURE AND ASSIGNMENTS OF THE REGISTERS
- Register Assignments
- Register Groups
- The Register Details
- Programmable Peripheral Interface PPI-X Data Register Port A
- Programmable Peripheral Interface PPI-X Data Register Port B
- Programmable Peripheral Interface PPI-X Data Register Port C
- Programmable Peripheral Interface PPI-X Command Register
- Programmable Peripheral Interface PPI-Y Data Register Port A
- Programmable Peripheral Interface PPI-Y Data Register Port B
- Programmable Peripheral Interface PPI-Y Data Register Port C
- Programmable Peripheral Interface PPI-Y Command Register
- Z1 Counter 0 Data Register
- Z1 Counter 1 Data Register
- Z1 Counter 2 Data Register
- Counter/Timer Z1 Control Register
- Z1 Counter/Timer Status Register
- Z2 Counter 0 Data Register
- Z2 Counter 1 Data Register
- Z2 Counter 2 Data Register
- Counter/Timer Z2 Control Register
- Z2 Counter/Timer Status Register
- Group Z Clock Connection Register
- Group Z Gate Connection Register
- Interrupt Source Selection Register
- Interrupt Status Register
- PROGRAMMING THE PC215E
- Copyright
- Files installed from the Distribution Diskette
- Windows DLL and Examples
- DOS 'C' Library and Examples
- Using the Dynamic Link Library
- Windows and DOS Library Functions
- Initialisation Functions
- Interrupt Control Functions
- Data Buffer Functions
- Timer/Counter Functions
- Differential Counter Functions
- Frequency Generation Functions
- Millisecond Stopwatch Functions
- Frequency Input and Output Functions
- Digitally- and Voltage-Controlled Oscillator Functions
- Digital Input/Output Functions
- Switch Scanner Matrix Functions
- Bi-Directional Data Bus Functions
- PC215E Library Error Codes
- PC215E Interface Guide For LABTECH NOTEBOOK
- Guide to User Programming
- Signal Centre
- CONTENTS
- DECLARATION OF CONFORMITY

Page
19
PC215E
4.2.6 Frequency/Period Measurement
Another use for the pulse generation capabilities of the 82C54 is for one counter/timer to provide
a precise GATE signal during which a second timer/counter counts an external event. In mode
0, a high level on the gate input validates counting, and a low level invalidates it (i.e. counting
stops). Also a low-to-high transition on the gate input causes the initial count value to be re-
latched into the counting element.
Section 6.6.8 contains two functions TCgetExtFreq and TCgetExtPeriod both of which program
a timer/counter to provide a one-shot gate pulse of precise duration 6.5535 ms to a second
timer/counter. The second timer/counter has an external signal as its clock input. When the
gate pulse is over, the second timer/counter's counting stops, and its value is then read. A
simple calculation can then be made to determine the number of external clock cycles received
during the 6.5535 ms, and from this the external frequency and period can be estimated.
The timer/counter you specify in calls to TCgetExtFreq and TCgetExtPeriod is the second
timer/counter described above: The input frequency range supported by
TCgetExtFreq
is 153
Hz to 10 MHz, and the input period range supported by TCgetPeriod is 6.54 ms to 100 ns.
4.2.7 Frequency Generation
In mode 3 the output of the timer/counter is a periodic square wave, whose frequency is the
input clock frequency divided by the programmed counter divide ratio (CDR). The function
TCgenerateFreq
described in section 6.6.8.3 calculates the CDR required to generate a specific
frequency on a given timer/counter. The function automatically selects an appropriate input
clock frequency.
The function
TCgenerateAccFreq
described in section 6.6.8.4 uses two cascaded
timer/counters, both in mode 3. The flexibility of having two CDRs adds another degree of
freedom into the calculation of the CDR values, and a more accurate output frequency can be
attained.
4.2.8 Frequency Multiplication
An extension of the frequency measurement and frequency generation capabilities described in
sections 4.2.6 and 4.2.7 above is to combine the two into a process that measures an external
frequency on one timer/counter; multiplies the frequency value by a given factor and generates
this new frequency on a second timer/counter. Function TCmultiplyFreq described in section
6.6.8.5 performs this operation.
4.2.9 Digitally Controlled Oscillator
The combination of the 82C55 PPI and 82C54 counter/timer devices on the PC215E board
make it possible to implement a digitally controlled oscillator, whereby the value of a binary
number read into a PPI input channel is used to calculate the frequency of a square wave
generated on a timer/counter output. To turn this process into a continuous background task, a
second timer/counter can be deployed to generate an 'update' signal by generating a periodic
interrupt. The interrupt service routine then performs the DCO operation in the background.
Function TCsetDCO (section 6.6.9.1) sets up such an arrangement - allowing you to specify the
digital input channel, the output timer/counter and the second timer/counter used to generate
the 'update' interrupts. The function also allows for a flexible update rate and output frequency
range. The digital input channel width (i.e. the number of bits in the digital input word) can be