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

PC215E Page 18
MARK SPACE
tM tS
1 / freq
msratio = tM / (tM + tS) where
msratio
= mark to space ratio
tM = mark time (seconds).
tS
= space time (seconds).
freq = output frequency (Hz)
Note: the 82C54 timer/counters outputs are switched to the low level by the
next clock
after the
gate trigger, possibly causing the mark-to-space ratio to become distorted by one or two clock
pulses. This will become more apparent at higher frequencies.
4.2.4 Stopwatch
In mode 2, the output of the 82C54 timer/counter starts high; goes low for one clock pulse when
the count value decrements to 1, and then is set to high again. The initial count value is then
automatically re-loaded; counting continues and the sequence repeats. The output can be used
as a clock signal for another timer/counter, and any number of timer/counters can be cascaded
in this way.
Section 6.6.7 "Millisecond Stopwatch Functions" contains function TCsetStopwatch which sets
up two timer/counters in this way with a clock input frequency of 1 kHz. Function
TCstartStopwatch
sets the counters counting, and function
TCgetElapsedTime
latches and
reads the two count values to calculate the elapsed time, in milliseconds, since the counters
were first set off by TCstartStopwatch. This stopwatch can count milliseconds for nearly 50
days. Function
TCfreeStopwatch
releases the timer/counters so they can become available for
use by another application when the stopwatch is no longer required.
4.2.5 Event Recorder
An extension of the stopwatch described above is to record the elapsed times when an external
event occurs. This is possible by connecting an event's status output to an 82C55 digital input
channel on SK1, and causing this digital input to generate an interrupt to the computer's CPU.
The interrupt service routine would then read the elapsed time from the stopwatch
timer/counters and store the time into memory.
The function described in section 6.6.7.4 "Prepare an Event Time Recorder -
TCsetEventRecorder" allows you to specify a digital input chip (PPIX or PPIY) from which Port
C bit 0 will be used as the event input, and interrupt source. Once the board's interrupt has
been enabled (see function enableInterrupts - section 6.6.2.1) and a stopwatch timer has been
started, a positive going signal on the PPI Port C bit 0 pin on SK1 will cause the elapsed time to
be recorded into memory.