0699h(2).pdf
(
269 KB
)
Pobierz
3& $8',2 )5(48(1&< 0(7(5
E\ 52%(57 3(1)2/'
Use your PC’s “bi-directional” printer port to monitor
frequencies up to 32kHz.
This project is the latest in
our occasional series of PC-
based test gear projects. Like the
others, this Audio Frequency Me-
ter is based on a design that was
previously featured in an
Inter-
face
article (Oct ‘97)
(This refers
to the printed version of EPE,
Ed.)
The hardware and software
of the present design are not
identical to those described in the
original article, but they are es-
sentially the same.
This article takes things a
step further by providing full
constructional information, in-
cluding a custom printed circuit
board (PCB) design. Like the
original, it operates up to a
maximum frequency of
32 767kHz and has 0 5Hz reso-
lution. The unit therefore covers
slightly more than the full 20Hz
to 20kHz of the audio range.
¬
¬
SYSTEM OPERATION
In common with most digital
frequency meters, this system
determines the input frequency
by counting the number of cy-
cles in a given period of time. In
order to obtain reasonable reso-
lution at audio frequencies, it is
essential to use a fairly long
counting period. In this case a
gate period of two seconds is
used, giving 0 5 Hertz resolu-
tion. The general arrangement
used in the interface is shown in
Fig.1.
¬
large input signals. Input volt-
ages of up to at least 50V peak-
to-peak can be handled safely.
The interface should work
with any reasonably modern
PC, but it does require a spare
bi-directional printer port. If your
PC is not suitably equipped, or
its printer port is already occu-
pied, adding an inexpensive
printer port card will enable it to
operate with this interface.
There is a slight advantage
in using a fast PC, but it should
be possible to obtain good re-
sults with anything from an old
80386 machine to the latest
super-fast Pentium marvel. The
MS-DOS software for the inter-
face runs under QuickBASIC,
QBasic, or GW-BASIC, and one
of these interpreted languages
is needed in order to run
the software.
A simple limiter stage at the
input clips the input signal and
prevents any damage from oc-
curring to the subsequent cir-
cuitry. The next stage is a buffer
amplifier that provides the unit
with an input impedance of a
few hundred kilohms, which is
high enough to ensure that
there is minimal loading on the
circuit under test.
The next stage is a Schmitt
ACCURACY
Although the accuracy of
the unit does not compare to a
high-quality digital frequency
meter, it still provides more
than adequate results for many
purposes. It is certainly easier
to use and more accurate than
an analog frequency meter.
The input impedance is a few
hundred kilohms, for input levels
of up to about 1 3V peak-to-peak.
Above this level the input
impedance falls due to the action
of a limiter circuit that protects
the unit against damage from
¬
,1387
6752%(
' 72 '
$/)
%86<
,1,7
/,0,7(5
2&7$/
67$7(
%8))(5
6,*1$/
*$7(
2&7$/
67$7(
%8))(5
%8))(5
$03/,),(5
6&+0,77
75,**(5
,19(57(5
67$*( %,1$5< ',9,'(5
5(6(7
%,67$%/(
5(6(7
Fig.1. Block diagram for the PC Audio Frequency Meter.
EPE Online, June 1999 - www.epemag.com - 581
Copyright © 1999 Wimborne Publishing Ltd and
Maxfield & Montrose Interactive Inc
&RQVWUXFWLRQDO 3URMHFW
trigger, and this performs two
functions. It provides a certain
amount of amplification that
boosts the input sensitivity of
the circuit so that an input level
of only about 100 millivolts
peak-to-peak is needed to drive
the unit properly. It also ensures
that input levels that are slightly
inadequate fail to produce any
output from the trigger circuit,
and do not provide a reading.
This avoids a situation in which
borderline signal levels produce
misleading results.
The output from the Schmitt
trigger is at normal logic levels,
and it is fed to a 2-input NOR
gate that acts as a signal gate.
This is controlled from the
Strobe handshake output of the
printer port, and the two-second
gate pulse is generated by soft-
ware and some of the internal
timing hardware of the PC.
9
5
N
&
Q
&
µ
5
N
5
N
5
N
75
E
%&
F
H
5
N
&
µ
&
S
,&F
75
E
,1387
6.
&
Q
5
N
&
Q
%&
75
F
H
E
%(
F
H
,&
3,1
%&
3/
6752%(
'
1
N
D
D
'
1
N
5
N
5
N
5
N
5
Ω
5
N
9
BINARY COUNTER
The output of the NOR gate
feeds into a 17-stage binary
counter, but prior to starting a
new count this must be reset to
zero. The reset pulse is gener-
ated in software and delivered
to the counter via another hand-
shake output (Init) of the printer
port. At the end of the gate pe-
riod the value held in the
counter is double the input fre-
quency. In order to obtain a
reading in Hertz it is merely
necessary to read the counter
and divide the returned value
by two.
There is a slight complica-
tion in that the value must be
read from the first 16 outputs of
the counter, but the printer port
has only eight data inputs. This
is overcome by using a simple
method of multiplexing.
The 16 outputs are read via
two 8-bit 3-state buffers that are
controlled via a third handshake
Copyright © 1999 Wimborne Publishing Ltd and
Maxfield & Montrose Interactive Inc
Fig.2. Circuit diagram of the PC Audio Frequency Meter input
stages.
6.
9
6(( 7(;7
,&
,&F
/6
2
(
<
<
<
<
<
<
<
<
2
(
3, 1
9
$
$
$
$
$
$
$
$
* '
1
&/
.
4
4
4
4
4
4
4
*
1'
5(6(7
,&
,&
%(
/6
9
5 72 5
3/
$
//
$/)
'
'
'
'
'
'
'
'
*
1'
,1 7
,
%86<
6752
%(
Ω
2
(
<
<
<
<
<
<
<
<
9
$
$
$
$
$
$
$
$
* '
1
&
/.
4
4
4
5(6(7
&/
.
4
4
4
4
4
4
4
*
1'
5(6(7
,&
%(
,&
9
/6
,&D
%(
2
(
,&
%(
9
,&E
%(
*
1'
,&F
3,1
Fig.3. Circuit diagram for the logic stages of the PC Audio Fre-
quency Meter.
output of the printer port (the
ALF output). One buffer is con-
trolled directly from this output,
but the other is driven via an
inverter, and consequently only
one buffer or the other will be
active at any one time,
depending on the state of the
handshake line.
The handshake line is set
EPE Online, June 1999 - www.epemag.com - 582
&RQVWUXFWLRQDO 3URMHFW
high to read one byte and then
low so that the other one can be
read. A simple software routine
then combines the two bytes to
reconstitute the 16-bit value.
It is important that any over-
flow of the counter is detected,
as erroneous results will other-
wise be obtained. Having
reached its maximum value the
counter will simply cycle back to
zero and start counting once
again. Slightly excessive input
frequencies will therefore pro-
vide what appear to be valid
readings while they are in fact
very much lower than the true
input frequency.
This problem is overcome
by monitoring the 17th output of
the counter using the Busy
handshake input of the printer
port. In normal operation the
17th output will always be low,
but this output goes high if the
counter overflows.
If the input frequency is well
above the maximum that can be
handled by the counter, the out-
put of the 17th stage could go low
again by the end of the gate pe-
riod. It therefore drives a simple
latch circuit, which ensures that a
valid overflow signal is always
present at the end of the gate pe-
riod. The state of the overflow
output is detected via the Busy
handshake input, and a suitable
on-screen warning is displayed if
this output is high. A fresh count
cycle is then commenced.
than about
0 65V, and D2 be-
comes forward biased when volt-
age is more than about +0 65V.
¬
¬
Transistor TR1 operates as a
simple emitter follower stage.
This does not provide any voltage
gain, but it provides the unit with
a high input impedance. Capaci-
tor C5 couples the output of TR1
to a conventional Schmitt trigger
circuit based on TR2 and TR3.
Component IC7c is the signal
gate, and this is one of the four
CMOS NOR gates in a 4001BE
device. Taking the control input at
pin 1 high forces the output to the
low state, but when this input is
low the output assumes the oppo-
site state to the other input. This
gives the required gating action,
and the inversion through IC7c is
of no practical consequence.
The circuit diagram for the
logic stages of the unit is given in
Fig.3. IC2 and IC3 are the 8-bit
buffers, and IC1 is the inverter
that ensures they are controlled in
anti-phase fashion. There are ac-
tually six inverting trigger stages
in IC1, but in this circuit only one
is actually utilized, and no con-
nections are made to the other
five sections of this component
(being an LS-type IC, the unused
inputs do not need to be tied
to a power line, unlike CMOS
devices).
The outputs of the buffers
drive the bi-directional data lines
of the printer port, but there is a
minor complication here, because
these lines default to the output
mode when the PC is first
switched on. They only operate
as inputs when the frequency me-
ter software is run. This means
that initially the outputs of the
buffers will be connected to the
outputs of the printer port.
Resistors R1 to R8 provide
current limiting that protects both
sets of outputs until the printer
port is set to the input mode. The
value of these resistors is made
low enough to prevent them
from hindering normal operation
of the interface, but high
enough to ensure that no
damage occurs to either the
interface or the printer port
hardware.
The counter consists of
three 4024BE 7-stage binary
dividers (IC4 to IC6) connected
in series. This obviously pro-
vides a 21-stage divider, but the
outputs of the final four stages
are left unused. The output of
the 17th stage drives a simple
latch circuit based on IC7a and
IC7b. The latch is reset by the
same signal that is used to reset
the counter.
Note that one section of IC7
is not used in this circuit, and so
its inputs (pins 5 and 6) are sim-
ply tied to the 0V line, as rec-
ommended for unused CMOS
inputs.
A +5 volt supply is required,
and the current consumption of
the circuit is about 70 milliamps.
Obviously the circuit could be
powered from its own power
supply unit, but it is cheaper and
more convenient if power is ob-
tained from the PC. Unfortu-
nately, there is no supply output
of any kind on a PC printer port,
and power must therefore be
obtained from one of the other
ports. Suitable outputs are
available from the keyboard and
game ports.
CIRCUIT DESCRIP-
TION
The circuit diagram for the
input and gate stages of the PC
Audio Frequency Meter is
shown in Fig.2. The limiter cir-
cuit uses resistor R9 and diodes
D1 and D2 to clip the signal at
approximately
V
0 65V. Diode
D1 becomes forward biased
when the input voltage is more
¬
CONSTRUCTION
The topside component lay-
out and hard wiring for the printed
circuit board are shown in Fig.4,
together with an (approximately)
actual-size copper track master
pattern. This board is available
from the
EPE Online Store
(code
7000232) at
www.epemag.com
Bare in mind that IC4 to IC7
are CMOS devices and that
Copyright © 1999 Wimborne Publishing Ltd and
Maxfield & Montrose Interactive Inc
EPE Online, June 1999 - www.epemag.com - 583
&RQVWUXFWLRQDO 3URMHFW
they require the usual anti-static
handling precautions. The most
important of these is that you
ensure that you discharge static
electricity from your body before
handling them. Touching the
bare metal of a nearby water
or radiator pipe is usually satis-
factory.
It is recommended that you
mount the devices in sockets
rather than soldering them di-
rect to the board. Do not fit the
ICs into their sockets until
the board is completed, and
try to touch the pins as little as
possible.
There are number of a link-
wires on the board, and these
are made from about 0 56mm
(24 s.w.g.) tinned copper wire.
In some places there are sev-
eral wires running side-by-side
and very close together. These
wires can be insulated with
pieces of PVC sleeving to en-
sure that there is no risk of any
accidental short-circuits.
¬
&
6.
9
$/)
5
5
5
5
5
5
5
5
'
'
'
'
'
'
'
'
* 1'
%86<
67 52 %(
3/
%#
&
5
6.
E
&
H
F
E
5
5
,1 , 7
%#
F
5
5
&
5
E
&
N
'
D
D
'
5
N
F
&
5
5
H
5
5
H
%#
The connections are
densely packed in some parts of
the board, and many of the cop-
per pads are quite small. In or-
der to avoid numerous short-
circuits, it is necessary to use a
soldering iron having a fine bit
and to take great care when
making the connections. Check
the finished board for short-
circuits using a magnifier, and
make sure that you completely
remove any that are found.
In other respects, construc-
tion of the board is largely
straightforward. The layout is
designed for polyester capaci-
tors having 7 5mm (or 0 3 inch)
lead spacing, and it could be
difficult to use components hav-
ing a different lead spacing. At
this stage only fit single-sided
solder pins at the points where
connections to SK1, SK2, and
PL1 will eventually be made.
¬
¬
2 32
Fig.4. Printed circuit board component layout, wiring details,
and (approximately) full-size copper foil master pattern for the
PC Audio Frequency Meter.
EPE Online, June 1999 - www.epemag.com - 584
Copyright © 1999 Wimborne Publishing Ltd and
Maxfield & Montrose Interactive Inc
&RQVWUXFWLRQDO 3URMHFW
COMPONENTS
Resistors
R1 to R8 270 ohms (8 off)
R9 10k
R10 470k
R11 680k
R12, R15 3k9 (2 off)
R13 56k
R14 27k
R16 470 ohms
R17 15k
R18 8k2
R19 2k2
All 0.25W 5% carbon film or better
Capacitors
C1 100n ceramic
C2 100u radial electrolytic, 10V
C3, C4 470n polyester, 7.5mm
lead spacing (2 off)
C5 10u radial electrolytic, 25V
C6 150p ceramic plate
Semiconductors
D1, D2 1N4148 signal diodes (2 off)
TR1 BC550 low-noise
npn
transistor
TR2, TR3 BC549
npn
transistors
(2 off)
IC1 74LS14 hex inverter
IC2, IC3 74LS541 octal tri-state
non-inverting buffers (2 off)
IC4 to IC6 4024BE 7-stage binary
ripple counters (3 off)
IC7 4001BE quad 2-input NOR gate
Internal layout of the completed PC Audio Frequency Meter
showing positioning of the PCB and the ribbon
cable exit cutout.
standard oscilloscope test leads a
BNC socket should be used
instead, as this matches the
BNC plugs normally fitted to
these leads.
A flat file is used to make a
broad notch in the rear panel for
the ribbon cable that connects
the unit to the printer port of the
PC. Socket SK1 can be a 2mm
or 4mm type mounted on the
rear panel, or the power lead
can simply pass through the
same notch as the data cable.
The printed circuit board is
mounted on the base of the
case using either plastic stand-
offs or metric M3 screws, with
spacers about 6mm to 12mm
long to keep the underside
of the board well clear of the
metal base panel.
connector (a 25-way male D-
type connector). It is unlikely
that 13-way cable will be avail-
able, but a 20-way cable is eas-
ily pruned down to size. There
should be no difficulty in tearing
away a seven-way strip to leave
the required 13-way cable.
Both ends of the cable are
prepared in the same way, and
this starts by separating the ca-
ble into individual leads over a
length of about 20mm to 30mm.
Next, a few millimeters of insu-
lation are removed from the end
of each lead and the bare wires
are then tinned with solder.
The connector details are
shown in Fig.5.
Provided the pins on the
circuit board and the appropri-
ate terminals of the printer port
plug are also tinned with solder,
it should then be easy to make
the connections. However, the
connections are tightly packed
together and it is necessary to
take due care in order to avoid
short-circuits.
Miscellaneous
SK1 4mm socket
SK2 phono socket
PL1 25-way male D-type connector
PCB available from the
EPE Online
Store
at
www.epemag.com
(code
7000232); metal instrument case,
about 150mm x 100mm x 50mm;
supply adapter cable (see text);
14-pin DIL socket (5 off); 20-pin DIL
socket (2 off); connecting wire;
solder pins; solder, etc.
See also the
SHOP TALK Page!
Approx. Cost
Guidance Only
(Excluding Case)
$35
Practically any medium-size
plastic or metal box makes a suit-
able housing for this project, but a
metal instrument case is the most
appropriate type. SK2 is mounted
on the front panel, and this is a
phono socket on the prototype. If
you wish to use the unit with a
Copyright © 1999 Wimborne Publishing Ltd and
Maxfield & Montrose Interactive Inc
CONNECTING UP
A piece of 13-way ribbon
cable about 0 5 to one meter
long is needed to connect the
circuit board to the printer port
¬
EPE Online, June 1999 - www.epemag.com - 585
Plik z chomika:
fred1144
Inne pliki z tego folderu:
0699i(2).pdf
(461 KB)
0699h(2).pdf
(269 KB)
0699l(2).pdf
(482 KB)
0699o(2).pdf
(220 KB)
0699f(2).pdf
(328 KB)
Inne foldery tego chomika:
1999_01
1999_02
1999_03
1999_04
1999_05
Zgłoś jeśli
naruszono regulamin