Академический Документы
Профессиональный Документы
Культура Документы
By Peter Smit
a simple PC
network
a cable is all you need...
Null-modem cable
A null-modem cable is a good choice
when relatively small data volumes
need to be transferred. This inexpen-
sive serial link is only suitable for trans-
ferring small amounts of data and for
playing some multiplayer games. The
maximum speed which the RS232 port
can achieve with such a cable is
115,200 baud. For serial data transmis-
sion with 1 start bit, 8 data bits and
1 stop bit, this results in an effective
transfer rate of 10,250 bytes per sec-
ond (36 MB/hour). For this data rate,
both computers must be fast (486 or
better) and should preferably be fitted
with a type 16550 UART (Universal
Asynchronous Receiver/Transmitter).
One can easily check whether such
a chip is present by means of the pro-
gram MSD (provided standard with
DOS). When MSD is run, it displays the
In addition to allowing communication game at the same time. They can play type of UART present for each COM
via e-mail, interconnecting two or together in a three-dimensional maze port: 8250, 16450 or 16550. An 8250
more computers has the advantage or fly through space together. Some can only manage 9600 baud. Starting
that files, printers, modems, disk drives, well-known games which have this with AT machines one finds only the
ZIP drives and CD-ROM drives can be option are Doom, Duke Nukem 3D, faster types (16450, 82450 and
shared. With the Internet boom it has Quake, Outlaws, X-Wing versus T-Fight- 16550), which can handle up to
become totally in to run 3D games in er and so on. Some of these run on a 115,200 baud. Many snoop pro-
multiplayer mode. With this option, central server via the Internet, but they grams report the slower 8250 when a
multiple persons can participate in the can also be run via a TCP/IP network, 16450 is fitted. Only the 16550 has a
loss of data packets etc. then there is a timing problem 4 RTS RTS 4
17 17
Its advisable to disable the 16550s between the two computers. In order
5 CTS CTS 5
FIFO buffer for the port to which the to properly solve such a problem we
18 18
mouse is connected. Problems such as must use a connection with more than 6 DSR DSR 6
the mouse pointer freezing after a few three leads, since this is the only way 19 19
movements can sometimes be caused to have hardware handshaking (see 7 GND GND 7
by this buffer. In Windows 95 the buffer Figure 1). Programs which only recog- 20 DTR DTR 20
8 8
can be disabled via the Control nize hardware handshaking will thus
21 21
Panel/System/Device Manager/Ports/ not work with a three-wire null-modem
9 9
COM1 (mouse)/Properties/ Settings/Ad- cable. 22 22
vanced/Use FIFO Buffers. In case of A full null-modem connection con- 10 TxD Transmit Data 10
communication problems the FIFO sists of 7 leads. A 25-pin or 9-pin sub-D 23 RxD Receive Data 23
speed can also be somewhat reduced connector is used. A male connector 11 RTS Request to Send 11
via this route. With Windows 3.11 one is always used at the back of the com- 24 CTS Clear to Send 24
12 DSR Data Set Ready 12
must include a line in SYSTEM.INI under puter, so that we must use two female
25 GND Ground 25
the heading [386Enh]: COM1FIFO=0 connectors for the cable. Normally the 13 DTR Data Terminal Ready 13
disables the FIFO buffer for the mouse mouse is connected to the COM1 port
982001 - 11
connected to the COM1 port. Always via a 9-pin connector, so that the 25-
make a copy of SYSTEM.INI before mak- pin connector of the COM2 port is usu-
Figure 1. Wiring scheme for a full DTE/DTE
ing any changes! ally used for this sort of experiment.
null-modem cable.
Now that weve dealt with UART pit- There are several types of null-
falls, lets return our attention to the modem connections. The most expen-
null-modem cable. Such a cable pro- sive solution, which is also the most moulded-on connectors.
vides a link between the serial (RS232) flexible, consists of two universal The ease of use of a null-modem link is
ports of two computers. The RS232 port modem cables together with a null- largely determined by the software
was originally intended to be used for modem adapter. A universal modem used. The PC BIOS can (or at least
interconnecting a DTE (Date Terminal cable is a 25-lead cable which has a could) only manage 19,200 baud. All
Equipment) and a DCE (Data Commu- 25-pin male connector at one end MS-DOS null-modem software thus
nication Equipment). A D25 cable and both a 25-pin female connector accesses the UART registers directly,
between a computer and a modem is and a 9-pin female connector at the rather than via the BIOS. This is the only
an example of such a DTE/DCE link. other end. A null-modem adapter is a way in which it is possible to achieve a
A null-modem cable, by contrast, is small block fitted with two 25-pin 115,200 baud data rate.
used for a DTE/DTE link. It requires that female connectors. We connect the The best-known interconnection soft-
certain leads be interchanged adapter between the two cables, ware is LapLink, but Norton Comman-
between the two connectors. The most using the single 25-pin connectors of der also has a Link option. From MS-
important of these are TxD (Transmit the two cables. With this combination DOS 6.x onwards, Interlink provides a
Data) and RxD (Receive Data). These we can cope with all D9 and D25 standard means for interconnecting
two leads plus a ground lead repre- COM ports. With two 1.8-metre cables, two computers, and Windows 95 has
sent the simplest possible three-wire such a combination costs approxi- the Direct Cable Connection option.
null-modem cable. The only problem mately 15. For occasional use I prefer Norton
with a three-wire link is that there can For roughly 10 we can make do Commander (V4.0). Since this program
be no hardware handshaking with a single universal modem cable is anyhow often used to provide a user
between the two computers. and a null-modem adapter. However, interface, it is natural to also use it for
In a three-wire cable, the connector the adapter has threaded posts which the link. Version 4.0 has the additional
pin for the signal which asks whether mate with the fixing screws of the advantage that the contents of multi-
data can be sent (Request to Send) is cable connector. These are in the way ple directories can be selected con-
connected directly to the pin which is if the adapter is to be plugged direct- currently and copied. With a bit of
intended to receive the answer from ly into the computers COM-port con- patience it is possible to transfer an
the other computer (Clear to Send). nector. Its possible to dismantle the entire hard-disk partition in one opera-
This results in a sort of narcissistic con- connector and remove these posts on tion. Of course, at a data rate of
nection: the computer wonders one side of the adapter so that it can 35 MB/hour this does not go particular-
whether it can send data, while think- be plugged into the COM-port con- ly fast.
ing that it is talking to a second com- nector. However, this is not a particu- In Norton Commander one selects
puter. And like a true narcissist it natu- larly elegant solution, since the modi- Menu/Right or Left/Link, by means of
rally provides the answer to its own fied adapter cannot be secured to the which the first computer is configured
question. In other words, Can I send? connector. as the master and the second as the
Yes, I can always send and I decide One can also purchase a D25 serial slave. (Pay attention to the selection of
that for myself. female/female interconnection cable the correct COM ports.) The drives of
Whenever the two computers do not and modify it oneself according to Fig- the slave computer then appear at
have the same level of performance, ure 1, at least if it does not have the master as a normal window within
Figure 2. Three types of parallel-interface cables between two computers: a simple 4-bit cable (a), a 4-bit cable for Windows 95 (b)
and an 8-bit cable for Norton Commander (c).
Design by J. Dietrich
inputs to be employed.
The interface described here is built
once only on a separate board, and
migrated to future 68HC11 applications
when and where necessary. It is only
connected to the target system (here,
the minimum system) for diagnosis and
programming jobs.
face, via K2 and the 5-wire cable. of charge from Motorola. The author Next, program the EEPROM:
A push-button on the interface board used a packed file called ELEKT494.ZIP 1. Produce the program using Editor,
allows the microcontroller to be reset. (66,304 bytes) which was downloaded then assemble it.
Without the interface board, the con- from the Motorola BBS in Munich, Ger- 2. Configure the PC serial port in DOS
troller uses its own, internal, reset logic many, telephone (+49) 89 92103111. window
which does not require a push-button. This file may be found in subdirectory MODE COM2:1200,N,8,1
The artwork for the single-sided /mc68hcxx/m68hc11. The zip file con- 3. Copy the once modified program
printed circuit board is given in Fig- tains, among others, an assembler with into RAM
ure 3. In view of the small number of documentation, as well as programs for COPY EEPROGIX.BOO/B COM2:
parts, a components list is not given. checking (MINIBUG) and programming 4. Close the DOS window, and launch
As usual, watch the polarity of the EEPROMs (EEPROGIX). The list with short HyperTerminal (Windows 95)
vertically mounted electrolytic descriptions of all files held on the mail- select Direct Cable Connection on
capacitors before soldering them on box is called ALLFILES.BBS, and may be COM2
to the board. Capacitor C5 decou- found in the directory /info. configure as 9600 bits/s, 8 bits, no
ples the supply voltage, and is safely How is the software transferred to the parity, 1 stop bit, hard ware hand-
rated at 10 V. microcontroller? For test purposes, the shaking protocol
software may be moved to the RAM Do File Settings ASCII Configu-
Software area starting at address 0. This is done ration, and set a character delay of
by means of the ORG (originate) state- 5, click on OK to leave the menu.
The software you will need to get going ment. 68HC11 versions are available 5. Type an upper-case I in the terminal
with the 68HC11 processor board and which, like the -E1, have an equal window
the present interface is available free amount of RAM and EEPROM. For pro- (selects internal programming of the
Cabling
The USB uses a daisy-chain cabling
technique. This means that the devices
The problem is a familiar one: you pur- complete. Even the computer manu- are connected to the cable in
chase a new piece of equipment for facturers themselves find this all a bit sequence, one after the other. Thus in
the PC, search for matching cables, too much. theory the computer need have only
get all tangled up in the nest of cables The Universal Serial Bus shows that a one USB interface to allow up to 127
behind the PC, and then have to look better, and above all more user-friend- peripheral devices to be connected.
for a suitable driver. After that the cor- ly approach is possible. The USB offers Of course, the USB has its limitations.
rect interrupt and DMA channels must a completely integrated Plug & Play The maximum extent of the cable is
be assigned. Add to this the fact that solution for all devices. For the user this 5 metres. Longer distances can be
every device needs its own mains means that any given device can be achieved by using hubs, which are
power connection, and the chaos is connected to the computer at any buffer/splitter devices. A hub can be
parallel bus
I /O I /O I/O
parallel bus
Figure 3. Two computers communicate with each other and with peripheral devices via FireWire. Note that FireWire is used for both the
cable connection and the backplane.
Since FireWire is based on high data Physical Layer. These are depicted in tion code (node ID) within each
rates, it places unusually severe Figure 5. device. The 16 bits of the node ID are
demands on the cabling material. further divided into a 10-bit bus ID and
While USB works with a 4-lead cable, Transaction Layer a 6-bit offset ID. Since the highest pos-
FireWire uses a 6-lead cable. This is The Transaction Layer manages data sible address (all ones) is reserved for
illustrated in Figure 4. Two leads are transfers between two devices via the special applications, an actual system
reserved for distributing electrical Serial Bus. The system recognizes three configuration can have up to
power. The allowed dc voltage may lie types of transactions: read (data is 1023 buses, each of which can have
between 8 V and 40 V, with a maxi- transmitted from a device to the main up to 63 independent device connec-
mum total current of 1.5 A. The signal system), write (data is transmitted from tions (nodes).
lines are implemented as two individu- the main system to a device) and lock
ally-screened twisted pairs. (data is transmitted from a device to Link Layer
the main system, which in turn sends The Link Layer looks after delivering
The model the processed data back to the information packets according to a
device). The bus supports the IEEE half-duplex protocol. Each individual
The specification of the FireWire proto- 1212 standard, which uses 64-bit packet is sent via a process called a
col is based on three layers: the Trans- addressing. The topmost 16 bits of the subaction. Two types of subaction are
action Layer, the Link Layer and the address are treated as an identifica- possible:
- asynchronous subaction, in which an
arbitrary amount of data plus some
AL/PET Transaction Layer information is sent to
signal pair #1: red and green
a specific node (device address), fol-
lowing which a confirmation (acknowl-
power wire #1: white edgement) is returned from the desti-
nation device;
power wire #2: black
- isochronous subaction, in which a
variable amount of data is sent at reg-
signal pair #2: blue and orange ular intervals, with simplified address-
ing and without confirmation from the
Outher jacket Signal twisted-pair wires destination device.
Power wires
Each subaction can have up to three
distinct phases:
- arbitration sequence: a device
Outher shield braided which wants to transmit data sends a
copper wire
bus access request to the Physical
Layer. If the device already controls
Signal pair shield braided
copper wire 982002 - 14 the bus as the result of a just-complet-
ed subaction, it receives immediate
Figure 4. The construction of a cable which is suitable for FireWire. access to the bus.
982002 - 16b
Figure 6. This timing diagram illustrates the difference between data transmissions using asynchronous subactions (a) and isochronous
subactions (b).
Design by B. Oehlerking
Light intensity
measurement with a PC
no external power supply required
COMPONENTS LIST
Resistors:
R1,R2,R3 = 10k
R4 = 12k
Capacitor:
C1 = 1F MKT
Semiconductors:
D1,D3 = 1N4148
D2 = low-current LED, red
D4 = low-current LED, green
T1 = BC557C
T2 = BC547C
IC1 = TLC7555
Miscellaneous:
Small encapsulated solar cell,
0.45 V, e.g. Conrad 198030
9-pin sub-D socket, IDC type
10-way boxheader
10-way IDC socket
2-3 m of 10-way flatcable
Figure 1. Circuit diagram of the light intensity meter. Note that the sensor is a small solar cell.
The operating principle of the circuit internal diagram is shown in Figure 2) Its supply voltage is stolen from the
shown in Figure 1 is the time it takes for operates as a comparator, comparing PCs RS232 port, GND providing the
a capacitor to be charged to a cer- the voltages between pins 2/6 with the ground level, while the positive supply
tain voltage (threshold level). The supply voltage between pins 4/8. If the level is created with the aid of the DTR
capacitor, C1, is supplied by a con- voltage between pins 2 and 6 reaches (data terminal ready) line. The RTS
stant-current source consisting of D2, about 2/3 of the supply voltage, the (request to send) line is used to charge
R2, R1, T1 and a solar cell acting as chip output changes from high to low the capacitor as the measurement sig-
the sensor. The result is a capacitor (active). nal travels to the PC via the CTS (clear
charging voltage which rises linearly. The crux of the circuit is that it does to send) line. The length of the time
The CMOS timer IC type 7555 (whose not require an external power supply. interval between discharging and
THRESHOLD 6
1 1 1 3 OUTPUT
CONTROL
5 RTS = ON
VOLTAGE
R
1 7 DISCHARGE
WAIT
TRIGGER 2
R
R = 100k
RTS = OFF
1
GND 982005 - 12
Figure 2. Internal structure of the TLC7555 CMOS timer used in the circuit.
NEW MEASUREMENT
COUNT =
COUNT + 1
Table 1.
DTR RTS D4 D2 CTS
off = 10 V, on = +10 V red green off = 0 V, on = +10 V CTS N
= LOW
off off off off off ?
on off off on off
off on on off off Y
on on off on on
USE COUNT
ID DRAIN SATURATION
1 CURRENT 2
The second important JFET parameter
D is the value of the current through the
drain-source channel when VGS is at
G 0 V, and VDS, at 15 V (usually!). When
these two conditions are satisfied, the
VGS S
drain current will remain practically
VDS
constant at a certain maximum value.
In other words, the drain-source chan-
970075 - 11
nel is saturated; it will not pass more
current. The symbol used for the drain
saturation current is ID(ss). Like ID,
Figure 1. Basic JFET ID(ss) derates (worsens) with increasing
connection circuit. temperature, as illustrated in Figure 3.
PRACTICAL CIRCUIT
to describe the electrical parameters of Admittedly, that was rather a lot of Figure 2. The pinch-off
JFETs (and other transistors). theory to wade through. High time to voltage VGS(P) and the drain satu-
discuss how the two measurements ration current, ID, are easily deter-
P I N C H - O F F V O LTA G E mentioned above are performed in mined if you have a transfer charac-
The first vital JFET parameter is called practice. Lets look at the circuit dia- teristic graph like this available
the pinch-off voltage, symbol VGS(p) or gram in Figure 4. (example: BF256C JFET; source:
simply V(p). Unfortunately, due to fab- Philips Components).
rication techniques, this parameter is Pinch-off voltage measurement (S1
subject to relatively large tolerance. In not pressed)
other words, the actual VGS(p) spec This measurement is performed when
of the JFET you have available may S1 is not actuated. The pinch-off volt- 3
differ considerably from the value age is indicated on the DVM (digital
specified in the datasheets. The pinch- voltmeter) connected to the output of
off voltage is the gate-source voltage at the tester. Imagine a JFET is inserted in
which negligible drain current flows. the D.U.T. (device under test) sockets.
Hence the name: this voltage pinches A reference voltage of 100 mV is cre-
off the current flow in the drain-source ated with R1-D2-P1-R2, and connected
channel to virtually nought. The to the non-inverting input of opamp
remaining current is due to leakage, IC2. The inverting input is connected
and usually defined as 1 nA, 10 nA or to the positive supply rail by a 10-M
even 10 A by the manufacturer. The resistor (R3), as well as to the FET
pinch-off voltage is stated assuming under test, which is included in the
that VDS is held constant. Here, too, feedback path to the opamp output.
opinions differ: some manufacturers Since the gate of the JFET is at ground
state VGS(p) at VDS = 10 V, others at potential, the voltage at the source is
VDS = 15 V. It makes little difference, controlled to make the gate more neg-
however, at long as you know that ative than the source (VGS). Because
VDS is a constant value, or nearly so. the opamp will attempt to make the
The JFET tester described here mea- voltages at its inputs equal, it supplies
sures VGS at IDS = 10 nA, and does a gain at which the voltage across R3
not use a constant voltage for VDS. Yes, will equal 100 mV. Resistor R5 then
it can be done! Referring back to the drops 10 nA 100 k = 1 mV. In this
graph in Figure 2, you can see that the way, VDS of the JFET is controlled Figure 3. Drain current (ID) derating
ID curve for values of VGS approach- until IDS equals 100 mV/10 M = as a function of junction tempera-
ing the VGS(p) value (like VGS = 10 nA. The result is that VGS(p) ture (Tj).
4 V) runs virtually straight from VDS = appears on the DVM. The error
2 V onwards. In other words, ID sources in this measurement are ID3
remains virtually constant as long as (10 pA), the input bias current of the
VDS is between, say, 3 V and 15 V. So, TL071 opamp (<200 pA) and its input with 15 V rather than 12 V (as the rest
the error caused by the non-constant offset voltage (<10 mV). of the circuit), the range of VGS is
value of VDS in the test circuit is neg- Some JFETs have a pinch-off volt- extended to about +2 V.
ligible, because VDS is always in the age between 0 and 2 V. To enable
range where ID is virtually constant. these devices to be tested also, a volt- Drain saturation current measure-
Thats why JFETs make great constant- age regulator is used in the negative ment (S1 pressed)
current sources! supply rail. By supplying the opamp This is a much simpler measurement.
4 A 12V 1N4001 D2 D3
R3
* zie tekst
10M
B C P1 D
B 0V65
5k
IC2
* see text
C 0V1 1N4148
1N4148
1 * siehe Text
voir texte
D 0V1 / 0V7
3 7
5
6
E *
R2 TL071
2
E 4V6 / 11V3
22k
4
C4
D.U.T. D 1n R5
D.U.T. D
K2
100k
D
T2 C1
G
S
G S
100
16V
K3 S1
S G
D 0V / DVM
S M1
K4 R4
K1 G
C2 C3 C5 G 100k
R1 R6
S
5k6
10
100n 100n 10
63V
D * DVM
15V
5mA
79L12
IC1
970075 - 14
R2
R1
or a little more than 100 A. This cur-
D2
COMPONENTS LIST D3
rent also flows through R6, where it is P1
R3
added to the drain saturation current. Resistors: 970075-1
gds
ID(ss) indication on the DVM is in P1 = 5 k 10-turn cermet pre-
K4
R6
R5
gsd
R4
Capacitors:
more logical because then the readout C1 = 100F 16V
is simply in mA. A higher output volt- C2,C3 = 100nF
C4 = 1nF
age is used, however, to enable the
C5 = 10F 63V
DVM to be switched to a higher range
with resultant higher accuracy (in gen- Semiconductors:
eral!). Owners of 4.5-digit DVMs may D1 = 1N4001
use a 1- resistor in position R6. What- D2,D3 = 1N4148
ever DVM you use, the accuracy of the T1 = device under test (JFET)
tester will benefit from the use of a 1% IC2 = TL071CP
(close-tolerance) resistor for R6. IC1 = 79L12
970075-1
Miscellaneous:
The voltages indicated in the circuit M1 = digital voltmeter (DVM).
are typical. The first voltage applies K2K3,K4 = 3 rows of 3 IC
when S1 is not pressed, the second, socket pins, turned sockets.
when S1 is pressed. Unless otherwise S1 = Digitast press-key, 1
indicated, measurements are with make contact (ITT-Schadow).
respect to the ground rail, i.e., the 0 V K1 = mains adaptor supply
socket, flat model.
input of the DVM.
The circuit may be powered by an
4k7
olution would be 1 kHz which is not IC1 IC2 100n
good enough for our purposes. 7 7
14 4 2x
1
The 74HC393 counter chip MCLR 1N4148 2 7
D4 6 R7 D1 8
increases the count to 24 bits, or D5 7
RB0
17 22k IC4
6
RB1 RA0 3 R12
16,777,215. With a 100-ms gate time D6 8
RB2 RA1
18 R8 D2
R10 IC3 4
1k2
OFFSET
this will allow a maximum count fre- 47k
D7 9
RB3
22k
10 PIC16C54 1 EN TL071
quency of 167.77721 MHz and a reso- RB4
- XT/P RA2 K3
11 2 RS
lution of 10 Hz, that is, if you can find +/ R11
12
RB5 RA3
47k RB6
logic chips that are fast enough. One 13
RB7 RTCC
3 C8 C9
problem with this arrangement is that OSC1
OSC2/
CLKOUT 100 1
it is not possible to read the least sig- R13 R14
16 15 5
R6
16V 16V
X1
nificant 8 bits directly from the 393 S1
1k2
1k2
1k2
counter. C5 C6 C7
4MHz
This problem is overcome by send- 40p
18p 33p
ing pulses to the counter input
LOCK / UNLOCK
through gate IC1d. By counting the
number of pulses it takes to make the
5V D7 D6 D5
counter overflow it is a simple matter GATE INC RESET K1
D7
to calculate the value in the 393 at the
100
100
100
R3 R4 R5
D6
time the gate was closed. As the PIC C1
R2
IC1d D5
CTR4
1k2
12 3
internal prescaler can not be read IC1c 11 0 D4
13 & 1
+ IC2a 4
directly, a similar method is used to
LCD MODULE
100n 9
8 CT 5
IC1b 10 & 2
calculate the value in the internal 4 CT=0
3
6
6
prescaler. Pulses are applied to the 5 &
R1
prescaler input by pin 13 of the PIC EN
100k
6 3 6 3 6
74121 74121 74121 CONSTRUCTION
If you use the PCB layout shown in
10 11 9 14 10 11 9 14 10 11 9 14 Figure 4 and a ready-made board, con-
struction of the circuit is fairly easy.
980004 - 14
100n 100n 100n Check the orientation of all polarized
components (electrolytic capacitors,
diodes, ICs, transistor T1). Use sockets
R11
front panel of the rig. The ADD/SUB-
C10,C11 = 10F 40V radial
TRACT (+/) input may be connected
980004 - 12 to the band switch of the rig using four Semiconductors:
diodes (see Figure 2). If you only need D1,D2 = 1N4148
for the ICs if you want to experiment to subtract the IF offset, you can con- D3,D4 = 1N4001
with different logic IC families, LS, nect the add/subtract (+/) input to T1 = BSX20
ALS, HC etc. If you use 74HC or ground. IC1 = 74HC00 (see text)
74ALS series chips for IC1 and IC2 it (980004-1) IC2 = 74HC393 (see text)
will not be necessary to have a heat IC3 = PIC16C54-XT/P (order code
986502-1)
sink on the 5-V regulator. The circuit
IC4 = TL071CP
was tested with HC ICs, and worked IC5 = 7805
reliably up to about 50 MHz. Higher
input frequencies should be possible if Miscellaneous:
you use ALS ICs. X1 = 4 MHz quartz crystal
The type of opamp used for IC4 is S1 = push-button, 1 make contact
quite critical, the ADOP07CN gave K1 = 14-way SIL header
Figure 4. Copper track LCD module 116 characters
very good results. If you do not have layout and component PCB only, order code 980004-1
an ADOP07CN available, the overlay (board available Disk only, order code 986006-1
TLO71CN also works quite well. ready-made through the PIC only, order code 986502-1
Readers Services).
THE DISPLAY
Any general-purpose 1-line 16-charac- + 0 IC5 980004-1
1-400089 C5
ter display that uses the Hitachi C11 D4
G4
tnemgeS )C(
G1
R7
HD44780 chip should be suitable (the 4 C12 K1
D1
author used a type 16166 LCD display
D3
P1
C10 C6 D2
module). Some of these displays have
R8 C9
LED or electroluminescent backlight-
R2
X1
C1
ing built in. Do not spend large sums R12
IC3
IC2
W1
C3
often advertised for less than 5.00. T1
R6
IC4
R9
C4 T
R1
R5 R13 R10
TESTING C2
R4 R14 R11
G2
G3
An annoying phe-
nomenon (not
restricted to PCs) is
that each and every
programme that pro-
duces sound does so
at a different level.
This means almost
constant adjustment
of the volume control
to ensure audibility of
one programme and
protection of the ear
drums with another
one. The control cir-
cuit described in this
article is designed to
obviate this nuisance:
it constantly monitors
the signal even at the Brief specification
output of the sound- Power output 1.2 W
card and adjusts it Maximum input 1V
Compression 10:1
when required. Use Supply line 12 V, 6 VA
of the circuit is not Output load 8 (LSP); 10 k (line)
Input sensitivity280 mV (gain line in to out = 0 dB; distortion at output = 1%)
restricted to PCs; it 120 mV (gain line in to out = max; distortion at output = 1%)
may also be used as
Line in to LSP out (input voltage = 200 mV)
a dynamic limiter in THD+N 0.25% (20.5 W)
existing audio equip- Signal-to-noise 70 dB for 0.5 W output at maximum gain
Channel separation >45 dB
ment.
Line in to line out (input voltage = 200 mV; no loudspeaker connected)
THD+N 0.047%
Signal-to-noise 80 dB
Channel separation >73 dB
Design by T. Giesberts
2 R2
220
C3
22
R9
220
C12
22
K2
12V 12V
LINE
R5 R12
220k 220k
C6 C7 C15 C16
C4 C13
1 63V 100n 1 63V 100n
4 3 680n 4 3 680n
R3 R10
10k
10k
6 6
K1 C5 C14
C1 R1 150n C10 R8 150n
8 IC1 5 8 IC2 5
560 560
TDA1013B TDA1013B
220n C9 220n C18
470 470
LINE 2 2
1k
4k7
33
1k
4k7
R15 R18
20k
20k
R16
C22 10k
Figure 2. The diagram
D3
6 of the automatic vol-
R21
R27
1n
1k
7
IC4b D1
2 ume control for PCs
5 1
100k 1N4148 IC3a shows that the circuit
3
2 BAT85 has been kept
30k
R26 R17
13 1
14
10k IC4a
3
C19 R23 straightforward.
IC4d 1k
12
390n
R19
C21 R24
10k
10k
12V 9 12V
100n P1 D4 R22
8 6
1k IC4c D2
12V R25 10 7
BF256B BF256B 50k C20 1N4148 IC3b
10M
5
T2 T3 BAT85 T1
30k
22 R20
10V
BF245A
D6 D5
C27 C26 8 C25 4 C24 C23
IC3 = CA3240
IC3 IC4 IC4 = TLC274
2200 220 4 100n 11 100n 100
25V 10V 25V 25V 5V6
1W3 0W4
980023 - 12
H1
H3
D5
R7
Resistors: D6
C23
R1, R8 = 560 C9 C8
R18
R2, R9 = 220 R19 C26
C16
R14
R3, R10, R16, R19, R24, R26 = 10 k C7 R20
R13
R6
LSP
R4
R4, R11 = 4.7 k
R15
R16
R17
OUT1
C3 C6 C15
IC1
D1
IC3
D2
R5, R12 = 220 k C17
IC2
R6, R13 = 3.3
C22
R7, R14, R21, R22, R23 = 1 k
R12
R11
R10
C25
R2
R3
R5
R15, R18 = 20 k
C14
R27
C5
C12
R17, R20 = 30 k Line
R26
OUT2
K2 R9
C4
R22
R21
R25 = 10 M IC4
R27 = 100 k
R1 C2 C13
P1 = 50 k (47 k) preset P1 C20 C24 C19
C1 C11 D3
D4
R25
R24
R23
Capacitors: C10 R8
C21
K1
H2
H4
Semiconductors:
D1, D2 = BAT85
D3, D4 = 1N4148
D5 = zener diode 5.6 V, 400 mW
D6 = zener diode 10 V, 1.3 W
T1 = BF245A
T2, T3 = BF256B
Integrated circuits:
IC1, IC2 = TDA1013B Figure 3. The printed-
IC3 = CA3240E circuit board for the
IC4 = TLC274CN automatic volume
control.
Miscellaneous:
K1K3 = 3.5 mm stereo audio socket
for board mounting
between 6.5 V (+5 dB) and 2.0 V the line outputs (R2-C3 and R9-C12).
PCB Order no. 980023-1 (see Read-
ers Services towards the end of (80 dB). The output amplifier outputs are
this issue) The control voltage is applied to provided with large electrolytic capac-
pin 7 of the IC. The line output is at itors, C9 and C18.
pin 6, which is linked via a capacitor The supply lines are decoupled by
to pin 5, the input of the output C7 and C16.
amplifier.. Filters R6-C8 and R13-C17 ensure
the stereo preamplifier. The circuit has three stereo termi- that the amplifiers remain stable at
The values of various components nals: line in, line out, and power out. high frequencies.
in the control circuit are chosen to The power output is 2.5 W for a
ensure a fast attack time and a long loudspeaker impedance of 8 and a
release time. This ensures that short- supply line of 18 V, which is sufficient RECTIFICATION AND
duration signal peaks are effectively for most applications. REGULATION
suppressed, whereupon the circuit The analogue input signal at the The audio signal to be rectified is taken
recovers (relatively) slowly from the line input, K1, is applied to pin 8 of from the loudspeaker terminals and
damping action. IC1,raised in the preamplifier and out- applied to IC3a and IC3b. The follow-
Power for the circuit is derived put via pin 6. The transfer between ing description is based on IC3a.
from a standard 12 V mains adaptor. pins 8 and 6 depends on the control Negative signals are inverted by the
voltage at pin 7. op amp and amplified by a factor that
The line signal is attenuated and its depends on the ratio R15:R16. In the
CIRCUIT DESCRIPTION level made suitable for inputting to present circuit, this is 2, that is, atten-
In the circuit diagram in Figure 2, the the output amplifier by networks uation. With positive signals, the op
preamplifier-output amplifier combi- R3-R4 and R10-R11. Assuming a supply amp is overdriven and its output neg-
nation is contained in IC1 and IC2. This line of 12 V, the output amplifier is dri- ative. Diode D1 is then cut off and half
type of IC is a compact 4 W audio ven fully (Po(max) = about 1.2 W into the input voltage is available at its
amplifier with integral voltage-con- 8 ) by an input signal of 90 mV. cathode [R17/(R15+R16+R17)]. This
trolled volume control. The range of RC networks are provided at the means that the op amp behaves as a
the logarithmic volume control is inputs (R1-C1-C2 and R8-C10-C11) and full-wave rectifier/amplifier, whose
8090 dB with control voltages amplification is the same (0.5) for both
+6
30
4 +5 20
+4
10
+3
+2 5
+1
d
B -0 2
r %
-1
1
-2
0.5
-3
-4
0.2
-5
-6
0.1
20 50 100 200 500 1k 2k 5k 10k 20k
20 50 100 200 500 1k 2k 5k 10k 20k
Hz 980023 - 13a Hz 980023 - 13b
10
halves of the input signal. sound card to another, the design pro- After it has been fitted, set the preset
Operational amplifiers IC4a and vides a wide control range. to minimum volume (anticlockwise).
IC4b are half-wave rectifiers whose Solder the output leads from the
outputs are interlinked by diodes D3 S U P P LY L I N E S standard mains adaptor from which
and D4. Because of these diodes, the As mentioned earlier, the circuit is power is derived to the relevant pins
output with the highest potential powered by a standard 12 V mains on the board. If the board is to be
determines the extent to which capac- adaptor, which is applied directly to housed in an enclosure, a plug-and-
itor C20 is charged via resistor R4. Net- the output amplifier. All other circuit socket arrangement should be used for
work R23-C19 has been added to elements are supplied with a regulated linking the output from the adaptor to
ensure that fast signal fluctuations are 10 V potential. This voltage is pro- the board.
passed on very rapidly. duced with the aid of current source Check that the output voltage of
Capacitor C20 is discharged slowly T2-T3 and zener diode D6. the adaptor does not rise above 18 V
via resistor R25, so that the control cir- The reference voltage of 5.6 V is with small loads.
cuit returns to its default setting when produced with the aid of current When all is connected, the circuit
no or a smaller input has been applied source T1 and zener diode D5. can be tested. Passive loudspeakers
for some time. The potential across C20 may be linked directly to the LSP
is buffered by IC4a, while IC4d ensures output terminals, but active ones
that the (fixed) default level is added CONSTRUCTION should be connected to the line out-
to the signal. The resulting control sig- The circuit is best built on the printed- put terminals.
nal is applied to the control input circuit board shown in Figure 3 (see Finally, connect a sound source, for
(pin 7) of IC1 and IC2. Readers Services towards the end of instance, the line output of a sound
With component values as speci- this issue). Start the construction with card or the output of a Walkman to
fied, the compression is 10:1; in other placing audio sockets K1K3, the three the input of the circuit and adjust P1
words, a 20 dB change at the input wire bridges, and all solder pins, and for the desired volume. From then on,
results in a 2 dB change at the output. follow these with first the passive com- any fluctuations in the signal input
The setting of P1 depends on the ponents, and then the active ones. level will be minimized automatically.
signal level at the input of the circuit. Mind the polarity of the electrolytic [980023]
Since this level varies largely from one capacitors, diodes, transistors, and ICs.
5V
2 C12
10 16V
C4
100n
5V
C6
100n
5V
5V
R1 IC2
40 28
74HC573
8k2
K2 K3
39 AD0 AD0 2 19 A0 A0 10
P0.0 1D A0
K1 38 AD1 AD1 3 18 A1 A1 9 A12 PSEN
P0.1 A1
RD 17 37 AD2 AD2 4 17 A2 A2 8 A7 A13
RD P0.2 A2
WR 16 36 AD3 AD3 5 16 A3 A3 7 11 AD0 A6 A8
WR P0.3 A3 D0
T1 15 35 AD4 AD4 6 15 A4 A4 6
IC3 12 AD1 A5 A9
T1 IC1 P0.4 A4 D1
T0 14 34 AD5 AD5 7 14 A5 A5 5 13 AD2 A4 A11
T0 P0.5 A5 D2
INT1 13 33 AD6 AD6 8 13 A6 A6 4 15 AD3 A3 A15
INT1 P0.6 A6 RAM D3
INT0 12 32 AD7 AD7 9 12 A7 A7 3 16 AD4 A2 A10
INT0 P0.7 A7 D4
TXD 11 A8 25 17 AD5 A1 A14
TXD A8 D5
RXD 10 30 11 A9 24 62256 18 AD6 A0 AD7
RXD ALE/P C1 A9 D6
RESET 9 1 A10 21 19 AD7 AD0 AD6
RESET EN A10 D7
P1.7 8 21 A8 A11 23 AD1 AD5
P1.7 P2.0 A11
P1.6 7 80C32 22 A9 A12 2 AD2 AD4
P1.6 P2.1 A12
P1.5 6 23 A10 5V A13 26 20 A15 A15 AD3
P1.5 P2.2 A13 CE
P1.4 5 24 A11 A14 1
P1.4 P2.3 20 C5 A14
P1.3 4 25 A12
P1.3 P2.4 IC2 OE WE
P1.2 3 26 A13 100n RM
P1.2 P2.5 10 22 14 27
P1.1 2 27 A14
P1.1 P2.6 RD WR
P1.0 1 28 A15
P1.0 P2.7
31 PSEN
29
EA/VP
5V
X1 X2
20 19 18
X1 5V 5V
IC6d IC6c C13 C14
12 9
C1 C2 11 8
13 & 10 & 100n 100n
1 28 1 28 27
22p 22p
VPP VPP PGM
X1 = 11.0592MHz A0 10 10 A0
A0 A0
RD A1 9 9 A1
A1 A1
WR A2 8 8 A2
A2 A2
A3 7 11 AD0 AD0 11 7 A3
A3 D0 D0 A3
C8 A4 6
IC4 12 AD1 AD1 12
IC5 6 A4
A4 D1 D1 A4
A5 5 13 AD2 AD2 13 5 A5
A5 D2 D2 A5
A6 4 15 AD3 AD3 15 4 A6
2 A6 EPROM D3 D3 EPROM A6
5V K4 A7 3 16 AD4 AD4 16 3 A7 A14
1 V+ 16 A7 D4 D4 A7
C9 C1+ A8 25 17 AD5 AD5 17 25 A8
1 A8 27256 D5 D5 27128 A8 1 2
IC7 A9 24 18 AD6 AD6 18 24 A9
3 6 A9 D6 D6 A9 IC6a
C1 A10 21 19 AD7 AD7 19 21 A10 &
11 14 2 A10 D7 D7 A10
T1IN T1OUT A14 A11 23 23 A11
10 7 7 A11 A11
T2IN T2OUT 3
A12 2 2 A12 A15
12 13 3 JP1 A12 A12
5V R1OUT R1IN A13 26 26 A13
9 8 8 A13 A13 5 4
R2OUT R2IN 27
4 C11 C3 4 A14 OE CS IC6b
C10 C2+ &
14 C15 9 CS OE 22 14 20
MAX232
IC6 5 15 100n 5 20 14 22
C2 A15 6
7 100n V- 5V
PSEN
6
C7
IC6 = 74HC00 980002 - 11
C7...C11 = 5x 10 / 25V
2 analogue outputs fiers (IC12b and IC12c) which give you applied by way of terminal block K24.
The two analogue outputs work in accurate control over the output signal In the first case, install the short wire
much the same way as the digital out- levels before they leave the control link under IC12. The long wire is used
puts. An 8-bit word is applied to an R- computer. If necessary, multiturn pre- if you intend to connect a 24-V exter-
2R network (R20-R35 and R38-R53) sets may be used where really accurate nal supply.
rather than an output buffer. Imped- output level settings are required. (980002-1)
ance converters IC12a and IC12d The output amplifier may be sup-
buffer the resulting output voltages. plied with either an internal voltage of
Next come adjustable output ampli- +8 V, or an external voltage of +24 V Figure 3. Circuit dia-
gram of the multifunc-
tion extension board.
D7
IC4a IO1
2 1
1 D6
WR
5V
1 R7 8x 820 1 R9 8x 1k5
2x 5V
33k
R56
1N4148
3 2 3 4 5 6 7 8 9
IO1 1
IC5 IC7 2 3 4 5 6 7 8 9
& 11 24V
RD 19 EN C1
1
D12 D13 D14 D15 D16 D17 D18 D19 EN D28 D29 D30 D31 D32 D33 D34 D35
10
R59 2 18 D0 D0 9 12 8 +VS 11
DI1 100k 1D I8 O8 DO1
K4 R60 3 17 D1 D1 8 13 7 12 K13
DI2 100k I7 O7 DO2
R61 4 16 D2 D2 7 14 6 13
DI3 100k I6 O6 DO3
K5 R62 5 15 D3 D3 6 15 5 14 K14
DI4 100k I5 O5 DO4
R63 6 14 D4 D4 5 16 4 IC8 15
DI5 100k I4 O4 DO5
K6 R64 7 13 D5 D5 4 17 3 ULN 16 K15
DI6 I3
R65
100k
8 12 D6 D6 3 18 2 2803 O3 17
DO6
DI7 100k I2 O2 DO7
K7 R66 9 11 D7 D7 2 19 1 18 K16
DI8 100k I1 O1 DO8
VEE
5V 74HCT541 74HCT574 9
1 R8 8x 820
D9
IC4b IO2
4 3
K8 2 3 4 5 6 7 8 9 IC6 IC10 1 D8
IO2 1 WR
& 11
RD 19 EN C1
1
2x
33k
D20 D21 D22 D23 D24 D25 D26 D27 EN R57
100k 1N4148
R35
R67 2 18 D0 D7 9 12 R28
DI9 100k 1D 200k 100k
R68 3 17 D1 D6 8 13 R27 R34
DI10 100k 200k R37
K9 R69 4 16 D2 D5 7 14 R26 3
DI11 100k 200k 100k 100k
R70 5 15 D3 D4 6 15 R25 R33 1
DI12 100k 200k IC12a
K10 R71 6 14 D4 D3 5 16 R24 2
DI13 100k 200k 100k
R72 7 13 D5 D2 4 17 R23 R32 5
DI14 100k 200k
K11 R73 8 12 D6 D1 3 18 R22 7
DI15 100k 200k 100k IC12b
R74 9 11 D7 D0 2 19 R21 R31 6
DI16 100k 200k
K12
74HCT541 74HCT574 100k
R30
P1 R36
100k
24V 5V 100k
C16 R29
EOC
+24V 100k
200k
R10 R20 MT
K17 14
AI1 220k 100n
R20 ... R35 = 1%
R11 13 28 D10
CH0 EOC IC4c WR
220k 12
AI2 CH1 22 D0 6 5
K18 R12 11 D0 1 D11
AI3 CH2 21 D1 IO3 AO1
220k 10 D1 IC11 K20
CH3 20 D2 AO2
R13 D2 11
2x
33k
4 19 D3 C1 R58
AI4 220k CI D3 1 1N4148
K19 C15 18 D4 EN
D4 100k
IC1 R53
17 D5
D5
15n 6 16 D6 D7 9 1D 12 R46
R14 R15 R16 R17 CI D6 200k 100k
C17 C18 C19 C20 15 D7 D6 8 13 R45 R52
D7
220k
220k
220k
220k
200k R55
D5 7 14 R44 12
PD7002 5 200k 100k 100k
15n 15n 15n 15n GD D4 6 15 R43 R51 14
7 200k IC12d
GD D3 5 16 R42 13
RD 25 200k 100k
RD 26 A0 D2 4 17 R41 R50 10
5V WR 24 A0 200k
5V WR 27 A1 D1 3 18 R40 8
A1 200k 100k IC12c
8 D0 2 19 R39 R49 9
R18 VREF 200k
3 23
16 14 VSS CS
10k
IC3 IC4 X1 X0
1% 5V P2 R54
100k
R38 100k
10k
MT
IC3 = 74HCT139 C14 C13 R38 ... R53 = 1%
1%
IC4 = 74HCT14
22p 22p 2 3 4 5 6 7 8 9
K1 12V
D0
D1
D2
D3
D4
D5
D6
D7
2,4576MHz
RD 2.4576MHz 4 C22
WR
IC12
T1 D40 IC12 = LM324
5V 11 100n
T0 D41
INT1 D42
5V
INT0 D43 R1 R2 R3 K2 K3 DMUX
A13 1 4
0
220k
100k
1k5
TXD
4x IC3a 5
RXD 1
1N4148 A13 A14 2 6
RESET D5 0 0 2
JP1 A15 3 G 7
P1.7 1 3 3
R4
P1.6
220k
P1.5
IC4f IC4e IC4d A3 A15
P1.4 C10 D4
13 11 9 A2
P1.3 1 1 1
12 10 8 RESET A1 A14
P1.2 100n 1N DMUX
4148 A0 D7 15 12 IO1
P1.1 0
D0 D6 IC3b 11 IO2
P1.0 R5 1
D1 D5 A2 14 10 IO3
2
1k
0 0
D38 D36 D2 D4 A3 13 1 G 3 9 IO4
BZ1 C11 3
5V 5V D3
S1
D39 D37 33
10V
4x 1N4148 RESET
D3
+24V 24V
IT1
IT0
P1.0
P1.1
T0
T1
K24
+5V 5V D2 12V 8V
K22 K21 IC1 IC2
K23 +24V
5V D1 7808 7805 5V
20 20 20 20 20
3x 1N4001
C8 C24 C9 C23 C21 D44
C6 C1 C2 C5 C3 C4 C12
IC5 IC6 IC7 IC10 IC11
10 100n 10 100n 10 100n 10 100n 10 100n
+12V 100 100n 100n 47 100n 100 100
K25 40V 16V 5V6 16V 40V
980002 - 12
A metronome
is and remains an
indispensable tool for
musicians, beginners
and professionals
alike. In addition to
the time-honoured
triangular mechanical
instruments, there are
now electronic mod-
els on the market. A metronome is an apparatus for ing of an LED. Another useful feature
sounding an adjustable number of beats is the provision of a generator for tun-
This article describes per minute and therefore for fixing the ing string instruments.
tempo of a composition. The idea of the
a simple DIY clockwork model patented by Maelzel CIRCUIT DESCRIPTION
metronome that may seems to have been appropriated from Metronome
the Dutch inventor D N Winkel. The generator producing the beats con-
prove useful to begin- The one most commonly used is a sists of the two halves of a Type 556
ners in music. pyramidal wooden instrument at the
front of which a perpendicular steel
CMOS timer, IC1. Section IC1a is con-
figured as an astable multivibrator.,
strip about 3.5 in long by 0.5 in wide is whose frequency can be adjusted with
pivoted. The principle is that of a dou- P1 between 60 and 250 beats per
ble pendulum (an oscillating rod minute. If the lower figure is too fast,
weighted at both ends). The upper the value of C1 may be increased
weight is movable along the steel strip slightly. On the other hand, the upper
and according to its position on the limit of 250 beats may be raised
rod the number of oscillations per (although this is unlikely to be required
minute can be made to vary between for music applications) by reducing the
40 and 208. The rod beats (or ticks) as value of R1 to about 1 k.
it swings back and forth. Maelzels To ensure a regular, stable fre-
* In music and audio engineering, a graduated scale, fixed to the case, gives quency, C1 should preferably be a tan-
third is a melodic and harmonic speed of oscillation. A composer who talum capacitor, but if need be, a good-
interval, taking three steps in a scale wants, say, 78 crotchet (US: quarter- quality electrolytic may be used.
(major or minor) counting top and note) beats in a minute will write M.M. The output of IC1a triggers the
bottom notes. So, major third (C up (Maelzel metronome) q = 78. other section, IC1b, a monostable mul-
to E), minor third (C up to Eb), and The electronic metronome tivibrator, via C2. The monostable gen-
diminished third (C# up to Eb). described here has a useful feature in erates pulses of constant width in the
emphasizing the first beat in a bar. This rhythm of the clock frequency.
is done acoustically by increased vol- The output if IC1b is split into two:
Design by F. Hueber ume as well as electrically by the light- one part is applied to the clock input
of decade counter IC2, and the other reset after 38 pulses. In the time sig- Diodes D1 and D2 ensure that the
to low-frequency output amplifier nature, which is placed on a sheet of output signal is a nearly pure sine
T1-T2 via R5. music immediately after the clef sign, wave. The nearly is caused by the
Outputs Q0Q8 of the counter are the numerator in these fractions indi- inevitable cross-over distortion result-
successively enabled and actuated, cates the number of beats in a bar and ing from the output stage operating
that is, in this case, they are changed the divisor the value of each beat. without quiescent current. The output
from logic low to logic high (0 to 1). Thus, a time signature of 3/4 means frequency is that of the international
This is particularly important as that there are three beats in each bar concert pitch, that is, the tuning-note
9V
1 R1 R3 R4 R5 R6
1k
10k
10k
3k3
3k3
T3
R7
4 10 CTRDIV10/ 3
0 33k
R R DEC 2
P1 1 13 1 R8
10k DIS DIS IC2 4
2 BC560
1k
IC1a C2 IC1b
2 5 8 9 14 7
THR OUT TR OUT & 3
13 + 10
R2 10n 4
1k8
6 12 S1
TR THR 1
4017 5 D3
CNTR CNTR 5
6
3 C3 11 6
C1 7
15 9 D4
CT=0 8
IC1 = TLC556 100n 11
47 25V 9
12
9V CT5
5V1
R11 P2
T1
27k
D1 10k
BC337
R10
D2 220k S2a C4 R9
22
10k
BT1
C8 14 C9 16 C10
P3 R16 IC1 IC2
C5 C6 C7
470 100n 100n
10k
7 8
10k 9V 16V
10n 10n 10
R13 R14 16V
39k 39k
980006 - 11
regards Q0 (pin 3), since Figure 1. The and that the value of A (=440 Hz). but may be altered
this is held low for the metronome proper is each beat is a crotchet slightly, if desired, with P3. The actual
longest period of time based on IC1 and IC2, or quarter note. frequency-determining components
to keep transistor T3, while the Wien bridge Transistors T1 and are R13, R14, C5, and C6.
which functions as a oscillator, based on T2 together form a sim-
switch, on. IC3, provides the tun- ple push-pull output Power supply
Potential divider ing frequency. stage that operates Power is supplied by a 9-V dry battery.
R5-R6 is then actuated, with virtually no quies- Switch S3 is the on/off selector. Switch
which results in the cent current. The section S2b arranges power to be sup-
pulses arriving from IC1 sound level may be plied to oscillator IC3 when the unit is
being applied at only half amplitude. adapted to individual taste by chang- switched to tuning.
Output Q0 goes high only at the first ing the value of R9 between the out- With average use, the battery will
beat in a bar, when the potential put stage and the loudspeaker. Note, last quite a long time. The metronome
divider is not actuated, whereupon the however, that the sum of this resistor circuit draws a current of about 8 mA
relevant pulse arrives at T1-T2 at full and the ohmic value of the loud- and the frequency generator one of
strength. Consequently, this beat is speaker must not drop below 20 to around 15 mA.
rather louder than the others and also prevent overloading of the transistors.
sounds a little different. At the same
time, the high level at Q0 causes D3 to 440 Hz generator CONSTRUCTION
light briefly. This LED also serves as a The push-pull output stage can be The metronome/generator is best built
battery indicator: when the battery switched from the metronome proper on the printed-circuit board shown in
voltage drops below about 6 v, zener to the output of frequency generator Figure 2, which is, however, not avail-
diode D3 ensures that the diode IC3. This is a classical Wien bridge able ready made.
remains extinct. oscillator whose output level is set Rotary switch S1 and preset P1 may
The number of beats in a bar (US: with P2. The type of op amp used is be fitted directly on the board.
measure) is set with S1. Depending on not important: almost any type, even The space at the right-hand side of
the setting of this switch, the counter is a 741, will do. the board is intended to house the
P1
Q2 Q5
C8
-
Bt1
+
C1
S1
S3
R2
R1
R3
C2
C9
C3
IC1 IC2
C10
S2
R5 R4
R8
R17 R6
D4
D3
R10
R7
P2
980006-1
(C) Segment
1-600089
tnemgeS )C(
T3
T1
T2
R11
D2
C4
D1
IC3
HOLE35E
R9
980006-1
R12
C6
R14
P3
LS
C5
C7
R13 R16
Q3
R15 Q4
loudspeaker. If TUNING
desired, a suitable Tuning the frequency generator with
hole can be cut in P3 to 440 Hz is, of course, best done
the space for the with the aid of a suitable frequency
loudspeaker meter. If such an instrument is not
magnet. available, the A-note struck on a well-
The fin- tuned piano may be used to compare
ished board the generator output with (this needs
and battery a critical ear, of course!).
are best
housed in a F I N A L LY
suitable Bear in mind when selecting a value
enclosure, for R9 and setting P2 that the sound
such as the from the loudspeaker is much louder
one speci- in the enclosure than when it lies on
fied. the table! [980006]
0 1 2 3
Shannons sampling theorem (1949)
states that, in a pulse-coded system,
two samples per cycle will completely
characterize a band-limited signal, that
is, the sampling rate must be twice the Figure 3. When a sig- y3
980015 - 2 - 11
highest-frequency component. In prac- nal is undersampled,
tice, the sampling rate is at least five only each xth sample
times the highest frequency. is taken.
It will be seen that the theorem is SMPL1.EXE, ALIASING
invalidated when the highest frequency whereby FREQUENCIES
is more than half the sampling rate. MUSIC1.WAV is converted to a file Aliasing frequencies are not random:
MUSIC2.WAV. The undersampling factor they can be accurately predicted. If, for
SOUND PROGRAMME is indicated by DWNSMPL1\inp =MUSIC1. instance, a sinusoidal signal of fre-
MUSICG1 <return> generates a WAV\ out =MUSIC2.WAV\factor=4 quency f0<fs/2 is sampled at a rate
sound programme of 60 single tones, <return>. This means that only tones equal to fs, definite sample values are
each separated from the next and pre- lower than 11,025/2=5512.5 Hz can be obtained. Each signal of frequency
ceding one by a semitone. The lowest reconstructed properly. Sampling of m(fsf0) or m(fs+f0), where m=1, 2, 3,
frequency is 40 Hz and the highest the higher-frequency tones results in a , generates the same sample values
14 kHz, that is, the programme spans phenomenon known as aliasing. This associated with f0 see Figure 4.
a range of more than five octaves. The gives rise to a tone erroneously taking After sampling has taken place,
tones are sampled by MUSIC1. WAV at a on the identity of an entirely different these frequencies cannot be distin-
rate of 44.1 kHz. The conditions of the frequency when recovered. guished from one another. To prevent
theorem are fulfilled, which is verified
by a good audible sound.
UNDERSAMPLING
Aliasing
The effect of aliasing may be compared to that seen on a cinematographic or video film
If the sound generated in the previous
when a spoked wheel of a vehicle turns at such a speed that successive samples (frames
paragraph is sampled at a rate of only of the film) catch the wheel at slightly earlier or later positions. Between one frame and the
11,025 kHz, that is 1/4 of the original next a spoke turns to almost the same position as formerly occupied by an adjacent spoke.
rate, we speak of undersampling (see The result is to make the wheel appear to rotate much more slowly or even bakcwards.
Figure 3). It is executed by DWN
L O W- PA S S F I LT E R
The low-pass filter used to suppress
aliasing frequencies must be a digital
type. Digital filtering is completely dif- fs - f 0 fs + f 0 2fs - 2f 0 2fs + 2f 0
ferent from analogue filtering. Ana-
logue filtering processes signals in the
frequency domain, whereas digital fil- f0 fs fs 2fs
tering does so in the time domain. So, 2
if a certain frequency domain response
is required, it is necessary to convert
this response into the equivalent time
980015 - 2 - 12
domain. So, let us see what happens
when we try to use an analogue filter aliasing
(see Figures 5 and 6). Figure 4. Aliasing
During a sampling interval causes equivalent fre-
T=tk+1tk, input voltage u changes PULSE GENERATORS quencies to be pro-
but little, but attains the value uk. The The CD-ROM contains a couple of duced from dissimilar
output voltage will not change much pulse generators. The first and simpler samples.
either, so that an almost constant cur- is indicated by PULSE1.EXE. This gener-
rent i=(ukvk)/R flows through resistor ates a very brief pulse that has only
R. At the onset of the sampling inter- one sampling value which is not zero: Figure 5. An RC net-
val, the potential across the capacitor the value of all others is zero. The posi- work used as an ana-
is vk. It is charged by i during the sam- tion and amplitude of the pulses can logue low-pass filter.
pling period to attain the potential be set by relevant parameters. This ele-
mentary signal is very important and 5 R
vk+1 =vk+i t/C=vk+(vkuk)/ RC t. will be used frequently in experiments
later in this series of articles.
If we solve this for uk+1, we obtain Another pulse generator is found
under STEP1.EXE. This generates a sim-
vk+1=rvk+uk(1r), where r=1( t/RC. ple step signal with predestined ampli- C
tude and position. For instance, calling u (t) v (t)
This is the calculation prescription for up DO XLP1.SPP generates the signals
the first digital filter. The program is on shown in Figure 8. That at the top rep-
the CD-ROM under the title LP1.EXE; resents the reaction of filter tmp.wav
the source code, LP1.PAS is given in Fig- to pulse1.wave, and that at the bottom,
ure 7. tmp.wav, the slowly rising response to 980015 - 2 - 13
The example shows that not all step1.wav.
programs for digital signal processing As before, this experiment may be
need to be long and tedious. It is, of repeated with various values of r. For nal of 11000 Hz is generated (top of
course, admitted that most of the rou- instance, what happens when r=0.9? Figure 9) and applied to the low-pass
tine work has been done by program However, this kind of response does filter. The amplitude of the output sig-
library SIGLIB.PAS. not give a very clear picture of the per- nal (at the bottom) drops with rising
The filter is tested by processing file formance of the low-pass filter. A bet- frequency.
MUS1.WAV (also listen to it!) on the ter one is obtained by the use of a Another possibility is to apply
CD-ROM. This is done by calling up sweep generator, which is also avail- white noise to the filter and view the
able on the CD-ROM. output signal. But for that purpose, it
1p1 \r=0.995 \scale=10 \inp= When DO XLP2.SPP <return> is is necessary to first analyse and exam-
mus1.wav \out=tmp.wav <return>. called up, a sweep sig- ine signal spectra.
Figure 6. Step
Listening to the resulting signal makes response of the digital
the distinction between tmp.wav and low-pass filter.
the original signal very clear.
Some experiments may be carried 6 uk u (t)
out with the filter. For instance, try
out several values for r, but note that
this should not be greater than unity v (t)
to prevent the filter becoming unsta- vk vk+1
ble.
Just listening to a filter s perfor-
mance is, of course, not the best test.
For a proper test, a couple of test sig-
nals are needed to analyse, say, the
frequency response in the time and
frequency domains. These signals
may be derived from a pulse gener-
ator. t
980015 - 2 - 14
980015 - 2 - 16
10
980015 - 2 - 18
11
980015 - 2 - 19
980015 - 2 - 20
or its
Electronics or
experience by
is based
practical experience
note is
this note
not imply
antenna impedance
A TEMIC Semiconductors matching IC.
The
Application
in
the input-output matching imped- resistor which is connected between AGC (pin 4)
ance. Therefore, it is possible to adjust FMGAIN and GND1. To influence the Direct current flows into the AGC pin
the amplifier to various impedances a.c. gain of the amplifier, a resistor is at high FM antenna input signals. This
(usually 50, 75 or 150 ). connected in series with a capacitor current has to be amplified via the cur-
To protect the amplifier against between FMGAIN and GND1. The rent gain of an external p-n-p transis-
input overload, an Automatic Gain capacitor has to be a short at frequen- tor that feeds a p-i-n diode. This diode
Control (AGC) is included on the chip. cies 100 MHz. dampens the antenna input signal and
The AGC observes the a.c. voltage at
a g
2 3
Figure 2. Pinout of
the AM/FM
antenna imped- c
ance matching IC.
PIN DESCRIPTION e j
The pinout is shown in Figure 2. Note
that pins 6, 9, 11 (U4253BM only), and
16 are not connected.
Pin 10,
pin 8 to ground via 15pF,
2nd harmonic 60** dBc
fAMIN = 500 kHz,
Output voltage = 110 dBV
FM amplifier
Supply current limit IAGC, IAGCADJ = 0 A, Pin 15 I15 33 35 mA
Input resistance f = 100 MHz Pin 1 RFMIN 50
Output resistance f = 100 MHz Pin 15 RFMOUT 50
Power gain f = 100 MHz Pin 15/ Pin 1 G 5 dB
Pin 15
Output noise voltage
f = 100 MHz, B = 120 kHz VN 0 dBV
120
3
6 D
DMX
IC1
LTC490
DMX R1 8
2
R
120
DMX
980013 - 13
begun with a start code other than 00H. ponents at frequencies up to 2.5 MHz. The leakage current at the output
This means that in the DMX system should not exceed 100 A during an
TIMING cables must be used that are quite dif- output signal.
As mentioned earlier, the DMX-512 ferent from the ones used in analogue The input impedance of the
standard supports up to 512 dimmers; systems. No longer can standard cable receiver must be not lower than 12 k,
a minimum is not stipulated. After the with simple connectors be used: spe- while the output load must not exceed
data has been transferred to the final cific types of cable with corresponding 60 .
dimmer in the chain, the data line connectors are imperative. Short-circuit currents of 150 mA to
returns to the quiescent state (mark). As mentioned earlier, the system is earth and 250 mA to the positive sup-
The next reset signal indicates that a based on the RS485 interface, which is ply line are permissible.
new transfer of data is imminent. It is an improvement of the earlier RS422
imperative that two sequential setting system. The improvements make pos- This article is based on information
instructions are separated by an inter- sible more connections to the bus and available in the relevant Internet infor-
val (pause) of not less than 1196 s. additional space for more masters. The mation from Soundlight (http://www.
The data rate in the DMX-512 stan- latter facility is not used in the soundlight.de/techtips/dmx512/dmx
dard is 250 kbit/s. Since one bit lasts for DMX512 system, but the former 512.htm).
4 s, a complete instruction, including enables applications within a network. [980013]
the stop and start bits, takes 44 s. The Although the RS485 standard limits
timing diagram in Figure 2 shows a the length of the cable, exceeding the
complete sequence of 512 bytes, the specified length within reason will not
data stream required for the theoreti- create difficulties: distances of up to
cal maximum of 512 dimmers. When 1 metre (3.3 ft) are perfectly usable,
all times are added, the maximum provided that the final unit in the
time duration is 22,668 s, which cor- chain is terminated correctly into an
responds to a repetition rate of impedance of 120 . Pinout of connectors used
44.1 Hz. From this, it is clear that the If larger distances need to be
use of the maximum number of dim- spanned, a bus repeater should be 5-way AXR (XLR) plug
mers restricts the speed of operation. used. The circuit of such a repeater is pin function
The DMX-connection allows 32 shown in Figure 3. Note that both the 1 earth (screen)
lighting units to be linked to the bus. input and output are terminated into 2 DMX-
There is no limitation as to the num- 120 . The DMX-512 standard does 3 DMX+
ber of addresses that each of these not specify the electrical isolation. 4 n.c. (may be linked to DMX)
units can handle. 5 n.c. (may be linked to DMX+)
SOME LIMITING
3-way AXR (XLR) plug
CABLES VA L U E S
pin function
AND ALL THAT It is important that the driver can han-
1 earth (screen)
The cables carry rectangular-wave sig- dle signal levels between 1.5 V and 5 V
2 DMX-
nals at a frequency of 250 kHz maxi- at a common-mode potential between
3 DMX+
mum. Each signal may contain com- 7 V and +12 V.
Strictly speaking, a
trinket cannot be
functional, but the
title of this article is
apt. It is a kind of
miniature VU meter
whose LED bar fluc-
tuates in rhythm with
ambient sound.
Owing to its modest
dimensions, it can
easily be worn as an
adornment which, in
a disco or at a party,
will, no doubt, draw
the attention of many.
Nowadays, not many things surprise the planet Mars are accepted as a com-
us any more. In this age of high tech- monplace.
nology, we are used to all kinds of new Of course, this is true not only in
discoveries and developments, and the world of science and technology,
technical ingenuity. Mobile telephones, but also in other spheres of human
portable CD players, watches with interest. It is not easy to dream up
built-in alarm: what is there left to something really new or innovative
impress us with? Not only satellite TV, something that draws a spontaneous
Design by T. Giesberts but also a radio-controlled vehicle on reaction of Fancy that or How do
S1 3V
1 R2
C5
220
T1
R4 100 10V D10
C6
100k
R1
C2 100n D9
* JP1
10k
D12
BF245A 3
3V 100 10V D8
BAT85 L10
10
1 9 11
3 7 MODE L9 D7
BT1 5 D13 R6 12
6 5 IC2 L8
A C1 B IC1 10k SIG
L7
13
2 C D6
BAT85 6 14
4 RHI L6
3V 150n 8 7 15
R3 R5 REFOUT L5 D5
16
L4
1k8
100k
22k
R7 LM3915
P1 TLC271 17
L3 D4
8 18
100k REFADJ L2
4 1
RLO L1 D3
MIC1
B
2
D11 C3 C4 D2
220 470n D1
25V
IC2
2 (C) Segment Semiconductors:
D1D10 = LED, 3 mm, high effi-
ciency
D11D13 = BAT85
T1 = BF254A
Integrated circuits:
IC1 = TLC271CP
980025-1 IC2 = LM3915N
(C) Segment
Miscellaneous:
JP1 = jumper
S1 = miniature on/off switch or
jumper (see text)
BT1 = 3 V lithium battery Type
CR2025 or CR2032 with holder for
C4 C1 C2 board mounting
T
P1
MIC1 = electret microphone, dia.
C3
R5
R2
R1
10 mm
D13 C5 BT1
C6
R4 R7 R6
0 PCB Order no. 980025-1 (see Read-
D12
D11
+ (C) Segment ers Services towards the end of
JP1 S1
D10
D1
CONSTRUCTION shown in Figure 3. A clip to enable the at the output of the op amp across
The design of the printed-circuit board board to be fastened to a lapel or sim- pins 4 and 5 of IC2 (without micro-
in Figure 2 is a compromise between ilar may be soldered or glued at the phone). If this is higher than 100 mV, it
small size and ease of construction. underside near the battery (if soldered, is advisable to replace IC1.
This has been accomplished by accom- take care not to cause a short-circuit). The sensitivity of the circuit with a
modating IC1 and IC2 on the track side There are, of course, other possibil- standard electret microphone and P1
of the board instead of as normal on ities of construction: for instance, the set to maximum is arranged to give a
the component side. Note that solder- LEDs may be clustered together away full display for a sound pressure input
ing these components requires a small from the board (which can then be level of 100 dB. Note that a sustained
soldering iron with a very fine tip. hidden in, say, a breast pocket). The input at this level is dangerous for
The circuit is powered by a 3 V two sections can then be linked by a your hearing. If the sensitivity is con-
lithium cell that is fitted on to the mini cable. Ingenious readers can, no sidered insufficient, it may be
board with the aid of a specially avail- doubt, think of different constructions. increased by giving R3 a value of
able holder. Note that the +ve termi- The LEDs specified have a small 1.5 k or even 1.2 k.
nal must point upward. outer edge. This edge must be filed or
The microphone is soldered cut away with a sharp knife to enable BATTERY
directly to the pins marked with an these diodes to be placed close The circuit draws a current of about
input arrow. together on the board. 6 mA with all LEDs out, about 12 mA
On/off switch S1 may be replaced Although problems are highly in the dot mode, and up to 22 mA
(as it is in the prototype) by a jumper, unlikely, the voltage level at three test with all LEDs on in the bar mode.
which is smaller than a switch. points is given in the circuit diagram Since a Type CR2025 battery has a
Note that D2D10 are all placed in to facilitate faultfinding. capacity of 120 mAh, and a CR2032
the same direction, but D1 the other Depending on the type of micro- one of 170 mAh, the trinket will con-
way around. phone used, it may be necessary to tinue to light even when the party
change the value of R1 to obtain a volt- lasts until the early hours certainly in
F I N A L LY age of 1 V at test point A. If this is the dot mode.
The completed prototype board is done, it is advisable to check the offset [980025]
FPROG2 FPROG2
use INTELligent algorithm
MCS-52 BASIC Language
STATEMENTS
Statement Function Example(s)
BAUD set baud rate for line printer port BAUD 1200
CALL CALL assembly language program CALL 900H
Quick Reference
Instruction Set 1
#
2/98
Instruction Set 3
DATASHEET
LET assign a variable or string a value (LET is optional) LET A=10
ONERR ONERR or GOTO line number ONERR 1000
generate an interrupt when TIME is equal to or greater than ONTIME,
ONTIME ONTIME 10, 1000
argument-line number is after comma
ONEX1 GOSUB to line number following ONEX1 when INT1 pin is pulled low ONEX1 1000
PRINT PRINT variables, strings or literals, P. is shorthand for PRINT PRINT A
PRINT# PRINT to software serial port PRINT# A
PHO. PRINT HEX mode with zero suppression PHO.A
PH1. PRINT HEX mode with no zero PH1.A
PHO.# PHO.# to line printer PHO.#A
2/98
PH1.# PH1.# to line printer PH1.#A
PUSH PUSH expression on argument stack PUSH 10,A
Instruction Set 4
80C32 BASIC Control Computer
Quick Reference
MCS-52 BASIC Language
LOG() natural log LOG(10)
EXP() e (2.7182818) to the x EXP(10)
SIN() returns the sine of argument SIN(3.14)
COS() returns the cosine of argument COS(0)
TAN() returns the tangent of argument TAN(.707)
ATN() returns the arctangent of argument ATN(1)
OPERATORS SPECIAL FUNCTION
Operator Function Example(s)
CBY() read program memory P.CBY(4000)
DBY() read/assign internal data memory DBY(99)=10
XBY() read/assign external data memory P.XBY(10)
GET read console P.GET
IE read/assign IE register IE=82H
IP read/assign IP register IP=0
PORT1 read/assign I/O port 1 (P1) PORT1=0FFH
PCON read/assign PCON register PCON=0
DATASHEET