EN199902

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

THE ELECTRONICS & COMPUTER MAGAZINE FEBRUARY 1999

£ 2.85

PC TOPICS :
digital audio formats
COM port analyser
printer port extension
microcontrollers’ survey

wave file player

hhigh-power
igh-power AAFF aamplifier
mplifier
uup
p ttoo 22000
000 W iinto
nto 4 oohm
hm
datalogger
datalogg er
for DMM
using the
the
100-MHz SX
controller
controller
To many c omputer users, async hronous serial c om-
munic ation will always remain something of a mys-
tery. Does the link work or not? Do all the peripherals
have the same settings, and does the right signal
arrive on the right pin? These questions are easily
answered by Com-Watc h® . The system c onsists of an
advanc ed DOS program and a simple passive
adaptor.

In c o -o p e ra tio n with CER Inte rna tio na l

COM -Wa t ch ®
p r o b le m sle u t h f o r se r ia l p o r t s

Althoug h the seria l p ort is one of the


most freq uently used c ommunic a tion
gateways in the modern PC, it also calls
up the la rg est numb er of q uestions.
Modem, mouse, graphic s tablet, digi-
tal photo c amera, personal organiser,
you mention it, a ll this eq uip ment is
d esig ned to exc ha ng e d a ta with the
PC b y wa y of the seria l p ort. The d iffi-
c ulty with this port is the ever-c hanging
numb er of c ontrol sig na ls emp loyed :
sometimes three, sometimes five, and
then again eight! This should not be a
problem, though, if only the transmitter
a nd the rec eiver use the sa me c om-
munic ation settings.
The p rob lem is a g g ra va ted b y the
fac t that there is a differenc e between
a DTE (d a ta termina l eq uip ment, for
example, a PC or a printer), and a DCE
(d a ta c ommunic a tion eq uip ment, for
exa mp le, a mod em). As a result, two
c omputers that have to c ommunic ate
with eac h other (i.e., two DTEs), have to
b e c onnec ted b y a d ifferent c a b le
tha n, sa y, a c omp uter (DTE) a nd a
modem (DCE).
Note, however, that there are still lots

System requirements
IBM PC XT, AT or better
MS-DOS 3.1 or later
Monoc hrome or c olour videoc ard
Minimum 256 kBytes memory free
Floppy disk drive (3.5 in.)
Min. two free serial ports
(If only one port is available, one-way data traf-
fic may be monitored)

Com-Watc h is a registered trademark of CER International b.v.

2 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


of p itfa lls even if the rig ht ha rd wa re
COM-Watch Adaptor
(wires and connectors) is used. There is,
for instanc e, the baud rate to take into
a Serial Serial
ac c ount, the number of data bits (7 or
Device #1 Device #2
8), the number of stop bits and the par-
ity c hec k.
Considering all these potential prob-
lems, it is surprising to see that so many
channel 1 channel 2
serial links work just fine.
The c omp lexity of the ma tter is evi-
d ent from the very fa c t tha t so ma ny
different systems have been developed COM-Watch
to a na lyse seria l c onnec tions, a nd Computer
resolve c onflic ts. COM-wa tc h is a sys-
tem d evelop ed b y CER interna tiona l
spec ific ally for this purpose. Using very
little hardware and a DOS program, all
traffic on an RS232 link may be sc ruti-
nised in great detail, allowing the user
to d etec t the c a use of the c ommuni-
c a tion c onflic t, a nd , of c ourse, elimi- Serial
Device
nate the sourc e of the problem.
CER Interna tiona l a nd Elektor Elec -
tronic s jointly offer the p rog ra m a t a
b
spec ial reduc ed pric e. The assoc iated
channel 1
hardware is simple to make, and you’ll
find it described further on in this article.

The approach COM-Watch


Computer
The b a sic op era tion of COM-Wa tc h is 990013 - 12
illustrated in Figure 1. In principle, there
are two ways of analysing a serial link:
Figure 1. Using COM-Wa tc h, d a ta tra ffic m a y b e a na lysed in two wa ys, p a ssively (a ) or
ac tively or passively. Com-Watc h sup-
a c tively (b ). The p a ssive a p p roa c h req uires a sp ec ia l a d a p tor.
ports both, so that the system can really
be c alled versatile.
The first a p p roa c h tha t c omes to c ommunic a tion p roc ess ma y b e still a p p a ra tus ma y b e viewed on Cha n-
mind is to observe the operation of an analysed with just one extra ac tion. nel 2 (loc al c hannel). The latter Chan-
existing link. This is shown in Figure 1a. In p a ssive mod e, a ll d a ta tra ffic is nel is only imp lemented in softwa re,
The method as shown employs passive monitored, but not affected in any way. and therefore does not require a phys-
analysis. Two apparatus c ommunic ate In true Sherloc k Holmes tradition, Com- ic al serial c ommunic ation port.
by means of a serial c onnec tion. Using Watc h tries to observe what is happen- On p a p er, the a p p roa c h used b y
a sp ec ia l a d a p tor (whic h will b e ing, and detect flaws without any of the Com-Wa tc h ma y look c omp lex. In
reverted to below), the link is ‘tapped’. ‘susp ec ts’ notic ing . On the d isp la y of practice, the process is self-evident. The
A PC running the COM-Watc h software the PC running the Com-Wa tc h p ro- internal c ontext-sensitive Help func tion
then a na lyses the d a ta tra ffic , a nd g ra m a p p ea rs a d eta iled a na lysis of makes working with the software muc h
a ttemp ts to ma ke sense of a ny errors the problem situation. easier.
tha t oc c ur. Note tha t the PC used for
fa ult a na lysis d oes not p a rta ke in the The active alternative A little hardware
d a ta tra ffic : it merely a c ts a s a n
onlooker, i.e., its role is passive. The PC If you are having problems in getting a To be able to analyse the c onnec tions
uses two seria l p orts (Cha nnel 1 a nd seria l p ort to work a t a ll, Com-Wa tc h sketc hed in Figure 2a, a spec ial adap-
Channel 2) to monitor the communica- offers an ac tive mode to help you sort tor c irc uit ha s b een d evelop ed . As
tion p roc ess: one for the d a ta tra ffic it all out. Figure 2b shows how it works. shown in Figure 2, this is a very simple
from DCE to DTE, a nd for DTE-to-DCE Via its seria l p ort the a na lysing c om- circuit. For do-it-yourself construction, a
tra ffic . Both c ha nnels ha ve their own p uter c ommunic a tes with the p erip h- sing le-sid ed p rinted c irc uit b oa rd is
c onnec tion on the interfac e board to eral, and so c ollec ts as muc h informa- available. Few of you will objec t to the
be desc ribed. tion a s p ossib le. The d isp la y shows one d isa d va nta g e of a sing le-sid ed
On the PC, seria l p orts COM1 whic h d a ta is sent b y the PC, a nd b oa rd : ha ving to fit a c oup le of wire
through COM4 may be used for Chan- which data is returned. The switching of links. The copper track layout and com-
nel 1 a nd Cha nnel 2. For ma ximum severa l c ontrol sig na ls is a lso ea sy to p onent mounting p la n of the PCB a re
func tiona lity, two p hysic a l p orts a re follow. This measurement method does g iven in Figure 3. Ac tua lly, ‘c omp o-
need ed . If only one p ort is a va ila b le, not require spec ific hardware. nents’ is limited to a few wire links and
then the channel to use for a particular Da ta rec eived b y the c omp uter is connectors that enable the serial link to
set of signals may be found in Table 1. d isp la yed b y the softwa re via Cha n- be ‘tapped’. So, we think you will agree
By c hanging over to another c onnec - nel 1 (remote c hannel), while that sent with us that this is a very simple c irc uit
tor on the interfa c e b oa rd , the entire b y the c omp uter to the p erip hera l indeed.

PC TOPICS——————————————— Elektor Elec tronic s EXTRA 3 - 2/99


Script language SET COMm = baud[,parity[,data,[,stop]]] COMm
COM-Wa tc h ha s a n extensive sc rip t la ng ua g e, whic h a llows Spec ifies the COM port, with m between 1 and 4.
almost any problem to be pinpointed, even if it oc c urs sporad- baud
ic a lly. This overview lists the c omma nd s a va ila b le for ma king Spec ifies the c ommunic ation speed; available values are 110,
sc ripts. Sc ript files intended for COM-Watc h have the extension 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600
.c ws. and 115200.
data
Syntax Spec ifies 7 or 8 databits
[ ] means optional stop
| means ‘or’ Spec ifies the number of stop bits.
drive: spec ifies disk station The default values are c opied from DOS.
path: spec ifies loc ation
filename:self-evident SET DISKSTREAMING on,[drive:][path]filename | off
string: a series of c harac ters enc losed in brac kets If no extension is given with the filename, the program c hooses
c ontrol: spec ifies the status of c ontrol signals the system has to the extension .c wd.
wait for. The following options are available:
SET FORMAT mnem | asc ii | hex | dec | oc t | ebc dic
CTS = on | off This c ommand c hanges the c urrent format into the selec ted for-
DSR = on | off mat.
RI = on | off
CD = on | off SET RINGBUFFER on | off
BRK = on | off Switc h the ring buffer on or off.
FE = on | off
PE = on | off SET SENDDELAY millisec onds
OE = on | off This is used to set the length of the pause between c onsec utive
c harac ters in the transmission of data. The available range is 0
Description of script commands to 100 ms. The default is no delay.
CAPTURE = on | off
Determines whether or not data from connected equipment has SET TIMESTAMPING abs | rel | date | off
to be stored in a buffer, for later analysis. This command is used to select the operation of the time stamp-
ing system.
CHDIR [drive:]path
Change c urrent direc tory SET VIEW split | mixed | c hannel 1 | c hannel 2 | event | ac tive
This c ommand is used to set the c urrent display mode.
EXIT [PROGRAM]
Lea ve the sc rip t p rog ra m a nd return to a na lysis mod e. If the WAIT COUNT_EVENTS number
p a ra meter PROGRAM is a d d ed , the p rog ra m returns to DOS Determines how many events must have oc c urred before exe-
mode. c ution of the sc ript is c ontinued. Maximum value: 1000.

GOTO label WAIT DATA_EVENT [CHANn] string [c ontrol]


Only the first 8 characters of a label are used to distinguish it from Interrup ts the exec ution of a sc rip t until the sta ted d a ta ha ve
other labels. Up to 100 labels may be used in a sc ript. been rec eived.

KEYBOARD on | off [CHANn]


Switc h the keyboard on or off. This allows you to simulate a ter- This may be used to optionally define the c hannel. If no c han-
minal. nel number is indic ated, both c hannels are monitored.
string
MATCHCASE on | off Spec ifies the string to wait for.
Determine if the sc rip t la ng ua g e is c a se sensitive or not. The c ontrol
default is MATCHCASE off. Spec ifies the status of the c ontrol signals to wait for.

SEND string WAIT DELAY hundredths_of_sec onds


Transmit a text line to the c onnec ted peripheral, for example, a Exec ution of the sc ript is halted and resumed after the spec ified
modem initialization string. delay.

SEND FILE [drive:][path]filename WAIT KEYSTROKE string


Transmit the indic ated file to the peripheral. Exec ution of the sc ript is halted and not resumed until the spec -
ified text has been entered via the keyboard.
SET CHANn = COMm | off
Selec t a c ommunic ation port. For parameters n and m the val- WAIT TIME_EVENT [month-day-year] hours:minutes:sec onds
ues 1 throug h 4 a re a va ila b le. A COM-Wa tc h c ha nnel is This sp ec ifies the d a te a nd time when sc rip t exec ution is to
switc hed off with off. resume. Month, day and year are optional.

SET CHANn IDENT = string WHEN DATA_EVENT [Chann] string [c ontrol] [,c ommand]
Defines a n id entific a tion string for a c ha nnel. Pa ra meter n is Ind ic a tes whic h a c tion ha s to b e ta ken if a sp ec ific situa tion
either 1 or 2. Only the first 10 c harac ters of a string are used by arises.
the program.
The default identifiers are CHANn
CHAN1 IDENT = Channel # 1 This c ommand allows you to optionally spec ify the c hannel. If
CHAN2 IDENT = Channel # 2 no number is supplied, both c hannels are monitored.

4 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


string month
This spec ifies the text to wait for. Spec ifies the month; valid numbers are 1 through 12.
c ontrol day
Sp ec ifies the sta tus of the c ontrol sig na ls to wa it for. This is a n Spec ifies the day; valid numbers are 1 through 31.
optional addition. year
c ommand Spec ifies the year; valid numbers are 1980 through 2099.
Defines the ac tion to be taken if a c ondition is satisfied. hours:minutes;sec onds
Spec ifies the exac t time at whic h the sc ript is to be exec uted.
WHEN KEYSTROKE string[,c ommand] hours
This command specifies the action to be taken after a string has Spec ifies hours, valid numbers are 0 through 23.
been entered. minutes
string Spec ifies minutes, valid numbers are 0 through 59.
Spec ifies the text to wait for. sec onds
c ommand Spec ifies minutes, valid numbers are 0 through 59.
Spec ifies the ac tion to be taken when the c ondition is satisfied. Command
This is the c ommand to be exec uted when the indic ated date
WHEN TIME_EVENT [month-day-year] hours:minutes;sec onds and time are reac hed. If no c ommand is entered, COM-Watc h
[,c ommand] will switc h off the previously defined WHEN DATA_EVENT with the
This c ommand spec ifies the ac tion undertaken when a c ertain same string.
time is reac hed.

The c omp onent mounting p la n in


a
Figure 2a shows the loc a tions of the
wire links if the interface is employed for K1 DTE DCE K2
analysing regular serial links (RS232). If 1 1
you req uire sup p ort for a symmetric a l 14 14
serial bus like RS422, another c onfigu- 2 TxD TxD 2

ration is in order. The relevant ‘c onstel- 15 15


3 RxD RxD 3
la tion’ of the wire links is shown in Fig-
16 16
ure 2b. D25 and D9 c onnec tors are fit- 4 RTS RTS 4
ted at both sides of the PCB. If you do 17 17

not envisage ever needing one of the 5 CTS CTS 5


18 18
two, then simply omit the relevant c on-
6 DSR DSR 6
nec tors. If you only use the 9-p in ver- 19 19
sion, the b oa rd ma y b e ma d e muc h 7 GND GND 7
smaller by omitting the 25-pin c onnec - 20 DTR DTR 20

tors. 8 DCD DCD 8


21 21
The link to the PC (c arrying the infor- 9 9
ma tion emp loyed for Cha nnel 1), is 22 RI RI 22
made using two 9-way (male) c onnec - 10 10

tors. 23 23
11 11
24 24
The software 12 12
25 25
COM-Wa tc h is a p rog ra m whic h runs 13 13

und er the DOS op era ting system. It is


suita b le for a na lysis of d a ta tra ffic
b etween a DTE a nd DCE. Fortuna tely, K3 DTE DCE K4

the fac t that the DOS environment has 1 DCD DCD 1

been c hosen for the program does not 6 DSR DSR 6


2 RxD RxD 2
p rec lud e its use und er the Wind ows
7 RTS RTS 7
operating system. When the program is 3 TxD TxD 3
sta rted , it simp ly c la ims the entire 8 CTS CTS 8

sc reen, temporarily hiding Windows. 4 DTR DTR 4


9 RI RI 9
Insta ll the softwa re on d rive C: in a
5 GND GND 5
d irec tory c a lled ComWa tc h. If you
want to use another drive, say, D:, then
GND

GND
DSR
RxD

CTS

DCD
DSR
RxD

CTS

RI

type
1 6 2 7 3 8 4 9 5 1 6 2 7 3 8 4 9 5
K5 K6
a: i ns t al l d:
DTE > DCE DCE > DTE 990013 - 13
Any other drive number may be used,
provided it exists.
After entering
Figure 2a. Circ uit d ia gra m of the a d a p tor used for m ea surem ents in p a ssive m od e
[drive][path] Comwat c h. ex e (RS232 version).

PC TOPICS——————————————— Elektor Elec tronic s EXTRA 5 - 2/99


K1 DTE DCE K2
b
1 GND GND 1
14 TxD– TxD– 14
2 TxD+ TxD+ 2
15 15
3 RxD+ RxD+ 3
16 RxD– RxD– 16
4 RTS+ RTS+ 4
17 17
5 CTS+ CTS+ 5
18 18
6 6
19 RTS– RTS– 19
7 7
20 20
8 8
21 21
9 9
22 22
10 10
23 23
11 11
24 24
12 12
25 25
13 CTS– CTS– 13

K3 DTE DCE K4

1 TxD– TxD– 1
6 RTS– RTS– 6 the program starts in full-sc reen mode.
2 TxD+ TxD+ 2
If the ha rd wa re ha s b een c onnec ted
7 RTS+ RTS+ 7
3 RxD+ RxD+ 3
up, the measurement session may start.
8 CTS+ CTS+ 8 The sc reen shows quite a few things.
4 RxD– RxD– 4 Fortunately an interac tive and c ontext-
9 CTS– CTS– 9
sensitive Help func tion is available, so
5 GND GND 5
tha t everything will soon b e c lea r.
Table 2 shows the functions assigned to
RxD+
CTS+
RxD–
CTS–

RxD+
CTS+
RxD–
CTS–
GND

GND

various keys.
1 6 2 7 3 8 4 9 5 1 6 2 7 3 8 4 9 5
After connecting the hardware to the
K5 K6
PC, you first have to c onfigure the soft-
wa re. As you c a n see from the ta b le,
DTE > DCE DCE > DTE 990013 - 11
this is done with the aid of function keys
F5 and F6. Once you have entered the
Figure 2b. Circ uit d ia gra m of the a d a p tor used for m ea surem ents in p a ssive m od e
right data, the program is ready for use.
(RS422 version).

Table 1. Signal allocation on 25-pin and 9-pin RS232 connection. Table 2. COM-Watch function keys
D-25 D9 description monitored DTE-DCE FKey Normal + Ctrl
1 sc reening F1 Help Go to position
2 3 transmitted data TxD yes (# 1) DTE →
3 2 rec eived data RxD yes (# 2) ← DCE F2 Save as… Go to Time loc ation
4 7 request to send RTS yes (# 1) DTE → F3 Open … Find…
5 8 c lear to send CTS yes (# 2) ← DCE
6 6 data set ready DSR yes (# 2) ← DCE F4 Calc ulation View/Ac tivity
7 5 massa S.GND -
8 1 data c arrier detec t DCD yes (# 2) ← DCE F5 Settings View/
9 reserved
10 reserved Channel 1 Channel 1
11 free F6 Settings View/
12 data c arrier detec t c h. 2 no ← DCE
13 c lear to send c h. 2 no ← DCE Channel 2 Channel 2
14 transmitted data c h. 2 no DTE →
15 transmitted sign. elem. timing no DTE → F7 View View/Split
16 rec eived data c h. 2 no ← DCE
17 rec eived sig. elem. timing no ← DCE F8 Format Format/
18 free Mnemonic
19 request to send c h. 2 no DTE →
20 4 data term. ready DTR yes (# 1) DTE → F9 Capture Set Start
21 free
22 9 ring indic ator RI yes (# 2) ← DTE Mode marker to
23 data rate selec t no DTE →
24 transm. sign. elem. timing no DTYE → Current position
25 F10 Analyse mode Set End marker
Note: to c urrent
signals proc essed via 1st COM port (# 1) DTE → DCE
signals proc essed via 2nd COM port (# 2) DTE ← DCE position

6 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


990013-1
(C) ELEKTOR

H5

K4
K2

K6
Fina lly we should mention tha t a
more extensive version of the program
H4

ROTKELE )C(
1-310099

is available. More information may be


found on the CER Internet web site a t
www.c er.c om.
(990013-1) H7
H6
990013-1

com232 Version

noisreV 232moc
H3

The PCB is available ready-made from


the Publishers as order number
990013-1.
The COM-Watc h program is available
K3

K5
K1

on floppy disk (DOS) as order number


H2

986035-1.

+ Alt + Shift H5
K4
K2

K6

Go to top Go to Start marker


Go to Bottom Go to End marker
Next matc h Next error
Previous matc h Previous error
H4

ROTKELE )C(
1-310099

Com poort Baudrate


Channel 1 Channel 1 noisreV 224mmoc
comm422 Version
Com port Baudrate H7
H6
990013-1

Channel 2 Channel 2
View/Mixed View/Events
H3

Format/ASCII Format/
Hexadec imal
Set Start Set Start
K3

K5
K1

marker to marker to
H2

Top position Entered position


Set End marker Set End marker
to bottom to entered
Figure 3. Cop p er tra c k la yout a nd c om p onent m ounting p la n of the a d a p tor b oa rd
position position
used for the p a ssive m onitoring system . Figure 4a is for the RS232 version, Figure 4b for
the RS422 version.

PC TOPICS——————————————— Elektor Elec tronic s EXTRA 7 - 2/99


Over the past few years the c omputer has c hanged
from a word/graphic s proc essor to an all-round unit
that, among others, is suitable for rec ording and
reproduc ing audio and video signals. Partic ularly as
regards audio reproduc tion, a number of different
formats have c ome into being. This artic le desc ribes
the more important of these briefly and the c urrently
popular MP3 in some detail.

By o ur Ed ito ria l Sta ff

d ig it a l a u d io f o r m a t s
m o r e s o u n d s f r o m y o u r co m p u t e r

zation. The rate at whic h the c onver-


sion takes plac e in the c ase of a CD is
44100 times per sec ond for the left-
hand c hannel and the same number
of times for the right-hand c hannel.
Sinc e the resolution of a CD is
16 bits, the quantization of an audio
signal results in a bit stream of about
1.4 Mbit/s. This bit stream, together with
additional data for error c orrec tion
and other information, is rec orded on
the d isc . During p la yb a c k, the
proc ess is simply reversed: the
data on the CD are read by a
laser and translated by a dig-
ita l-to-a na log ue c onverter
(DAC) into analogue sig-
nals.
Aud io sig na ls in a
c omputer are proc essed in a
similar manner. The requisite elec tron-
p o s- ic s for the ADC and DAC is c ontained
sible applic a- on the sound c ard, while the hard disc
tions, and the diversity of norma lly func tions a s the stora g e
types of c omputer that have c ome medium. In a c omputer, the bit stream
about in the past ten years or so, a is written into a data file.
multitude of file formats for storing the The storing of the b ina ry word s
audio signals have ensued. requires a large amount of spac e:
about 1 Mbyte for every six sec onds of
quantization sound of CD quality. There are several
introduction means of limiting this spac e require-
Today, a c omputer without sound is a Thanks to the introduc tion of the c om- ment. One is lowering the sampling
rarity. Whether it c onc erns a sophisti- pac t disc (CD) almost 20 years ago, frequenc y from 44.1 kHz to, say, 10 kHz
c ated c omputer game or the simple many people know what is understood whic h reduc es the bandwidth. An-
warning bleep ac c ompanying various by digital sound. Briefly, for those who other is rec ord ing the sig na l in
c ommands, sound is a must. Sound do not, the analogue (proportional) mono(p honic ) instea d of in stereo
ha s b ec ome imp orta nt even for audio signal is translated by an ana- (phonic ) format, whic h degrades the
Internet users. Nowadays, you c an lis- logue-to digital c onverter (ADC) to a quality. A third is lowering the resolution
ten to radio broadc asts or download large number of binary words. This from 16 bits to, say, 8 bits, whic h tends
music via the net. Owing to all these proc ess is c alled quantization or digiti- to degrade the signal-to-noise ratio

8 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


and inc rease the distortion. A fourth, Table 1.
widely used, method is c ompressing Overview of the most frequently encountered audio formats
the sig na l d uring rec ord ing a nd
expanding it during playbac k.
Almost all c omputer systems (Atari, AIF A format originally developed for the Macintosh. It is quite popular on the
Unix, Intel, and so on) have their own Internet and offers many different sampling rates and resolutions. Netscape
spec ific file format, whic h has resulted and Microsoft browsers have no difficulty working with it.
in the same c onfused situation as AU Originates from NeXT and SUN and was popular on the web and is still in use
exists in the c ase of pixel formats. That today. There are a number of variants, but normally the data are compressed
is to say, there is a bewildering multi- to an 8-bit format with the u-law standard. Most browsers can work with it.
plic ity of formats, whic h does not help
ES A streaming audio format from EchoCast. Players are available for Windows
the c onsumer. This situa tion is not
improved by the addition of yet more and Macintosh.
formats via the Internet. IFF An Amiga sound format that handles only 8-bit mono sound; it allows a free
Table 1 gives an overview of the choice of the sampling rate.
most frequently enc ountered formats LCC A high-compression format (ratios up 1:50 are possible) currently available
together with a brief desc ription. for Windows only, but other versions are under development.
MID The MIDI format is not a true audio format, but a standard for exchanging
to compress control data between electronic musical instruments. Browsers can handle
or not to compress MIDI via a plug-in.
Compressing an audio file is fairly MOD An original Amiga format that is reminiscent of MIDI. An MOD file contains a
c omplex bec ause c ertain similarities bank with samples and instructions how these samples are to be played.
between the large number of samples Requires a MOD plug-in.
a re not ea sily d etermined . MP3 The most popular current audio format. Various plug-ins are available.
Consequently, there are only a few RA, RAM, RPM A popular streaming audio format on the Internet from RealAu-
lossless c omp ression method s for dio. Plug-ins are available for virtually all platforms.
audio signals. One of these is the
SND Apple, Amiga and Tandy have used this suffix for sound files. Some variants
ADPCM standard (in Windows) for the
popular WAV format. are compatible with the AU format.
It is, however, possible to c ompress STR A format for professional sound processing on the Macintosh.
audio signals if some loss of detail is VDO Another streaming audio format. It requires a plug-in as such as a VDO live
ac c eptable, as in the proc essing of player.
digital images. In the c ase of digital VMD A streaming audio format named Internet Wave. It comes with a free
images, the c ompression method is encoder/decoder for Windows.
laid down by the Joint Photographic
VOC The Voice format, which is a development of Creative Labs, maker of the well-
Expert Group (JPEG), a subgroup of the
Joint Tec hnic al Committee 1 (JCT1) of known Soundblaster cards.
the ISO (Interna tiona l Sta nd a rd s WAV The much used wave format has become well known since the introduction
Organization – c onsultant to the United of Windows. It offers many different sampling rates, resolutions and com-
Nations) and the IEC (International pression factors.
Elec trotec hnic al Commission). Another XDM An MPEG format from StreamWorks for streaming audio. There is a special
sub-group of the JCT1, the Motion player for Windows.
Pic tures Expert Group or MPEG, has
laid down a standard for audio c om-
pression: the MPEG format. Currently, MP3: good quality restrial digital audio broadc asting sys-
MPEG-1 Layer 3 (MP3) is the popular with high compression tem – DAB), the German Fraunhofer
format for Internet users. Currently, MP3 is the most popular of Institut für Integ rierte Sc ha ltung en
all audio formats. In a very short time, (Fra unhofer Institute for Integ ra ted
real time audio this audio c ompression protoc ol has Circ uits) ha s d evelop ed a c od ec
gained a strong position as music (c oder/dec oder) for DAB in whic h the
In the early days of audio in c omput- c ompressor. Many modern c omputers perc eption of the listener plays an
ers, the entire audio file had to be c ome with MP3 enc oding and dec od- important role.
loaded into the c omputer memory ing software installed. Also, large num- The relevant algorithm takes into
before it c ould be played bac k. This is bers of MP3 files are being disseminat- ac c ount c ertain properties of human
partic ularly irksome during download- ed via the Internet and there are hearing and on this basis determines
ing of files via the Internet. already c ompilation CDs that c ontain whether a c ertain aspec t of the sound
With the advent of fast modems it MP3 files. Some manufac turers have in a piec e of music is likely to be per-
has bec ome possible for tec hniques to started to make available an MP3 c eived b y the listener or not.
be developed that enable sound files Walkman™: a solid-state portable CD Depending on this likelihood, it further
to be played bac k during the down- player whic h uses a flash memory as determines whether the relevant data
loading. A partic ularly worthwhile c on- c arrier. should be inc luded in the bit stream or
tribution to this has been made by a not. This results in a redundanc y c om-
p roc ess c a lled ‘AOD’ (Aud io On developed for DAB pression system that enables a sub-
Demand), ‘real time audio’ or ‘stream- sta ntia l d a ta red uc tion without
ing audio’, a produc t of the c ompany As a c ontributor to the pan-European degrading the sound
RealAudio. Eureka 147 projec t (to develop a ter- The a lg orithm ha s b een further

PC TOPICS——————————————— Elektor Elec tronic s EXTRA 9 - 2/99


show that the performanc e of Layer 3
remains exc ellent with a c ompression
ratio of 1:12 – whic h is assoc iated with
a bit stream of 64 kbit/s per audio
c hannel. If for c ertain applic ations the
bandwidth c an be limited to 10 kHz,
good stereo reproduc tion is possible
with a c ompression ratio of 1:24.

uniform structure
subband 0
All three layers have the same struc -
ture. Their enc od ing tec hniq ue is
known as perc eptual noise shaping or
subband 1 perc eptual subband transform c od-
ing. The enc oder analyses the spec tral
c omponents of an audio signal with
the aid of a filter bank (see Figure 1)
subband 2 and uses a psyc hoac oustic model to
Polyphase determine the disc ernible noise levels.
Subsequently, the information is quan-
Filter tized and enc oded in a manner whic h
ensures that two important c onditions
Bank subband 3
are taken into ac c ount: the maximum
bit stream and the masking effec t.
All three layers use the same filter
subband 4 bank with 32 subbands. They all permit
sampling rates of 32 kHz, 44.1 kHz,
...........

and 48 kHz, and are c apable of work-


ing with bit streams of 32 kbit/s or high-
er.
subband 31
background
992001 - 11

To ac hieve a substantial reduc tion of


the req uisite d ig ita l b a nd wid th,
Figure 1. Ea c h MPEG-1 la yer m a kes use of a 32-b it filter b a nk. Whether the signa l
MPEG-1 Layer 3 uses several tec h-
b ec om es m a sked or not is d eterm ined a fter it ha s b een q ua ntized.
niques and short-c uts. The most impor-
tant of these are:
enhanc ed by IIS in c ooperation with CD quality. Table 2 gives an overview
the University of Erlangen and has of the c harac teristic s of these layers. • lower threshold of hearing
b een a c c ep ted a s ISO MPEG-1 The definitions within the norm refer • masking effec t
Layer-3 (IS11172-3 and IS13818-3). only to the enc oder and the data for- • a store of bytes
mat used. This information enables • joint stereo
layer 1, 2 or 3 manufac turers to design a dec oder to • Huffman c oding
their own requirements.
Without data reduc tion, audio signals If stereophonic reproduc tion is not Lower threshold of hearing
c ontain 8-bit or 16-bit wide samples used, and if furthermore a restric ted Researc h has shown that the lower
whic h are taken at a rate that is twic e bandwidth is ac c eptable, even higher threshold of human hearing is not lin-
as high as the highest frequenc y in c ompression ratios c an be used. The ear: it peaks between 2 kHz and 5 kHz.
these signals. highest of these, Layer 3, uses the low- Its p rop erties a re d esc rib ed b y
It has already been stated that the est bit rate and produc es the best Fletc her and Munson. It is not nec es-
digitization of an audio signal results in sound quality. sary to enc ode sound that lies below
a bit stream of about 1.4 Mbit/s. A The three c odec s are hierarc hic ally the threshold sinc e the listener c annot
sta te-of-the-a rt c omp ression system c omp a tib le, whic h mea ns tha t a hear it.
c an c ompress this by a ratio of 1:12 dec oder for Layer 3 c an also be used
without an audible degradation of the with Layers 1 and 2. This is, however, Masking effec t
sound. Reduc tion ratios of up to 1:24 not possible the other way around. Use is made of the fac t that human
are possible and still result in a sound The higher the number of the layer, hea ring d oes not p erc eive wea k
quality that is superior to that when the the more c omp lex the enc od er sounds that are totally or partially
sampling rate or the resolution are bec omes and the higher the c ompres- masked by (muc h) stronger ones.
red uc ed to ob ta in a c omp a ra b le sion ratio that c an be used. Researc h shows that owing to the
c ompression. Table 2 also shows the possible masking c ertain sounds need not be
The MPEG-1 sta nd a rd d esc rib es c omp ression ra tios a tta ina b le with enc oded, whic h saves quite a lot of
three layers of c ompression: Layer 1, Layer 3 and what these c an be used spac e. All MPEG-1 Layer 3 enc oders
Layer 2, and Layer 3. All three are for. therefore c ontain a psyc hoac oustic
c apable of produc ing sound of near- Listening tests with mixed audienc es mod el in whic h the p rop erties of

10 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


human hearing are inc orporated. Table 2. The modes of MPEG-1 audio
Store of bytes
It often happens that a passage of Compression factor method comments
music c annot be enc oded with the
available bit rate. The quality of the 1:4 via Layer 1 stereo signal results in a bit stream of
sound must then be adapted tem- 384 kbit/s
porarily to enable the bit stream to
1:6 – 1:8 via Layer 2 stereo signal results in a bit stream of
matc h the c apac ity of the digital
c hannel. MPEG-1 Layer 3 uses a buffer 256–192 kbit/s
that provides some additional c apac - 1:10 – 1:12 via Layer 3 stereo signal results in a bit stream of
ity in suc h c irc umstanc es. The buffer is 128–112 kbit/s
emptied when sound is enc oded at a
bit rate lower than that available in the
c hannel.

Joint stereo
Many small stereo hi-fi systems use a
c ommon woofer. In spite of this, the lis-
tener gets the impression that the
sound does not emanate from this
loudspeaker, but rather from the satel-
lites. Researc h shows that below a c er-
tain frequenc y the human ear is not
able to judge from whic h direc tion the
sound c omes. Comp ression tec h-
niques c an make use of this property
by not inc luding stereo information
below a c ertain frequenc y. This means
that below that frequenc y the signal is
enc oded in monophonic form only.

Huffman c ode
The enc oding of MPEG-1 Layer 3 uses
a c lassic al tec hnique: the Huffman
c ode. This is used after the ac tual data
c omp ression ha s ta ken p la c e to
enc ode the digital information. It is,
therefore, not a c ompression system
There is m uc h inform a tion a nd m a ny links a t www.m p eg.org.
but a very effic ient enc oding tec h-
nique. The Huffman algorithm gener-
ates a c ode of variable length and a
whole number of bits. Important sig-
nals are alloc ated a short c ode, less
signific ant ones, a longer c ode.
Sinc e Huffman c odes have a spec if- Table 3. Facilities available with MPEG-1 Layer 3
ic header, they c an be dec oded per-
fec tly in spite of the variable length.
Sound quality Bandwidth (kHz) Mode Bit rate (kbit/s)
Dec oding is very fast sinc e use c an be
Compression factor
made of a table. The tec hnique gives
a spac e saving of some 20 per c ent.
The Huffman tec hnique is an ideal Telephone 2.5 mono 8
c omp lement to the p erc ep tion- 1:96
dependent c ompression. In passages
Better than shortwave 4.5 mono 16
c ontaining many frequenc ies simulta-
neously, the p erc ep tion-d ep end ent 1:48
enc oding provides an apprec iable Better then medium wave 7.5 mono 32
reduc tion by eliminating masked sig- 1:24
nals. Sinc e few identic al signals oc c ur,
the Huffman c ode has little effec t. FM radio 11 stereo 56–64
During passages with few different 1:24 – 1:26
sound s, not ma ny ma sking effec ts
Near-CD 15 stereo 96
oc c ur. This is when the Huffman c ode
saves c onsiderable spac e sinc e there 1:16
is muc h redundant information, Suc h CD > 15 stereo 112–128
passages c an, therefore, be repre- 1:12 – 1:14
sented by short c odes. [992001]

PC TOPICS —————————————— Elektor Elec tronic s EXTRA 11 - 2/99


With a modest number of c omponents, the standard
PC printer port c an be transformed into an I/O system
with up to 256 I/O lines. This artic le c ompletely
desc ribes both the hardware and the nec essary
BASIC software. The hardware c an also easily be
c ontrolled using other programming languages.

Desig n b y V. Him p e

p r in t e r p o r t e x t e n sio n
u p t o 2 5 6 I / O lin e s o n a st a n d a r d p r in t e r p o r t

It c an hardly be said often enough


that the PC was primarily developed to
U2a meet the needs of the offic e environ-
1 RA1 9x 47k
5V 5V 1 2 ment. This basic ally means that in the
U2 = 74LS04 1
5V
14 14
U3 = 74LS05
overall design, a lot of attention has
U2 U3
3 4
been given to c onnec ting standard
7 7 2 3 4 5 6 7 8 9 10 1
STROBE peripheral equipment, suc h as printers
U2b and modems. Analogue and/or digital
U2c U3c
K1
inputs and outputs, whic h would be
5 6 5 6 5V
1
1 1 useful to the user who wants to perform
K3
14 16 c ontrol tasks, are thus simply not pre-
U2d U3d
2
9 8 9 8
15 sent in a standard PC c onfiguration.
15 1 1 STR 14 The c irc uit that is presented here, or
3 STR 13
U2e U3e
better said the c omplete system, was
16 D2 12
4 11 10 11 10 D3 11
orig ina lly na med ‘Pa ra p ort’ b y its
1 1
17 D0 10 developer, sinc e it is an I/O extension
5
U2f U3f
D1 9 for the parallel port. It provides a large
18 8
13 12 13 12 number of digital I/O lines for a normal
6 1 1 7
19 A2 6
PC at a modest c ost. If you dec ide on
7 A3 5 the ma ximum c onfig ura tion, this
20 A0 4 amounts to 256 lines. Although it might
8 A1 3 seem natural to arrange these as 128
21 2
inputs and 128 outputs, you are free to
9 1
22
divide the lines between inputs and
10 outputs as you desire.
23 U3a The inputs work with TTL levels, while
R1
11 2 1
1 100k 5V the outputs have buffers with open-
24
12
c ollec tor outputs, so that they c an
U1
25 direc tly switc h relatively heavy loads.
7805 5V
13 K2 Thanks to the modular nature of the
design, you c an build exac tly the
U3b +12V
D25 5V
3 4
C4 C1 C2 C3 amount of hardware that is needed to
1 satisfy your spec ific needs. There is
GND 100µ 100n 100n 47µ
25V 10V thus no need for any unnec essary
990025 - 11 investment, and the hardware c an be
kept as c ompac t as possible.
Figure 1. The sc hem a tic d ia gra m of the b us unit, whic h is the hea rt of the I/O system .
Design approach
As already mentioned, this project is
based on a modular design. There are

12 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


8x 47k 1
5V

5V 10
2 3 4 5 6 7 8 9
1 +VS 18
I0 O0
24 2 17
I1 O1
21 3 16 K5
P53 I2 O2
22 4 15 1
P52 I3 O3
23 5 U5 14 2
P51 I4 O4
P50
1 6
I5 ULN O5
13 3
5V 7 2803 12 4
U4 I6 O6
11 2
P20 P40 8 11 5
10 3 I7 O7
P21 P41 VEE 6
K4 9 4
16 P22 P42 9 7
8 8243- 5
15 P23 P43 8
14 STR
MCS48 20
P60 9
13 STR 7 19 10
PROG P61
12 D2 6 18 10
CS P62 11
11 D3 17 1 +VS 18 12
P63 I0 O0
10 D0 2 17 13
16 I1 O1
9 D1 P73 3 16 14
15 I2 O2
8 P72 4 15 15
14 I3 O3
7 P71 5 U6 14 16
13 I4 O4
6 A2 P70 6 ULN 13 17
I5 O5
5 A3 7
2803 12 18
12 I6 O6
4 A0 8 11 19
I7 O7
3 A1 VEE 20
9 8 7 6 5 4 3 2
2 9
2
1 0 COMP
4
6 1 ULN2803
5V
8 RA3 8x 47k
P IN 0 1 18 OUT 0
11
13 IN 1 2 17 OUT 1
15
U7
5V IN 2 3 16 OUT 2
17
7 19
1P=Q IN 3 4 15 OUT 3
3
0
5 IN 4 5 14 OUT 4
20 C5
S1
7
1 2 6 5 U7 IN 5 6 13 OUT 5
74LS688
9
10 47µ
12 Q 10V IN 6 7 12 OUT 6

14 IN 7 8 11 OUT 7
16 1
8 7 3 4 G1 VEE 9 10 +VS
18
7

990025 - 12

Figure 2. Up to 16 of the I/O units shown here c a n b e c onnec ted to the b us unit.

two types of units: an interface to the


printer port (the bus unit) and the actual
I/O unit. Each I/O unit provides eight TTL-
compatible inputs and 8 buffered out-
puts. Up to 16 I/O units can be connect-
ed to the bus unit. In the maximum con-
figuration, a total of 17 circuit boards
are thus connected to the printer port.

The hardware
Figure 1 shows the design of the bus
unit. This c irc uit c ontains a number of
inverters that adequately buffer the
printer port signals. Sinc e the standard
printer port is intended to func tion pri-
marily as an output port, rec ourse is
made to several c ontrol lines of the
port for input data. The data lines D0
through D3 from the PC are used for
data output, and the c ontrol lines
Ac knowledge, Busy, Paper Empty and
Selec t are used for data input. The
remaining four outputs (D4 through D7)
are used to address the sixteen I/O
modules. Finally, the Strobe signal has Figure 3. The interna l struc ture of the 82C43, a c ontroller with five 4-b it p orts.

PC TOPICS —————————————— Elektor Elec tronic s EXTRA 13 - 2/99


Figure 4. The c op p er-tra c k la yout a nd c om p onent overla y for the b us unit c a rd, a s m a d e b y the a uthor.

COMPONENTS LIST a lso b een a ssig ned a func tion. It


bus-unit ensures that the I/O system reads the
data on the D0 through D3 lines at the
Resistors: proper time; these lines are used for
R1 = 47kΩ COMPONENTS LIST
both data and c ommands. Only one
RA1 = SIL array 9 x 47 kΩ I/O-unit (up to 16 off)
suc h bus unit per printer port is need-
Capacitors: ed for this projec t. Resistors:
C1,C2 = 100nF RA1,RA2 = SIL array 8 x 47kΩ
C3 = 100µF 25V Modular design U5,U6 = DIL array 8x330Ω *
C4 = 47µF 25V
The I/O units are c onnec ted to the bus Capacitors:
Semiconductors: unit. Figure 2 shows the design of a C5 = 10µF 25V
U1 = 7805 single I/O unit. The heart of this unit is
U2 = 74LS04 Semiconductors:
an 82C43 IC, whic h is a port expander
U3 = 74LS05 U4 = 82C43 or 8243 (Intel)
c hip that was spec ific ally developed
U5,U6 = ULN2803*
Miscellaneous: by Intel to expand the I/O c apabilities U7 = 74LS688
K1 = 25-pin angled sub-D connector, of its 8048 proc essor (the predec essor
male, PCB mount of the 8041/51 proc essors). For those of Miscellaneous:
K2 = 2-way PCB terminal block you that are not familiar with the oper- K4 = 16-pin boxheader, angled, with
K3 = 16-pin boxheader, angled, with ation of the 82C43, a short explana- eject levers
eject levers K5 = 20- pin boxheader, angled, with
tion is in order. The IC is supplied in a
eject levers
24-pin pac kage and c ontains five 4-
SW1 = 4-way DIL switch
bit bi-direc tional ports (labelled P2, P4,
P5, P6 and P7) and two c ontrol inputs
(PROG and CS). Figure 3 shows the * see text
internal organization of the 82C43. The

Figure 5. The c op p er-tra c k la yout a nd c om p onent overla y for the I/O unit.

14 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


port numbering may seem to be a bit ‘ REM PARAPORT pr ogr ammi ng ex ampl e
strange, but this is due to the fac t that ‘ Wr i t t en by Vi nc ent Hi mpe
this IC was intended to be used in
‘ pr i nt er por t i ni t i al i s at i on
c ombination with an 8048 mic roc on- ‘ LPT1= &h378 &h379 &h37A
troller, whic h already has several ports ‘ LPT2= &h278 &h279 &h27A
of its own. ‘ PRN = &h3BC &h3BD &h3BE
One of the 4-bit ports (P2) is used for
c ommunic ation with the printer port, ‘ c ont r ol l er i ns t r uc t i on s et
and is thus c onnec ted direc tly to the ‘ r ead = 0
‘ wr i t e = 4
printer output lines D0 through D3. This
‘ Wr i t e_or = 8
leaves 16 lines free for I/O func tions. ‘ Wr i t e_and = 12
The Strobe signal from the printer port
is c onnec ted direc tly to the PROG ‘ por t s number ed 0 t hr ough 3 :
input of the 82C43, and thus c ontrols ‘ t hi s c or r es ponds t o c hi p por t s
d a ta inp ut. The rema ining c ontrol ‘ 4 t hr ough 7 ( pi n names )
input of the 82C43 (CS) is c onnec ted
to an address dec oder based on a
‘ * * * * * * * * * * * i ni t i al i s at i on * * * * *
74LS688. OUT &h378, 255 ‘ s et al l t o 1
The 74LS688 is an old ac quaintanc e. It OUT &h37A, 0 ‘ pul l s t r obe hi gh
is a word c omparator that is very often
used in address dec oders, as in this ‘ * * * * * * * * * * * Wr i t e * * * * * * * * * *
projec t. The module address is selec t-
ed by the 4-pole DIP switc h SW1, in the ‘ f or mul a t o c omput e c ommand wor d:
‘ ( Car daddr es s * 16) +c ommand+por t
range of 0 through 15. If the address ‘ ex ampl e : wr i t e t o por t 2 on c ar d 1
selec ted by SW1 is equal to the value ‘ ( 1* 16) + 4 +1 = 21
p resent on the a d d ress b us, the
d ec od er outp ut g oes low, whic h out &h378, 21 ‘ c ar d addr es s + por t addr es s + c ommand
selec ts the I/O unit in question. out &h37A, 1 ‘ s t r obe l ow
As c an be seen from the sc hematic
‘ f or mul a t o c omput e dat a:
diagram, every I/O line has the same
‘ ( Car daddr es s * 16) +dat a
struc ture. This means that every line ‘ s o i n t hi s c as e ( 1* 16) +dat a
c an be used as an input line or an out- ‘ f or t es t i ng we mak e t he 2 l as t bi t s hi gh HHLL = 12
put line, as desired. However, the ‘ s o t he r es ul t bec omes : ( 1* 16) +12 = 28
selec tion (either input or output) must
be made for a set of eight lines at a out &h378, 28 ‘ pr epar e dat a
time, sinc e the buffers used here are out &h37A, 0 ‘ s t r obe hi gh
pac kaged eight to a c hip.
‘ dat a now av ai l abl e on des i r ed por t
If a set of lines is to be used as inputs,
the a ssoc ia ted integ ra ted b uffer ‘ * * * * * * * * * * * * Read * * * * * * *
(ULN2803) must b e removed a nd ‘ Command f or mul a: s ame as wi t h wr i t i ng, but us i ng di f f . c ommand
rep la c ed b y a n 8-p osition, 330-Ω ‘ ( 1* 16) +0+1 = 17
resistor a rra y. This a rra y must b e
housed in a DIL pac kage, so that it out &h378, 17 ‘ c ar d addr es s + por t addr es s + c ommand
out &h37A, 1 ‘ s t r obe l ow
c an be plugged into the soc ket pro-
out &h378, 255 ‘ s et c ont r ol l er out put s t o hi gh- Z
vided for the buffer IC. When inserting
the resistor array, you must be sure that v al ue = i np( &h379) ‘ r ead
all inputs are c onnec ted to their asso- v al ue = ( ( v al ue and &hF0) / 16) ‘ ex t r ac t hi ghes t ni bbl e
c iated outputs. They are all arranged out &h37A, 0 ‘ s t r obe hi gh
direc tly ac ross from eac h other, so the
only thing you need to do is to take ‘ * * * * * * * * * * * * end * * * * * * * * * * * *
c are that the resistor array is properly
inserted in the soc ket. When it is c or-
Figure 6. A BASIC p rogra m tha t c a n b e used to c ontrol the I/O system .
rec tly plac ed, pin positions 9 and 10
of the soc ket will be open. The pull-up
resistor array ensures that open inputs c onnec ted to the Vp pin. They c an thus printed c irc uit board for the bus unit,
are held at a defined logic level. be c onnec ted to the highest-available while Figure 5 shows the same for the
Sinc e the inputs are only suitable for potential via c onnec tor K5. The earth I/O unit. Both types of c irc uit boards
TTL signals, the ac tual input signals pin is c onnec ted to the system earth. are single-sided, so that you c an easi-
must naturally also c onform to this Eac h buffer c an switc h voltages up to ly make them yourself. The pric e of this
standard. 50 V and c urrents up to 500 mA, whic h approac h is that several wire jumpers
If a set of lines is to be used as out- is more than adequate for most appli- are needed on the bus unit c ard.
puts, the assoc iated ULN2803 must be c ations. Fortunately, only one of these has to
installed. This IC has open-c ollec tor be built, so this is not a partic ularly
outputs. Sinc e the loads c onnec ted to Compact hardware onerous disadvantage.
the outputs may be induc tive, eac h A length of flat c able c an be used to
output has a built-in protec tion diode. Figure 4 shows the c opper-trac k lay- c onnec t the I/O units to the bus unit,
The c athodes of all these diodes are out and the c omponent overlay of the sinc e headers are used for the c on-

PC TOPICS —————————————— Elektor Elec tronic s EXTRA 15 - 2/99


nec tors on the bus side (K3 and K4). If Table 1. Port selection. Table 2. Command selection.
the I/O c ards are mounted one on top input/ output selected Command Function
of the other using 10-mm spac ers, the adress code input/ output P23 (D3) P22 (D2)
whole system c an be c onstruc ted as a P21 (D1) P20 (D0)
0 0 Read
c ompac t and sturdy assembly. The 0 0 4
0 1 5 0 1 Write
desired address for eac h I/O c ard
1 0 6 1 0 ORLD
must be selec ted using the assoc iated
1 1 7 1 1 ANLD
DIP switc h; eac h unit must have its own
(unique) address.
A mains adapter with an 12-V DC
output c an be used to power the sys- instruc tion, c a n a lso b e used to ic ally ANDed with the data that are
tem. The 5-V supply voltage produc ed advantage here. already present in the selec ted port,
in the bus unit is provided to the vari- The 4-bit bus c an be used for both and the result is retained in the port.
ous I/O units via the bus c able. data and c ommands. To send a c om- With Write_OR a similar proc ess takes
mand to the IC, the c ommand bits plac e, exc ept that a logic al OR is per-
A few lines of BASIC must be plac ed on the bus and the formed instead of a logic al AND. The
level of the Strobe line then switc hed manner in whic h the various ports are
Most hardware also needs some kind from high to low. Data c an then be selec ted and the way that the various
of software, and that is true for this pro- transferred by plac ing the data bits on func tions are ac tivated are desc ribed
jec t. Before delving into the software, the bus and switc hing the Strobe line in Table 1 and Table 2, respec tively.
it’s nec essary to give a little more bac k to high. As c an be c learly seen from the pro-
attention to the 82C43. Sinc e this IC The 82C43 rec ognizes four basic gram listing in Figure 6, it is not at all
was spec ific ally developed to work c ommands: Read, Write, Write_AND diffic ult to work with this c irc uit in ac tu-
with an 8048 c ontroller, a spec ial pro- and Write_OR. Logic ally enough, Read al prac tic e. If you study this simple pro-
c edure must be used to write to and is used to read data and Write to write gram, you will learn all that you need
read from its registers. This approac h, data, so these c ommands need no to know to be able to use all func tions
whic h allows data to be read into or further explanation. With Write_AND, of the I/O system.
written from the 8048 with a single the new data written to the IC are log- (990025)

WH E N E LE C T RO N IC S WAS YO U N G (2)
Birth of the battery such as Nicholson, Davy and Faraday. It
Count Alessandro Giuseppe Anastasio Volta (1745–1827) also put paid to the belief that animal tissue
belonged to an aristocratic family and was Professor of was needed for the generation of electricity.
Physics at the universities of Como and Pavia. He became It may be said that all this work
interested in a phenomenon described by Galvani in 1786 to in the early part of the 19th century was
the effect that “an electric spark, or contact with copper and experimental. The first reliable, practical
iron, causes a frog’s leg to twitch”. This gave rise to the, for- source of electric current, based on the
tunately short-termed, belief that animal tissue was neces- interactions of carbon and zinc in an elec-
sary for the generation of electricity. trolyte consisting of, among others, ammo-
Experiments showed Volta that an electric current nium chloride, manganese dioxide, zinc
could be generated by bringing different metals into contact chloride and water, was described by the
with each other. There are different versions of which metals French physicist Georges Leclanché in Alessandro Volta (1745 ... 1827)
he used: some writers claim silver and zinc, others, copper 1868. The Leclanché cell, improved many
and zinc. In 1799, he succeeded in making a construction of times since its inception, remains the best known dry or pri-
metal discs, alternately silver (or copper) and zinc, with mary cell in common use today.
brine-soak ed card between them. This ‘voltaic pile’ as it The secondary battery, invented in 1803 by Johann
became known was the first man-made source of electricity. Wolfgang Ritter (1776–1808) consists of discs of one metal
Its invention was made known by Volta to Sir Joseph Banks, separated by circular pieces of cardboard
President of the Royal Society, in a letter in early 1800. In that are moistened in a liquid that cannot
this letter, Volta says that he used 25 mm dia. copper and chemically affect the metal. W hen the
zinc discs. After his invention was made known, Volta did lit- extremities of this pile are link ed to the
tle further work on the device. His name survives, however, in poles of a voltaic pile, it becomes electrified
the SI unit of electric potential difference, the volt. and can be substituted for the latter and it
It is interesting to note that in 1848 Scyffer in his will retain the charge.
Geschichtliche Darstellung der Galvanisms (Historical However, the first practical sec-
Notation of Electric Phenomena) states that others besides ondary battery, the lead-acid battery, was
Volta carried out experiments with dry cells between 1800 produced in 1859 by another French physi-
and 1812, namely Ludick e, Einhof, Ritter, Hachette, Des- cist, Gaston Planté (1834–1889). In spite
ornes, Biot, and others. Several physicists of that era, par- of all sorts of other type of secondary bat-
ticularly Zamboni, expressed as their opinion that the best tery, the lead-acid battery remains the most
performance was not that of Volta but that of De Luc. widely used secondary battery in the world
Be that as it may, Volta’s invention transformed the today.
[905016-1] Volta’s cell
study of electricity and was, therefore, invaluable to men

16 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


nec tors on the bus side (K3 and K4). If Table 1. Port selection. Table 2. Command selection.
the I/O c ards are mounted one on top input/ output selected Command Function
of the other using 10-mm spac ers, the adress code input/ output P23 (D3) P22 (D2)
whole system c an be c onstruc ted as a P21 (D1) P20 (D0)
0 0 Read
c ompac t and sturdy assembly. The 0 0 4
0 1 5 0 1 Write
desired address for eac h I/O c ard
1 0 6 1 0 ORLD
must be selec ted using the assoc iated
1 1 7 1 1 ANLD
DIP switc h; eac h unit must have its own
(unique) address.
A mains adapter with an 12-V DC
output c an be used to power the sys- instruc tion, c a n a lso b e used to ic ally ANDed with the data that are
tem. The 5-V supply voltage produc ed advantage here. already present in the selec ted port,
in the bus unit is provided to the vari- The 4-bit bus c an be used for both and the result is retained in the port.
ous I/O units via the bus c able. data and c ommands. To send a c om- With Write_OR a similar proc ess takes
mand to the IC, the c ommand bits plac e, exc ept that a logic al OR is per-
A few lines of BASIC must be plac ed on the bus and the formed instead of a logic al AND. The
level of the Strobe line then switc hed manner in whic h the various ports are
Most hardware also needs some kind from high to low. Data c an then be selec ted and the way that the various
of software, and that is true for this pro- transferred by plac ing the data bits on func tions are ac tivated are desc ribed
jec t. Before delving into the software, the bus and switc hing the Strobe line in Table 1 and Table 2, respec tively.
it’s nec essary to give a little more bac k to high. As c an be c learly seen from the pro-
attention to the 82C43. Sinc e this IC The 82C43 rec ognizes four basic gram listing in Figure 6, it is not at all
was spec ific ally developed to work c ommands: Read, Write, Write_AND diffic ult to work with this c irc uit in ac tu-
with an 8048 c ontroller, a spec ial pro- and Write_OR. Logic ally enough, Read al prac tic e. If you study this simple pro-
c edure must be used to write to and is used to read data and Write to write gram, you will learn all that you need
read from its registers. This approac h, data, so these c ommands need no to know to be able to use all func tions
whic h allows data to be read into or further explanation. With Write_AND, of the I/O system.
written from the 8048 with a single the new data written to the IC are log- (990025)

WH E N E LE C T RO N IC S WAS YO U N G (2)
Birth of the battery such as Nicholson, Davy and Faraday. It
Count Alessandro Giuseppe Anastasio Volta (1745–1827) also put paid to the belief that animal tissue
belonged to an aristocratic family and was Professor of was needed for the generation of electricity.
Physics at the universities of Como and Pavia. He became It may be said that all this work
interested in a phenomenon described by Galvani in 1786 to in the early part of the 19th century was
the effect that “an electric spark, or contact with copper and experimental. The first reliable, practical
iron, causes a frog’s leg to twitch”. This gave rise to the, for- source of electric current, based on the
tunately short-termed, belief that animal tissue was neces- interactions of carbon and zinc in an elec-
sary for the generation of electricity. trolyte consisting of, among others, ammo-
Experiments showed Volta that an electric current nium chloride, manganese dioxide, zinc
could be generated by bringing different metals into contact chloride and water, was described by the
with each other. There are different versions of which metals French physicist Georges Leclanché in Alessandro Volta (1745 ... 1827)
he used: some writers claim silver and zinc, others, copper 1868. The Leclanché cell, improved many
and zinc. In 1799, he succeeded in making a construction of times since its inception, remains the best known dry or pri-
metal discs, alternately silver (or copper) and zinc, with mary cell in common use today.
brine-soak ed card between them. This ‘voltaic pile’ as it The secondary battery, invented in 1803 by Johann
became known was the first man-made source of electricity. Wolfgang Ritter (1776–1808) consists of discs of one metal
Its invention was made known by Volta to Sir Joseph Banks, separated by circular pieces of cardboard
President of the Royal Society, in a letter in early 1800. In that are moistened in a liquid that cannot
this letter, Volta says that he used 25 mm dia. copper and chemically affect the metal. W hen the
zinc discs. After his invention was made known, Volta did lit- extremities of this pile are link ed to the
tle further work on the device. His name survives, however, in poles of a voltaic pile, it becomes electrified
the SI unit of electric potential difference, the volt. and can be substituted for the latter and it
It is interesting to note that in 1848 Scyffer in his will retain the charge.
Geschichtliche Darstellung der Galvanisms (Historical However, the first practical sec-
Notation of Electric Phenomena) states that others besides ondary battery, the lead-acid battery, was
Volta carried out experiments with dry cells between 1800 produced in 1859 by another French physi-
and 1812, namely Ludick e, Einhof, Ritter, Hachette, Des- cist, Gaston Planté (1834–1889). In spite
ornes, Biot, and others. Several physicists of that era, par- of all sorts of other type of secondary bat-
ticularly Zamboni, expressed as their opinion that the best tery, the lead-acid battery remains the most
performance was not that of Volta but that of De Luc. widely used secondary battery in the world
Be that as it may, Volta’s invention transformed the today.
[905016-1] Volta’s cell
study of electricity and was, therefore, invaluable to men

16 - 2/99 Elektor Elec tronic s EXTRA ——————————————— PC TOPICS


electronics on line
CPU coolers and boosters
faster and cooler with just software
Making the computer run
faster is probably every
user’s desire. However, not
everyone is prepared to
invest in a faster CPU or
motherboard upgrade. For-
tunately, in some cases the
computer may also be given
a speed boost by software
or hardware tricks.

A com p u ter is alw ays too slow. Esp e- the CPU voltage and temperature. The m ay be u sefu l to ow n ers of ‘old er ’
cially if you are a power user running three best known are: com p u ters. It m ay be fou n d at
th e latest softw are, a few m egah ertz Waterfall and Waterfall Pro www.geocities.com/SiliconValley/Vista/7532.
extra are often more than welcome. cpu.simplenet.com/leading_wintech/ The maker of this program claims that
Fortu n ately, you d on ’t h ave to bu y Rain it speeds up nearly all older processors
a new hardware kit to make your com- cpu.simplenet.com/rain10.zip w ith ou t h avin g to in crease th e clock
p u ter a bit faster — th ere are oth er CPUidle frequency. For the rest, the story is a bit
w ays! O verclockin g th e CPU is still www.stud.uni-hannover.de/~ goetz/ murky. None the less, we did give the
among the most popular alternatives. Th ere are also w ays to make th e CPU p rogram a test sp in on a cou p le of
Essen tially, th e CPU is given a clock faster by changing a couple of internal com p u ters in ou r offices. Th e resu lts
sign al th at is faster th an th e on e it is settings. Once a popular method with varied wid ely. No sp eed in crease was
officially rated for by the manufacturer, the earlier CPU generations produced n oticed on n ew er PCs, bu t u sers of
for exam p le, 350 MH z in stead of by Cyrix and AMD, it is no longer nec- older ones with a 486 or older Pentium
300 MHz. This works on nearly all Intel essary with the latest CPU types. O ne at least were under the impression that
CPUs (w ith a few tricks, th ou gh ), as p rogram , CPU booster, sh ou ld be the machine went faster, so we say it’s
w ell as on th ose from AMD an d m en tion ed h ere, h ow ever, becau se it worth trying.
IBM/Cyrix. Lots of in form ation on (995013-1)
overclockin g m eth od s, resu lts an d
related aspects may be found at
www.sysopt.com/overc.html and
www.tomshardware.com/overclock.html.
A major problem with overclocking
is the extra heat the processor will pro-
duce as a result of the higher clock fre-
qu en cy. In creasin g th e size of th e
h eatsin k/fan com bin ation m ay n ot
always be sufficient. Fortunately, a cou-
ple of small programs are available on
th e In tern et th at len d a h elp in g h an d
in p reven tin g early CPU d em ise as a
resu lt of overh eatin g. Basically, th ese
programs insert halt instructions in the
program code when the CPU idles. In
this way, the CPU temperature can be
mad e to d rop by 10-20 d egrees. Some
programs go one step further, provid-
in g extra fu n ction s su ch as gu ard in g

Elektor Electronics 2/99 11


GENERAL INTEREST

microcontrollers’
survey
news from the world of bit crunchers

These days a per-


plexing number of
microcontroller
types are avail-
able. Embedded,
single-chip, RISC,
8-bit, 16-16, sur-
face-mount, flat-
pack, you name it,
it’s turmoil! The
microcontroller
world is bustling
with activity, and
there are new
arrivals almost every
week. In this article we will Alth ou gh th ere is on ly a sm all an d
very slow in crease in th e n u m ber of
Atmel’s most recent products.
AT90S8535, this one has an 8-kByte ISP
look at some of the latest microcon troller man u factu rers, th is is Flash p rogram memory, 512 kBytes of
in stark con trast w ith th e rocketin g ISP (in -system p rogram m able) EEP-
developments in this ever- n u m ber of d ifferen t version s, typ es RO M an d an id en tical am ou n t of
active field. an d su b-typ es of th ese com p on en ts. SRAM for data;
With this in mind, we had to limit our- AT90S4434 an d AT90S4433, both h av-
selves to look at th e latest d evelop - in g 4 kBytes of Flash ISP p rogram
m en ts on ly. So, in stead of a com p lete m em ory, 256 bytes of ISP EEPRO M,
overview of all m icrocon trollers cu r- an d 256 an d 128 bytes of SRAM d ata
rently available on the market we will memory;
concentrate on those products that can ATmega603 w ith a m assive 64 kBytes
be called ‘recent introductions’. of ISP Flash program memory, 2 kBytes
of ISP EEPROM and 4 kBytes of SRAM
AT M E L for data storage.
Fou n d ed n ot so lon g ago (in 1984),
Atmel, in just a few years, have become Takin g th e ATm ega103 as an exam p le
on e of th e m ajor forces in th e m icro- (from w h ich th e ATm ega603 is a
con troller market. Atmel h ave alw ays d erived version ), you are lookin g at a
excelled at offerin g a p rod u ct ran ge m icrocon troller w ith th e com p u tin g
th at meets even th e most extravagan t p ow er of a PC of abou t 15 years ago
demands from designers of microcon- (128 kBytes ISP Flash memory, 4 kBytes
troller-based systems for a wide variety ISP EEPRO M, an d 4 kBytes SRAM).
of applications. The new device has 120 instructions, it
By our Editorial Staff Below are sh ort d escrip tion s of can be p rogram m ed extern ally or in -

Elektor Electronics 2/99


18
system (ISP), its clock rate is 6 MHz, it DS87C530
has 32 input/output lines, three timers, In tegratin g a real-tim e clock, th e
an 8-ch an n el 10-bit con verter, a real- DS87C530 is compatible with the 8051,
time clock (operating at 32 kHz), and a alth ou gh it offers better p erform an ce
UART, all in a 64-pin TQ FP package. an d low er p ow er con su m p tion . Th e
O n e of th e best th in gs abou t th e revised core n eed s on ly 4 clock cycles
m egaAVR con trollers (w h ich , by th e to execu te an in stru ction , as op p osed
way, are 8-bit types), is that they allow to 12 for th e 8051. In fact, it offers th e
th e com p lete 16-bit in stru ction to be same performance as an 8051 running
load ed an d stored in on e op eration , at 99 MH z. Th is n ew m icrocon troller
using two addresses. offers 16 kBytes of EEPRO M (UV or
An oth er n ovelty is th e ATtin y11, O TP), 1 kBytes of non-volatile MOVX
w h ich is actu ally a low-voltage con - SRAM, 2 serial ports, a watchdog timer,
troller. The relevant supply voltages are a su p p ly voltage gu ard , d u al d ata
3 V for th e ATtin y11 an d 1.8 V for th e p oin ters, an d ad van ced p ow er m an -
ATtiny 11L. Its sole memory element is agement techniques. The device is, we
a 1-kByte Flash m em ory. Th is con - believe, ideal for data logger systems. with an on-chip 8-bit analogue-to-dig-
troller h as 90 in stru ction s, an d is su p - ital converter (ADC) as well as an EEP-
plied in an 8-pin case! ISSI RO M. O fferin g 1024 an d 2048 O TP
With the introduction of the AT91 ( I N T E G R AT E D S I L I C O N p rogram m em ory w ith a w ord w id th
ARM Thumb, finally, Atmel ventures S O LU TI O N, I N C. ) of 14 bits, these integrated circuits also
out into 16/32-bit ARM RISC technology. The IS89C52 from ISSI is an 8-bit micro- contain 128 bytes of static RAM and 16
Th e m ost recen t m od el is th e controller with 8 kBytes of reprogram- x 8 bytes of EEPRO M data memory.
AT91M40400, w h ich is also th e latest mable Flash memory. Capable of oper- PIC17C7xx (752, 762 and 766)
d evice in a fam ily of stan d ard m icro- atin g at a h igh est clock sp eed of Th ese m icrocon trollers take u s to th e
con trollers based on th e ARM7TDM1 40 MHz th e IS89C52 is w ith ou t d ou bt 16-bit limits. Although they are strictly
core. The ARM91M40400 is a fully static one of the fastest microcontrollers in its sp eakin g 8-bit O TP m icrocon trollers,
com p on en t cap able of ach ievin g class. As suggested by the type number, th e d evices in Microch ip ’s PIC17Cxxx
30 MIPs at a clock sp eed of 33 MH z the new microcontroller is functionally series offer fu n ction ality an d p erfor-
an d a low su p p ly voltage betw een compatible with the industry-standard mance levels that compete with 16-bit
2.7 V and 3.3 V. This device has rather 80C52 d evice. It offers, amon g oth ers, d evices. Th ese com p on en ts in 64-p in
a lot of p erip h eral circu itry, in clu d in g 256 bytes of RAM, a serial I/O port suit- an d 84-p in cases con tain 10-bit A-D
data and address buses with a width of able for m u lti-p rocessor com m u n ica- con verters an d tw o h igh -sp eed
32 bits, 37 registers w ith th e sam e tions, and I/O extension circuitry plus USARTs. These PICs achieve a perfor-
width, and an in-circuit emulator inter- a full-duplex UART. Sporting no fewer m an ce of 8.25 MIPs at a clock rate of
face. It contains 4 kBytes of SRAM. than 3 timer/counter units, the IS89C52 33 MH z, an d so even su rp ass certain
has four 8-bit input/output ports with com p etin g d evices like th e Motorola
D ALLAS a total of 32 in p u t/ou tp u t lin es. Its MC68HC11 and Hitachi’s H8. Offering
S EMICONDUCTOR m em ory ad d ressin g cap acity is u p to 16 kw ord s of 16-bit p rogram
As far as its m icrocon trollers are con - 64 kBytes of RO M an d th e sam e m em ory in O TP EPRO M an d u p to
cerned, Dallas Semiconductors can not amount of RAM. The device is capable 902 bytes of user RAM, these new cir-
be said to have followed an innovative of p rotectin g th e p rogram m em ory cu its com p rise a on e-cycle (120-n s)
course. Rather, the accent has been on using encrypted verification (32 bytes), hardware 8x8 multiplication unit, and
in creasin g sp eed an d com p u tin g and lock-out bits (3 bits). options for high-speed communication
p ow er. Th e series of m icrocon trollers on 2 channels (duplex) using a USART
cu rren tly p rod u ced by Dallas Sem i- MICROCHIP with a speed of 8.25 million bits/s.
conductor operates at clock rates up to Microch ip recen tly released five n ew PIC16CR54C and PIC16C505
33 MHz. However, since they use only m icrocon trollers on th e m arket. Th e It seems that these devices actually are
4 clock cycles rath er th an 12 (for an n ew PIC16CE62X an d PIC12CE67X th e m ost econ om ic 8-bit O TP RO M
8051) to execu te an in stru ction , th ese PICMicro TM fam ilies n ow offer p ro- con trollers cu rren tly on th e m arket.
m icrocon trollers ap p ear to ru n at a tected EEPROM memory. Th e PIC16CR54C, a RO M-based con -
speed of 99 MHz. These 8-bit one-time programmable troller, and the PIC16C505, a one-time
The latest products from Dallas Semicon- (OTP) microcontrollers present unbeat- p rogram m able ch ip , offer a galaxy of
ductor include: able secu rity. In fact, to gain access to functions at a very low price. Packaged
DS80C130 th e EEPRO M, th e m em ory of th e in a 14-pin enclosure, it is the first 8-bit
A h igh -p erform an ce rep lacem en t of PIC16CE62 and PIC12CE67X has to be
the 8051, without RO M or XRAM, but rep rogram m ed , w h ich , in th e case of
having 56 bytes of protected RAM. O TP d evices, is im p ossible! Th e n ew
DS80C320 d evices are claimed to be th e smallest
Id en tical to th e 80C130 bu t h avin g a on e-tim e p rogram m able 8-bit RISC
an on -ch ip w atch d og an d a su p p ly con trollers in an 8-p in case. O fferin g
level monitor. The DS80C323 is the 3-V on e m illion w rite/clear cycles,
version . Microchip’s EEPRO M technology also
DS87C250 gu aran tees th e lon gest p eriod of d ata
Th is con troller h as 16 kBytes of retention: more than 40 years.
EPRO M (O TP), 1 kBytes of SRAM, The PIC16CE623, 624 and 625 offer
an d variou s Pow er Man agem en t an d 512 to 2048 w ord s of on e-tim e p ro-
EMI Red u ction m od es. Th e grammable memory, 128 bytes of EEP-
DS83C520 is a version w ith m asked RO M, an d 96 u p to 128 bytes of static
RO M, an d th e DS87C530, on e w ith a RAM for data storage.
real-tim e clock (RTC) an d an N V Th e PIC16CE673 an d 674 are th e first
RAM con troller. 8-p in m icrocon trollers in th e w orld

Elektor Electronics 2/99 19


microcontroller to expand the possibil- to more cost-effective solutions, if nec- memory, is said to be completely state-
ities of 8-p in d esign s w ith m ore I/O essary. These components contain a 10- of-the-art. The GP20, as Motorola calls
capacity, all at a cost of less than 50 dol- bit A-D converter with 5 to 8 channels, a it, h as 19,968 bytes of ISP Flash m em -
lar cents in volume quantities. UART w ith RS485 comp atibility for ory, 512 bytes of RAM, an d offers a
Th e PIC16C5050 h as a m em ory d ata acquisition applications in multi- n ovel op tion called Auto Wake-up Out
w ith a cap acity of 1024 w ord s of 12- channel systems, a computing perfor- of Stop. It will faithfully run all instruc-
bits, 72 bytes of user RAM, 12 I/O pins, mance of up to 5 MIPs at a clock speed tion s of th e 68H C08, an d allow s
a wake-up circuit activated on I/O line of 5 MHz, options for I2C bus commu- d esign ers h avin g w orked w ith th e
state ch an ges, an d an in tern al 4-MHz n ication or SPI for system exp an sion 68HC05 to upgrade to a larger model.
clock oscillator. It is also cap able of w ith p erip h eral circu its, an d , fin ally, Silently, Motorola has also switched
bein g p rogram m ed in -circu it, w h ich two 8-bit and one 16-bit timer. over to th e u se of Flash m em ory. Th e
m ean s th at th e m icrocon troller d oes A number of precision timing inter- p rod u ct ran ge cu rren tly in clu d es th e
n ot h ave to be rem oved from th e faces allow qu an tities to be cap tu red 68F333, 68HC916Y1 and 68HC916X1.
printed circuit board to receive a new an d com p ared (16 bits) at resp ective Fin ally, w e sh ou ld n ot forget to
program. resolu tion s of 12.5 n s an d 200 n s, or mention the introduction of Motorola’s
Th e RO M-based PIC16R54C is an PWM (pulsewidth modulation) signals new 68HC(7)05SB7, which is basically a
18-pin controller with a program mem- to be generated with frequencies up to new version of the 68HC705. This chip
ory of 512 words of 12 bits, 25 bytes of 20 kHz and a resolution of 10 bits. The w as sp ecifically d evelop ed for Smart
user RAM, and 12 I/O pins. These two devices allow up to 1,000,000 clear/pro- Battery applications.
circuits offer 33 one-word instructions, gram cycles, which is the highest num- At th e 16-bit m icrop rocessor fron t,
a p rogram m able w atch d og fu n ction ber achieved in the industry today. Motorola h as th ree fam ilies available,
w ith an on -ch ip RC oscillator for n o- Th e PIC16F877 an d PIC16F876 are th e 68000, 68H C12 (in m ore th an 10
break op eration , an in stru ction cycle the first 8-bit RISC-type PICmicro® con- d ifferen t version s) an d th e 68H C16
trollers to in tegrate en h an ced Flash (which comes in 8 different flavours).
memory technology.
PIC16F627 and PIC16F628 N AT I O N AL
Th ese n ew com p on en ts com p rise an S EMICONDUCTOR
in tern al 4-MH z clock oscillator, h igh - National Semiconductor has really just
precision voltage comparators, a high- one series of microcontrollers available,
speed USART, and a capture/compari- th e CO P8. Th is is an 8-bit p rocessor
son/PWM module. These 18-pin micro- w h ich com es in n o few er th an 82 d if-
con trollers con tain 1024 an d 2048 of feren t version s. Th e O TP version s of
14-bit w id e Flash p rogram m em ory th e CO P8 h ave m em ory cap acities of
respectively, besides 224 bytes of RAM betw een 4 an d 32 kBytes of O TP
an d 128 bytes of EEPRO M for d ata EPRO M.
storage. Th e h igh est clock sp eed is Q u ite recen tly, N ation al Sem icon -
40 MHz. d u ctor lau n ch ed a n ew O TP m icro-
PIC16C733 and PIC16C774 p rocessor called COP8SGR7. H avin g
These 8-bit microcontrollers integrate a an EPRO M m em ory of 32 kBytes, its
sophisticated analogue technology for p rice is rem arkably low at less th an
d irect, p rogram m able, in terfacin g to 5 dollars for 1k+ order volumes.
time of 200 ns at a clock rate of 20 MHz, th e p ow er su p p ly an d for p recision An oth er recen t arrival, th e
7 h ard w are registers for sp ecial fu n c- con trol of extern al system s. Th ese COP8SGE7, com es w ith 8 kBytes of
tions, a 2-register hardware stack, an 8- parts, with 28 and 40 pins respectively, O TP memory.
bit real-tim e tim er/cou n ter, a w id e provide a complete system solution for With its huge memory capacity, the
range for the supply voltage, and, last mixed -signal environments, consid er- CO P8SGR7 allows designers to drasti-
but not least, low power consumption: ably red u cin g th e n u m ber of d iscrete cally reduce development time because
2 m A at a clock rate of 4 MH z an d a logic p arts, associated p arts an d , of th ere is n o lon ger a n eed to com p act
supply voltage of 5 V. course, overall system cost. They inte- th e p rogram cod e to m ake it fit in a
The following are the latest models grate a 10-channel 12-bit A-D converter m em ory (w h ich is alw ays too sm all!).
announced at the Munich ‘Electronics 98’ (±1 LSB) and a precision voltage refer- Once the program has been tested and
exhibition. ence (±3%), a programmable voltage- d ebu gged , it m ay be bu rn ed in to a
PIC16F877 and PIC16F876 d rop d etector, an d a p rogram m able RO M-based CO P8 processor.
Th ese n ew microcon trollers con tain low-voltage detector (both with a cur- Th e CO P8 fam ily w as recen tly
8 kw ord s of 14-bit en h an ced Flash rent drain of 50 µA and an accuracy of extended with five new members: the
memory, an d 256 bytes of EEPRO M- ±3%). CO P8SGE5 (8 kBytes RO M),
resid en t d ata memory. Th ey offer th e With 4 kw ord s of 14-bit w id e O TP CO P8SGG5 (16 k), CO P8SGH (20 k),
widest operating voltage known in the m em ory, th e PIC16C773 an d CO P8SGK5 (24 k) and the CO P8SGR5
in d u stry, n amely betw een 2.0 V an d PIC16C774 con tain an RS485-style (32 k).
5.5 V. These are also the first controllers UART for m u ltip le-d ata acqu isition All members of the CO P8SGx fam-
to emp loy Microch ip ’s n ew MM purposes, offering a throughput of up ily h ave a fu ll-d u p lex UART/USART
(Migratable Memory) technology for the to 5 MIPs at a clock sp eed of 20 MH z, w h ich is softw are p rogram m able to
greatest p ossible system p erforman ce tw o 8-bit tim ers, on e 16-bit tim er, as en able qu ick im p lem en tation of vari-
an d d esign flexibility (say Microch ip ). w ell as p ossibilities for in d u stry-stan - ous communication protocols. A pair of
The MM technology effectively ensures d ard I2C an d SPI com m u n ication an alogu e com p arators is available to
pin-for-pin and software compatibility buses. d etect zero-crossin gs, or for im p le-
of all microcon trollers, RO M-based , menting a regular or ‘d ual-ramp’ A-D
one-time programmable (OTP), or their MOTOROLA con verter fu n ction . Th ese con trollers
Flash equivalents, and allows designers Motorola recen tly in trod u ced a n ew h ave eith er 256 (SGE) or 512 (SGR)
to choose the memory technology as a version of its 68H C08, th e bytes of RAM.
fu n ction of th e exp ected ap p lication 68HC908GP20, w h ich , becau se of its Th e CO P8SGR7 an d CO P8SGE7
lifetime. It also enables easy migration in -system p rogram m able (ISP) Flash gu aran tee p erfect p rotection of th e

20 Elektor Electronics 2/99


in tellectu al cop yrigh ts vested in th e Th e SX arch itectu re is basically a Microelectron ics. It is based on an
firmware code. Once the code has been copy of that used in Microchip’s PICs. arch itectu re th at is still actively
mad e secu re by mean s of an op tion al Th e SX is com p atible w ith th e employed for the design of microcon-
protection mechanism, the program is PIC16C5x, an d offers 10 ad d ition al trollers for specific applications like PC
virtually impossible to ‘hack’. instructions. One of the reasons for the d isp lays, rem ote con trol u n its, CD
Fin ally, w e sh ou ld n ote th at m ost technical success of the SX is the speed players or car radios with RDS.
applications of the COP8 family mem- of its EEPROM program memory (2048 The members of the ST7 family dif-
bers are typically industrial. w ord s of 12 bits) an d its RAM-based fer in respect of on-chip memory size,
registers (136 bytes) for data storage. ranging from a modest 4 Kbytes of pro-
PHILIPS Th e in stru ction s of th e SX h ave a gram m em ory an d 128 bytes of RAM
S EMICONDUCTORS u n iform len gth (12 bits) an d m ost of in the ST72101 right up to 32 kBytes of
Ph ilip s Semicon d u ctors are obviou sly th em are execu ted in on e clock cycle. ROM/EPROM, 1024 bytes of RAM and
in a bid to offer th e m ost exten sive Alth ou gh th e in tern al clock sp eed of 256 bytes of EEPRO M in the ST72331.
range of microcontrollers derived from th e SX is ‘ju st’ 4 MH z, th e con troller The IC cases have 28 up to 56 connect-
the ‘generic’ 80C51. outperforms a number of classic CPUs ing pins.
89C51, 89C52, 89C54 and 80C58 running at much higher speeds (12 or Amon g th e op tion s for p erip h eral
The most recent microcontrollers from 33 MHz, for example), mainly because circuits are an 8-bit multi-channel ADC,
Philips Semiconductors are four Flash th ese requ ire several clock cycles to SPI in terfaces, I2C, USB an d CAN bu s
MTP (Multi Time Programmable) (sic, execute a single instruction (12 cycles, interfaces, and one or two 16-bit timers.
Ed.) Flash types in the extremely pop- for example, for the 8051). As far as performance is concerned,
ular 80C51 family. These fledglings are Stop Press: Scen ix ju st an n ou n ced an th e ST72 series is situ ated abou t
called 89C51, 89C52, 89C54 and 80C58. ad d ition to its p rod u ction p rogram: a
Th e m ain p oin t to m ake abou t th ese n ew version of th e SX18/28, called
con trollers is th at th ey can be rep ro- SX18/28AC100. As suggested by its type
gram m ed m an y tim es, an d even in - d esign ation th is n u m ber cru n ch er is
system (ISP), w h ich equ ates to a con - capable of achieving a processing per-
sid erable red u ction of tw o in fam ou s forman ce of u p to 100 MIPs. Ru n n in g
factors, cost and time to market. at u p to 100 MH z, th e SX18/28AC100
Th ese n ew p rocessors are cap able execu tes on e in stru ction in on e clock
of op eratin g at u p to 33 MH z, w h ich cycle. At a d ata th rou gh p u t of
m akes th em am on g th e fastest 80C51 100 MIPs, th e resu ltin g in stru ction
Flash processors currently available. cycle len gth is 10 n s. Th ese tw o n ew
The difference between the various versions sport 2 kwords of Flash/EEP-
m od els is m ain ly th e size of th e on - ROM memory with a width of 12 bits.
ch ip Flash m em ory: 4 kBytes in th e
89C51, and 8, 16 or 32 kBytes in the ’52, S GS -THOMS ON
’54 an d ’58 typ es resp ectively. Th e MICROELECTRONICS
89C51 has 128 bytes of RAM available, The ST6 Family
th e oth er typ es, d ou ble th at am ou n t This is probably the best known series
(128 bytes). of 8-bit m icrocon trollers from SGS-
Th om son . It com p rises th e follow in g
SCENIX typ es: ST6200/1/3/8/9, ST6210/15/18,
SX-18, SX-28 ST6220/25/28, ST6230/32, ST6240/42/46,
Scenix may rightly claim to be the com- ST6252/53/55, ST6260/62/63/65 an d h alfw ay betw een th e low-cost ST62
p an y w ith th e fastest 8-bit m icrocon - ST6280/85. N ote th at n ot all of th ese family and the ST9 family with 8/16 bit
trollers currently available on the mar- m icrocon trollers are available in a 28- registers.
ket. O p eratin g at u p to 50 MH z an d pin or 40-pin DIL enclosure — a num- Th e ST72 fam ily is exp ected to be
cap able of execu tin g th e m ajority of ber of th em are on ly su p p lied in a extended shortly with a couple of new
instructions in just one clock cycle, the PQ FP flatpack case. m em bers sp ecially d evelop ed for
‘SX’ Flash EEPRO M m icrocon trollers With in th is series, SGS-Th om son ap p lication s like con trollin g LCDs or
from Scenix are good for up to 50 MIPs, offers an EPROM, ROM and OTP ver- brushless motors.
w h ich m ean s th at th ey are 10 to 50 sion of each typ e. In th is w ay, a good
tim es faster th an a trad ition al 8-bit com p rom ise is reach ed betw een The ST9 Family
microcontroller. d esign flexibility an d low cost. Th e This series contains a number of micro-
Th e m ain ch aracteristic of th e SX, ch aracteristics sh ared by ST6 fam ily con trollers w h ich are gen erally
besid es sh ow in g n ew road s tow ard s members includ e a maximum operat- referred to as ‘8/16-bits’. Th e best
evolu tion for all u sers of 8-bit m icro- in g frequ en cy of 8 MH z, a p rogram known types are the ST90135 and the
con trollers, is th at it en ables ‘Virtual m em ory w ith a size betw een 1 an d ST90R158.
Peripherals’ to be created (the term was 8 kBytes, an d a RAM an d (for som e
obviously coined by Scenix). By virtue typ es) EEPRO M cap acity of 64 to The ST10 Family
of the unmatched performance of the 128 bits. The components that make up This series of 16-bit microcontrollers is
SX, th e Virtual Peripherals are basically th is series are sp ecified to last 300,000 often said to combin e th e ad van tages
software implementations of functions programming cycles, they have an on- of CISC and RISC. It comprises the fol-
th at w ou ld oth erw ise requ ire costly ch ip 8-bit A-D con verter, an SPI com - low in g in tegrated circu its: ST10R165,
an d d ed icated h ard w are (m ain ly patible serial interface, a UART, one (or ST10R163, ST10F163, (128 kBytes Flash
tim ers, PWM gen erators, an d oth er tw o) 8-bit tim ers w ith p u lsew id th m em ory), ST10R166, ST10F166 an d
serial ports). m od u lation , an d in terru p t d etection ST10F167. To th ese w ill be sh ortly be
Th ere are actu ally tw o typ es of SX on all inputs. ad d ed th e ST10R272L an d th e
con troller: easy to tell ap art, really, ST10F168. Clock frequ en cy is rated at
becau se th eir n u m ber of p in s is in d i- The ST7 Family u p to 20 MH z an d th e m em ory is
cated by th e typ e d esign ation , 18 for Th is is th e latest fam ily of m icrocon - 128 kBytes Flash . Th ese n ew con -
the SX-18 and 28 for the SX-28. trollers released by SGS-Th om son trollers are com p atible w ith th e C16x

Elektor Electronics 2/99 21


family from Siemens. d erived p rod u cts called Z8Plus. Th e m icrocon trollers is n oticed . Th ese
core of th ese con trollers p resen ts a devices are tailor-made to perform one
The ST20 Family number of advantages over the classic sp ecific fu n ction on ly, often h avin g
Th is is th e 32-bit fam ily of m icrocon - Z8 core. Th ese ad van tages in clu d e very sp ecific circu itry on board , as
trollers produced by SGS-Thomson. higher processing speed resulting from requ ired by th e ap p lication for w h ich
a lower system clock p re-d ivision fac- they were designed.
SIEMENS tor.
Th e C500 from Siem en s is on e of th e Wh en clocked at 10 MH z, con - Note
most interesting microcontroller series. trollers based on th e Z8Plu s core The editorial staff is grateful to all compa-
The latest addition is called C505L. This ach ieve a p erform an ce level equ al to nies and distributors who kindly responded
8-bit d evice is offered as a single-chip that of a classic Z8 running at 16 MHz. to our requests by sending technical docu-
solution. This processor, a d escend ant The first product is the Z8E001, an OTP mentation, illustration material or even
of th e gen eric 8051, is th e first to be device with 1 kBytes of program mem- complete evaluation kits (Atmel).
su p p lied w ith an on -ch ip LCD in ter- ory, a 64-bytes register array, 3 tim ers Special thanks are due to M r. Garidi of
face. (in clu d in g PWM) an d an an alogu e Atmel Southern Europe, Sonepar Electron-
Th e C505L is totally com p atible comparator, all in an 18-pin case. ique, M r. Hababou of SGS-Thomson and
with the industry-standard 80C51 and Z86144 Mrs Veronica Batchelor of Napier Partner-
80C52. It in tegrates a 32-kByte O TP Th is n ew p rod u ct offers 16 bytes of ship, the appointed Microchip press bureau.
memory, 512 bytes of RAM, a synchro- EEPRO M sp ace w h ich m ay be Illustrations in this article reproduced by
n ou s/asyn ch ron ou s serial in terface, ad d ressed in th ree d ifferen t w ays: (1) courtesy of SGS-Thomson and Microchip.
an d a very accu rate 10-bit A-D con - by u ser cod e, (2) extern ally by m ean s
verter boastin g a con version tim e of of tw o in terface p rotocols, or (3) in 990009-I
ju st 6 µs. Th e on -ch ip LCD con troller ‘EEM ODE’ w h ich allow s p rogram -
m ay d rive a 128-segm en t LCD (i.e., 4 m in g an d access on a byte-by-byte
lin es of 32 ch aracters); it h as 36 LCD basis.
ou tp u ts of w h ich 20 are reserved for
d isp lay fu n ction s. Th e rem ain in g 16 Th ere are m an y oth er m an u factu rers
ou tp u ts m ay be u sed as con ven tion al of microcon trollers, in clu d in g An alog
I/O lin es. At a clock frequ en cy of Devices, Arm, Fujitsu, Harris Semicon-
20 MH z, th e cycle p eriod is abou t d uctor, Hitachi, IDT, Mitsubishi, NEC,
300 ns. The real-time clock on the chip OKI, Samsung, Sharp and Texas Instru-
also su p p orts a power-down m od e in ments. Because of various reasons their
which the current consumption drops products could not be discussed in this
to ju st 50 µA (at a su p p ly voltage of survey.
3.3 V and a clock frequency of 32 kHz).
CONCLUS ION
TEMIC Based on cu rren t m arket ten d en cies,
Tem ic recen tly lau n ch ed th eir the outlook is: more computing power,
TSC8051i2, a new 8-bit microcontroller h igh er sp eed s. An in creasin g n u mber
which, according to the manufacturer, of d ed icated or ap p lication -sp ecific
integrates a multimaster I2C controller,
an alogu e PWM ou tp u ts an d a trad i-
tional watchdog circuit.
Th e tw o-w ire I2C bu s h as becom e
an industry standard mainly because it Int e rne t a ddre sse s
is so sim p le an d versatile. Th e Analog Devices : http://www.analog.com
TSC8051i2 con tain s a mu ltimaster I2C Arm : http://www.arm.com
controller which presents an economic Atmel : http://www.atmel.com
solution to designers wishing to imple- Cypress : http://www.cypress.com
ment the I2C bus. Dallas Semiconductor : http://www dalsemi.com
As indicated by its type number, the Fujitsu : http://www.fujitsu-ede.com
TSC8051i2 is based on the architecture Harris Semiconductor : http://www.semi.harris.com
of Intel’s 80C51. In addition to the mul- Hitachi: http://www.hitachi.co.jp
timaster I2C controller, the Temic micro IDT : http://www.idt.com
con tain s 8 kBytes of O TP/EPRO M or ISSI : http//www.issi.com
RO M, 256 bytes of RAM, 2 timers and Microchip : http://www.microchip.com
a UART. It ru n s at a clock rate of Mitsubishi : http://www.mitsubishi.com
24 MHz at 5 V, and will soon be avail- Motorola : http://www.mot-sps.com
able in a 3-V version cap able of ru n - National Semiconductor : http://www.national.com
ning at 16 MHz. NEC : http://www nec.com
OKI : http://www.oki-europe.de
ZILOG Philips : http://www.us2.semiconductors.philips.com/microcontrol
Samsung : http://www.samsungsemi.com
In th e w ake of th e fam ou s Z8 from
Scenix : http://www.scenix.com
Zilog are a n u m ber of follow-u p SGS-Thomson Microelectronics : http://www.st.com
d evices d esign ated ‘Z86’. Th is is qu ite Sharp : http://www.sharp-usa.com
a large family: Siemens : http://www.siemens.de/semiconductor
Z86C34/35/36/44/45/46, Z86E34/44, Temic : http://www.temic.de/e/index.htm
Z86144, Z8E001, Z86E02/C02/L02, Texas Instruments : http://www.ti.com
Z86E03/06/C03/06/L06/16, Zilog : http://www.zilog.com
Z86E04/C04/L04, Z86E08/C08/L08,
Z86E30/31/40, Z86C33/43, Z86C83/84. BTW an excellent search engine may be found at: http://www.800go.com.
Th ere also exists a n ew series of

Elektor Electronics 2/99 23


RADIO, TELEVISION & VIDEO

general-coverage
receiver
part 2 (final):
construction and operation

Since pub-
lishing the
first instal-
ment of this
article, consid-
erable interest has
been expressed in
the design by many of
our readers. As
always, however, the Before d iscu ssin g th e con stru ction of you may have to refer back to part 1 of
proof of the pudding the general-coverage receiver, we think this article.
it is fair to warn that the project should
is in the eating, and not be attempted by beginners without M AI N R E C E I VE R B O AR D
actually building the any experience in building RF circuits.
But that is not to say you may not try,
The design of the main receiver board
is sh ow n in Figure 4. Th is is a p retty
receiver is no mean assuming that you have considered the large board con tain in g m an y d iscrete
following conditions: com p on en ts. It is double-sided,
job. Fortunately, through-plated an d available read y-
ready-made PCBs are ❍ you can rely on a more experienced
‘ham’ to help you;
mad e from the Publishers (or through
a kit supplier).
available, and the ❍ you are cap able of w orkin g very As you will not have failed to notice,
accurately; th e top sid e of th e board acts as a
receiver is easy-going ❍ you are n ot u n d er th e stress of ground plane which serves to keep RF
on adjustment. meeting deadlines, say, for complet- interference (both radiated and picked-
ing a school project or GCSE assign- up) to a minimum.
ment; Start by mounting the lower-profile
❍ a set of plastic coil adjustment tools is parts on the board. As usual, check the
available; valu e an d , if n ecessary, orien tation of
❍ you are willing and able to obtain all each comp on en t before you mou n t it.
th e p arts as sp ecified , p referably For a ch an ge, th e low p rofile p arts
from a reputed kit supplier. in clu d e th e follow in g ICs: IC1
(TCA440), IC5 (MC145156), IC3
In th e follow in g d iscu ssion s it is (MC3317), an d IC4 (MB501L). Th ese
assumed that the constructor has rea- ICs are n ot m ou n ted in sockets to
sonable experience in build ing RF cir- ensure minimum stray capacitance and
cu its p rin ted -circu it board s. Also, for inductance around their pins.
Design by G. Baars, PE1GIC term s an d abbreviation s u sed h ere, Some components whose mounting

Elektor Electronics 2/99


24
980084-1
(C) ELEKTOR

Figure 4. main receiver board layout (solder side


d eserves sp ecial atten tion w ill be d is- Stretch the turns evenly to and top side). The ready-made board supplied by
cussed below. m ake th e coil en d s reach the Publishers is through-plated.
the holes in the PCB. Then
Inductor L21 d eterm in e th e p osition of
Th is con sists of 7 tu rn s of 0.5-m m d ia the tap, which should be connected at of foam p lastic or sim ilar m ay be
(SWG26) silver-plated wire. The inter- abou t 3 tu rn s from th e cold en d . A p u sh ed in to th e coil to red u ce m icro-
n al d iameter is 6 mm, so th e in d u ctor very short piece of wire installed using phonic noises due to vibration.
is easily w ou ld on a 5-m m d rill bit. tweezers will do the job. A small piece

Elektor Electronics 2/99 25


T
T
C22 S+
C1
C2 C4 C16 R16
R19
H1

C12
H2

C6 C8 C10 R67 T2 P3
R10 R20
C83 L10

D17
T1 R17 C25 L15 L16

L12
L8 C23 R28
C19 L14
D19 C28
L2

L13 C29
D14 R18

L11

R13
L1

L3

L4

L5

L6

L7

L9

C42
C26 D15

1
R11

R12
C36

C2
C104

R25
C27 R21
R15

C43
R7
C15 R14 C33 D16 R22
C18

IC1
C20 L17 C34 C32
C17 D18
D11

C41 C37 C30 C31


D1

D3

D5

D7

D9
D10

D12

C24
D2

D4

D6

D8

C14 C69 C67 C35 R68 R26


X1 C40
R8 R23
D13 C77 C68 C39 C45
R46 R45 R24

R44
T5 R27
C11

C13
C3

C5

C9

C44 R29 C46


C7

C75 C63
D25 D20 R30
R1

R2

R3

R4

R5

R6

C38 C54
C76 R53 C53 R41
T6 L21
C74 C55 C56

IC2
IC4 C47

R33
Q0 Q1 Q2 Q3 Q4 Q5 L18 C58 R37 D23

R47
C66
C61 C59

L22
R51 C64 X2

R31
C101 L23 C79 C48 C60
R40
R55

C78 R54 D24 R43 T3 C50 C62 L20


C82 C71 T4
C103 C100 C81 C70 R39
R48 R32

R49
IC7 IC5 C57 R38
D21

IC3
IC8 C72
R35 R36
R50
C49 D22 C52
0 +12V X3 R52 C73

H3
C51 R34
H4
SCLK
SDATA
SENABLE

C80
C102 C65 L19
980084-1

R62
1-480089

C91

C90
ROTKELE )C( C92 FM SSB AM
C86
C94
C96 T9

R63

R61

R60
R59
C84

C93
C98

R65
R64
H6

R9 R42 C85

R58
R57
R56
C97

T7
C89
R66 IC6 T10 T8 C88
LS1

H5
T
C99 P5 C87
P1 P2 P4 C95

COMPONENTS LIST Capacitors: Inductors:


Main receiver board C1 = 6pF8 L1,L2 = 1mH5
C2,C4,C6,C8,C10,C12,C26- L3 = 0mH82
Resistors: C30,C50,C60,C69,C72,C92,C95 = L4 = 120µH
R1-R6 = 330Ω 10nF L5 = 18µH
R7 = 1MΩ C3,C5,C7,C9,C11,C13- L6 = 3µH3
R8,R9 = 100kΩ C16,C20,C22,C25,C31- L7 = 0µH68
R10,R41 = 330kΩ C38,C43,C48,C54,C55,C57,C58,,C63, L8,L10 = 4µH7
R11,R14,R45,R52 = 33kΩ C66,C67,C70,C71,C76,C79,C82,C84- L9 = 0µH33
R12 = 680Ω C89,C98,C104 = 100nF Sibatit L11 = 0µH22
R13,R40,R46 = 15kΩ (Siemens) or miniature ceramic L12,L17 = 0µH56
R15 = 68kΩ C17,C18,C53 = 10pF L13 = 45M15AU (Murata)
R16 = 180Ω C19,C83 = 220pF L14,L18 = LMC4101 (Toko)
R17,R68 = 3kΩ3 C21,C42 = 22pF trimmer L15 = SFR455J (Murata)
R18,R63 = 1kΩ C23 = 15pF L16 = A55GGP (Toko) (12kHz)
R19,R20,R32,R33,R55 = 2kΩ2 C24 = 56pF L19 = YMCS17105R2 (Toko)
R21,R22,R25,R26,R59 = 10kΩ C39,C41,C56,C75,C77,C78,C94 = 1nF L20,L22 = 1 mH
R23,R24,R27 = 5kΩ6 C40 = 4pF7 L21 = 7 turns of 0.5mm dia (SWG26) sil-
R28 = 8kΩ2 C44 = 4µF7 16V radial ver-plated wire, internal dia. 6mm, tap
R29 = 39kΩ C45 = 2µF2 16V radial at 3 turns from cold end.
R30,R49,R64 = 12kΩ C46,C62 = 3nF3 L23 = 100µH
R31 = 220kΩ C47 = 47pF
R34,R35,R54 = 82kΩ C49,C51,C80 = 100pF Semiconductors:
R36,R43,R48,R50,R56,R57,R58,R60,R65 C52 = 2nF2 D1-D12 = BA479S
,R67 = 47kΩ C59 = 470pF D13,D14 = BB112
R37,R38,R39,R42 = 22kΩ C61,C90 = 22nF D15-D18 = BA182
R44 = 270Ω C64 = 150pF D19-D22 = BAT85
R47 = 560Ω C65,C74 = 220nF D23,D24 = BB509
R51 = 56Ω C68 = 5pF6 D25 = BAT82
R53 = 47Ω C73 = 1µF 16V radial T1,T2 = BF961
R61 = 560kΩ C81 = 40pF trimmer T3,T5 = BF245C
R62 = 3kΩ9 C91 = 4nF7 T4,T7,T8,T9 = BS170
R66 = 1Ω C93 = 3nF9 T6 = BFR91
P1,P2,P4 = 50kΩ linear potentiometer, C96,C99 = 220µF 16V radial T10 = BC549C
spindle dia. 4mm C97 = 1µF5 16V radial IC1 = TCA440 *
P5 = 50kΩ logarithmic potentiometer, C100-C103 = 10µF 63V radial IC2 = NE612AN
spindle dia. 4mm IC3 = MC33171P * (Motorola)
P3 = 10kΩ preset H IC4 = MB501-L * (Fujitsu)

26 Elektor Electronics 2/99


5

Figure 5. Top view of DG MOSFETs and BFR91 sh ort w ires.


receiver board, provi- The two dual-gate MOSFETs in the cir-
sionally mounted. cuit, T1, T2, are mounted at the under- Toko inductors
sid e of th e board . Make su re th ey are These having two pins at one side and
fitted the right way around — the com- th ree at th e oth er, th ey can n ot be
ponent overlay shows their (different!) mounted the wrong way around . The
orien tation s. Th e BF9xx series MO S- lu gs at th e can sid es sh ou ld also be
IC5 = MC145156-2 * (Motorola) FETs as supplied these days is no more sold ered .
IC6 = LM386N-3 sensitive to static discharges (ESD) than
IC7 = 78L05 an y common -or-gard en CMO S IC, so Potentiometers
IC8 = 78L09 no special precautions are required in Note that these are small types with a
this respect. Unusual as it may be that 4-mm spindle. Do not cut the spindles
Miscellaneous:
the type print on a particular MOSFET as yet, th eir len gth s h ave to be d eter-
M1 = moving coil meter, ‘S’ meter
type, fsd 0.1-1.5mA h ap p en s to be illegible from th e top mined accurately later.
Ls1 = 8 ohms, 1 watt sid e, it is irrelevan t! In oth er w ord s:
X1 = 44.545MHz crystal, HC49U stick to th e comp on en t orien tation as RF input
case, third overtone, 20pF loading in d icated . In case of d ou bt refer back Con n ect a sh ort len gth of th in (3-mm
X2 = CSB455A resonator the circuit diagram, Figure 2 in part 1. d ia.) coax cable (like RG174/U) to th e
X3 = 1MHz crystal, HC49U The BFR91 bipolar transistor is also RF input.
Case: Bopla laboratory instrument mounted at the underside of the board.
case, size approx. 223mm (w) x
72mm (h) x 199mm (d), Conrad
The longest terminal is the collector. 45M15AU first-IF filter
Electronics order no. 52 33 48-55 Th is m etal-en cap su lated com p on en t
Aluminium front and rear panel, order Trimmers h as th ree w ires, th e cen tre on e bein g
code 52 33 56-55 (2 off) Th e term in als of th e th ree trim m er grou n d ed . It can be m ou n ted eith er
capacitors on the board should be sol- way around.
* do not use an IC socket dered as quickly as possible to prevent
the heat of the solder bit deforming the You w ill n otice th at th e board allow s
For availability of special RF compo-
p late stru ctu re an d th e in tern al PTFE both 5 an d 7.5-m m p itch 100-n F
nents used in this project we recom-
mend contacting these suppliers m aterial. N ote th at on e trim m er, C21, ceram ic cap acitors to be m ou n ted
Cirkit Distribution Ltd (01992) 441306 is at the positive supply voltage. Set all (m ost are for d ecou p lin g). If you can
Mainline Electronics (0116) 247 7551 three trimmers to mid-capacitance. n ot get h old of th e ‘Sibatit’ cap acitors
BEC Component Distribution Ltd we used in the prototype, they may be
(01753) 549502 Preselector replaced with miniature ceramic ones.
The prototype was built with compo- N o sp ecial p recau tion s h ere, bu t d o Take your time to populate the main
nents supplied by m ake su re you d o kn ow th e valu e of receiver board — m an y m istakes are
Barend Hendriksen HF Elektronika
BV, P.O. Box 66, NL-6970-AB Brum-
each and every miniature choke before made as a result of hurrying. Figure 5
men, The Netherlands. Tel. (+ 31) you fit it. Also, the PIN diodes must be sh ow s on e of early p rototyp es of th e
575 561866, fax (+ 31) 575 565012, fitted the right way around! receiver board , p h otograp h ed from
email barendh@xs4all.nl above.
Quartz crystals
Con n ect th e tw o qu artz crystal cases CO N TRO L B O ARD
to th e grou n d p lan e by m ean s of a Th is bein g a fairly trad ition al m icro-

Elektor Electronics 2/99 27


+15V

+12V
0
IC5
6

C12
C10
D14

R6
M1
H11

1
2

+M -M
R7

C11

3
P1
H1

4
IC6

5
R8

T1
C13
Figure 6. Copper track

H12

H5X

H7X
layout and component

C8
mounting plan of the +B

-B
control board. Unlike
the main receiver

IC4
board, this one is sin-
gle-sided. Cut off the
keyboard section.
C6 C7

Q3 Q4 Q2 Q0 Q1 Q5
AM

IC2
IC3

SSB

COMPONENTS LIST

K1
Control board
FM

Resistors:
R1 = 4kΩ7 C14
R2,R3,R4 = 15kΩ
IC1

R5,R9 = 10kΩ
R3
R5

R2
R1
D1

R6 = 100Ω 0.5W
R7 = 150Ω
C2
C1

SCLK
R8 = 22kΩ
SDATA
P1 = 10kΩ preset H
H2X

SENABLE C5
H4

Capacitors:
C3

C1 = 27pF
C2-C8,C10,C12,C13,C14 = 100nF
R4

S1

C9 = 100pF
H20

C11 = 470µF 25V radial


C4

Semiconductors:
D1-D13 = 1N4148
D14 = 1N4001
R9
H19

H13

T1 = BS170
IC1 = PIC16F84-04/P (order code
K4
K2

C9

986517-1)
IC2 = 74HCT4017
IC3,IC4 = 4015
IC5 = 7812
IC6 = 78L05
980084-2
2-480089
980084-2

(C) ELEKTOR
ROTKELE )C(

Miscellaneous:
K1 = 14-way SIL socket
H18

H14

K2, K4 = 8-way SIL socket


K3, K5 = 8-way SIL pinheader
S1 = ECW1J-B24-AC0024 (Burr D2 D3 D4 D5
Brown) (supplier: Eurodis) H17 H10
S2

S3

S4

S5

S2-S13 = pushbutton, 1 make con-


K3

K5

tact, type D6-R-RD, plus cap type


D6Q-RD-CAP (ITC) (supplier: D6 D7 D8 D9
Eurodis)
S6

S7

S8

S9

LC display, 1 line, 16 characters, type


LM161556 (Sharp) (no backlight) or
type M16417DY (Seiko) (with back- D10 D11 D12 D13
light) (supplier: Eurodis)
S10

S11

S12

S13

PCB, order code 980084-2


H16 H15

processor board it is probably easier to prototype, in Figure 7. com p lete p roject from a kit su p p lier,
bu ild u p th an th e receiver board . Th e Like th e m ain receiver board , th e the PCBs and/or the programmed PIC
board is sin gle-sid ed . Th e d esign is control board is available read y-mad e m ay or m ay n ot be in clu d ed , so d o
sh ow n in Figure 6, an d ou r fin ish ed from th e Pu blish ers. If you bu y th e make sure you know what you get!

28 Elektor Electronics 2/99


7

Figure 7. Built up con-


Th e keyp ad section trol board. WI R I N G The layout also provides the size of all
h as to be cu t from th e Th e w ire con n ection s holes and rectangular clearances to be
main control board. betw een th e m ain cut. Unfortunately, a ready-made front
Th e m ain p oin t to n ote abou t th is receiver board an d th e con trol board p an el foil is n ot available from th e
board is that all components on it must are mad e in short lengths of flatcable. Publishers.
be m ou n ted at th e low est p ossible A 6-way cable is used for the ‘preselec- Th e rear p an el on ly h old s th e RF
height to enable the board to be prop- tor ’ cable (Q 0-Q 5), an d 3-w ay cables input socket (a BNC or SO239 type), an
erly fitted again st th e in sid e of th e for the serial bus (SCLCK, SDATA and external loudspeaker (or headphones)
fron t p an el later. If n ecessary, comp o- SEN ABLE) an d th e m od e selection socket and the mains adaptor socket.
nents IC5 and C11 are mounted at the (FM, AM, SSB). Sold er th ese cables at
sold er sid e of th e board . For th e rest, th e receiver board first, an d th en fin d AD J U S T M E N T
th e con trol board is con ven tion ally th e corresp on d in g p oin ts on th e con - Th e receiver is d esign ed su ch th at it
populated, i.e., you use IC sockets and trol board . Connect the w ires at the sh ou ld be able to receive stron g sta-
sim p ly follow th e p arts list an d th e solder side of the control board. Th is tion s w ith all trim m ers an d in d u ctor
com p on en t overlay. Th ere are, h ow - is not necessary for the LCD backlight cores set to mid-travel.
ever, a number of wire links which we connections, if used. To be able to adjust the receiver, you
recommend you fit first. Th e con troller board h as th e 12-V have to have the two PCBs temporar-
An important note we should make voltage regu lator on it, so it is con - ily connected to each other. Likewise, a
abou t bu ild in g th is board is th at th e n ected to th e m ain s ad ap tor ou tp u t. p ow er su p p ly, an d an ten n a an d a
switches, the LCD and the S-meter are Th e regu lated 12-V su p p ly voltage is lou d sp eaker are p rovision ally con -
m ou n ted at su ch a h eigh t th at th e S con n ected to th e receiver board . A n ected u p . Tu rn th e volu m e con trol
meter is flush with the front panel, the mains adaptor with a current rating of way down.
LCD is just behind it, and the switches 12 V at abou t 1 A w ill be fin e for th e O n ce you h ave ascertain ed th e
ju st p rotru d e. Th is m ay sou n d com - receiver. N ote th at alth ou gh an in p u t level an d th e p olarity of th e 15-V DC
p lex, bu t it is in fact fairly easy to voltage of 15 V is required, most mains su p p ly voltage, con n ect it to th e con -
achieve by inserting the control board ad ap tors actu ally su p p ly at least 15 V trol board and switch on.
in th e sm all vertical slots in sid e th e when set to 12 V. Start by adjusting the LCD contrast
case. These slots are specially made to The S meter is directly connected to using P1. Typically this preset has to be
h old vertically m ou n ted board s., an d th e receiver board (w ires to S+ an d turned almost fully ccw.
govern th e m ou n tin g h eigh t of th e ground). If the meter has internal light- Th e first tim e you sw itch on th e
previously mentioned elements. In our ing, then run two wires from the lamp receiver, m em ory 0 w ill con tain d ata
prototype, the LCD was mounted on a con n ection s to th e termin als + M an d that makes no sense and, worse, makes
SIL p in strip (K1) at abou t 12 m m –M on the control board. The same for manual tuning impossible. So, first pro-
above th e con trol board su rface. Th e the LCD backlight (if available), which gram m em ory 0 w ith m ean in gfu l
keyp ad su b-board w as m ou n ted at a is con n ected to term in als + B an d –B, in formation (see below u n d er O p era-
h eigh t of abou t 10 m m on tw o 8-w ay also on the control board. tion).
SIL pinheaders and mating sockets (K2 A lou d sp eaker m ay be m ou n ted Initially, we recommend tuning to a
an d K4). By ‘n u d gin g’ th e p in h ead ers insid e the case, or a socket may be fit- stron g m ed iu m -w ave (MW) ban d
in the sockets, the keytops can be made ted on the rear panel for connecting an broad cast station , say BBC Rad io 1.
to protrude about 1 mm from the front external loud speaker (often to be pre- Typ e th e frequ en cy in to th e d isp lay,
panel. ferred). confirm with # , and adjust the 1-MHz
Th e S m eter sits in a squ are clear- reference oscillator (C81) for highest S
ance cut in the controller board. O nce F RO N T PAN E L meter indication. Next, carefully adjust
its fin al p osition is kn ow n , it m ay be The layout of the front panel is shown the cores in L14 and L18 for best recep-
secured to the board with a few drops in Figure 8. As always you can use this tion , using a plastic trimmer tool (if
of glue. d raw in g as a tem p late an d a m aster you don’t have this, file down a plastic
for tran sferrin g on to a tran sp aren cy. egg sp oon or a match stick for oven s).

Elektor Electronics 2/99 29


TUNING
8 S FREQUENCY/ MODE
1 2 3

4 5 6

7 8 9
GENERAL COVERAGE
RECEIVER 0 #
PRESEL. RF GAIN BFO AM/ FM/ SSB 0.15 - 32 MHz VOLUME *
980084 - F

Figure 8. Front panel


layout shown at 75%
If th e sign al gets very of true size. P RACTI CAL con trolled tran sceivers, m an y h am s
stron g, ch an ge to a for- R E S U LT S u se a 1-kH z raster. Even if th is is n ot
eign broad cast or a Obviously this receiver the case, reception is possible by turn-
national one which you know you can can not be expected to perform like the ing the BFO so that a frequency shift of
only receive marginally. Now peak the latest £1k+ JRC com m u n ication s about 500 Hz is obtained.
oth er tw o trimmers, C21 an d C42, for receiver. O verall performance is quite Becau se m ost rad io am ateu rs u se
th e h igh est S m eter read in g, if n eces- good , h ow ever, p rovid ed you give relatively low p ow er levels (as com -
sary reducing the RF gain. The remain- som e th ou gh t to th e an ten n a. Even pared to broadcast stations), it pays to
in g in d u ctor in th e receiver, L19, is w ith a simp le telescop ic an ten n a, sta- use a relatively long wire antenna. The
ad ju sted for best au d io qu ality of an tions at distances of hundreds of miles author found that a wire with a length
FM CB station in th e 27-MH z ban d . could be received. The amount of dig- of abou t 5 m , h u n g betw een tw o
Failin g an off-air FM sign al you can ital in terferen ce cau sed by th e m icro- h ou ses, gave reason able resu lts
also ad just it for minimum aud io out- controller was found to be so low as to already.
put when receiving an AM station. present no problems at all. No wonder, Th e p rototyp e of th e receiver w as
the PIC is asleep most of the time! also successfully tested with the superb
O P E R AT I O N Radio amateurs in the 20, 40 and 80- Omega-2 and Omega-3 magnetic loop
The program developed by the author m etres ban d s u su ally em p loy SSB for an ten n as d escribed in th e Sep tem ber
and burnt into the PIC microcontroller voice com m u n ication . With th e BFO 1998 issue of Elektor Electronics.
(Publisher ’s order code 986517-1) pro- con trol on th e receiver set to abou t Fin ally, th e au th or w elcom es an y
vides easy operation of the receiver by m id -travel a BFO frequ en cy of abou t feedback you may want to provide on
driving the LCD and scanning the key- 455 kH z is obtain ed . Tu rn in g it clock- building and using the general-cover-
board . Th e keyboard allow s you to wise and anti-clockwise over about 90 age receiver described here. His email
enter the frequency you want, as well degrees then provides the right setting address is G.Baarst@hot.a2000.nl
as th e associated ban d w id th (3 or 12 for USB and LSB respectively. Because (980084-2)
kHz) and mode (AM, FM or SSB). The of th e w id esp read u se of syn th esizer-
LCD presents the following readout:

mmmb p fffff kHz


where
mm(m) = AM/FM/SSB (receiver mode)
b= n/w narrow or wide band-
width
p= 1–6 preselector band
fffff = 150 – 32000 receive frequency in
kHz

The keyboard functions are as follows:


fffff# enter frequency in kHz
01 select AM mode
02 select SSB mode
03 select FM mode
04 select narrow-bandwidth (3 kHz)
05 select wide bandwidth (12 kHz)
00 LCD backlight on/off (if available)
* mm# store frequency at memory location
mm
# mm# load frequency from memory loca-
tion mm

where
mm= 00 – 20; defaults to 00 when the receiver
is switched on
fffff = 150 – 32000 (kHz)

Elektor Electronics 2/99 31


WHEN ELECTRONICS WAS YOUNG (6A)
In 1837, the first elec- Another important contribution to electrical technology
tric motor was developed (and came from the French physicist Robert Louis Gaston Planté
patented) in the USA by Thomas (1834–89), who in 1859 developed the lead-acid cell, which was the
Davenport. A few years later, in world’s first practical rechargeable or secondary battery. In fact,
1839, the magnetohydrodynamic the lead-acid battery is even today the most widely used recharge-
battery was proposed by Michael able battery in the world.
Faraday in the UK; the photo- In the same year, Michael Faraday discovered that silver
voltaic effect was described in sulphide possesses a high negative temperature coefficient. This dis-
France by Alexandre Edmond covery forms the basis of what are now termed thermistors, that
Becquerel (1820–91), and the fuel is, temperature-sensitive non-linear resistors. The name thermis-
cell was invented by Sir W illiam tor was coined by the Bell Telephone Laboratories of the USA dur-
Robert Grove (1811–96) in the ing their research into materials for these components. Also in that
UK. year, one of the century’s foremost experimentalists, the English
In 1843, the Scottish in- physicist James Prescott Joule (1818–89) described magnetostric-
ventor Alexander Bain patented tion, a phenomenon in which the mechanical dimension of a mag-
what has become known as fac- netic material is altered as the magnetization is varied.
simile reproduction (fax), and in Perhaps the most able theoretician of the 19th century,
1845–47 the German physicist James Clerk Maxwell the Scottish physicist James Clerk Maxwell (1831–79), started his
Gustav Robert Kirchoff (1824–87) (1831...1879) monumental research on electromagnetism in the late 1850s. This
published the two famous laws laid the foundations for the work of the German physicist Heinrich
that are named after him. In 1847, George Boole (1815–64) pub- Rudolph Hertz (1857–94) in discovering radio waves. Maxwell’s
lished his first ideas on symbolic logic, although his major work, In- ‘equations’ (1864) form fundamental laws of theoretical physics
vestigation of the Laws of Thought was not published until 1854. that govern the behaviour of electromagnetic (radio; television)
The kind of symbolic algebra that Boole developed led to Boolean waves in all practical situations. The equations are used to analyse
algebras, which are, of course, of great significance in modern al- the propagation of radio waves in free space, at all sorts of bound-
gebra and computing. ary, and in all guided-wave structures or transmission lines. His
In 1852, thin film technology was introduced by Sir field equations are mathematical formulations of the laws of Gauss,
W illiam Robert Grove. In 1860, professor T J Wray gave a public Faraday and Ampère from which the theory of electromagnetic
demonstration of the mercury arc lamp on the Hungerford Bridge waves can be derived. The Maxwell bridge can be used for the mea-
in London, and in Germany, the physicist Johann Philipp Reis surement of capacitance and inductance. Maxwell’s Rule states that
(1834–74) developed the first microphone. Unfortunately, this mi- every part of an electric circuit is acted upon by a force tending to
crophone was considered a toy and quickly forgotten. move in such a direction as to enclose the maximum magnetic flux.

CORRECTIONS
& updates
Eye pattern meter gates in IC4 have been trans- 1N5401. If the charger always should be changed to read
PC Topics Supplement, posed to improve the PCB lay- supplies currents smaller than
March 1999, p. 13. (992002) out. Functionally, this is of no about 1 A, diode D9 may also Flash Designs, Ltd.,
The moving coil meter shown consequence. be an 1N4001 or similar. North Parade House,
in Figure 3 should have a sen- However, one track on the North Parade,
sitivity of 100-200 µA f.s.d. board is missing: that between Bath BA2 4AL.
pin 2 and pin 8 of IC1 General Coverage Receiver Tel. (01225) 448630.
(ADC0804). If this link is January & February 1999
Electronics Freeware added, C1 is effectively con- (980084). We extend our apologies to
May 1999, PC Topics Supple- nected and the circuit will work In the preselector section, the Flash Designs and our readers
ment, p. 4 (990011-1) as described. upper varicap diode, D14, has for any inconvenience caused
The correct url for Digital no dc path. A suggested by the incorrect address infor-
Works is method of improving the mation.
Sealed lead-acid battery behaviour of the varicap (with-
http://www-scm.tees.ac.uk/ charger out modifying the PCB) is to
users/d.j.barker/digital/ May 1999, p. 26-31. replace capacitor C83 (220pF) Electronic Spirit-Level
digital.htm (990037-1) with a wire link. July/August 1998, p. 36
In Table 2 (Component Values), (984038).
the two formulas for R6 should In the circuit diagram, all LEDs
Battery capacity read Flash Designs – (D2 through D10) should be
measurement by PC address information reversed. The PCB layout is all
PC Topics Supplement, 0.45 / I [ohms]. April 1999, New Products, right.
December 1998, p. 14-16. p. 73.
(982093) D9 is missing from the parts In the New Products section,
With reference to the circuit list. As indicated in the circuit the address and telephone
diagram, a number of logic diagram, this diode is a type number of Flash Designs

104 Elektor Electronics 7-8/99


The content of this note is based on information received from manufacturers in the
electrical and electronics industries or their representatives and does not imply prac-
APPLICATION NOTE tical experience by Elektor Electronics or its consultants.

precision current
gauges
with low-loss sense element
and PWM output

The LM3812/LM3813 1
current gauges from
National Semicon-
ductor are suitable
for application as bat-
tery charge/discharge
gauge, motion con-
trol diagnostics,
power supply load Figure 1. Typical application circuit of an LM3812 (high
sense). That of an LM3813 (low sense) is equally
monitoring and man- straightforward.
agement, and reset-
table smart fuse.
INTRODUCTION ture coefficient 2600 ppm °C–1).
Th e LM3812/LM3813 cu rren t gau ges A Delta Sigm a an alogu e-to-d igital
provid e easy-to-use precision current con verter is in corp orated to p recisely
measurement with virtually zero inser- measure the current and to provide a
tion loss (typ ically 0.004 Ω; tem p era- current averaging function. Current is

M a in pa r a m e t e r s
➩ Ultra low insertion loss (typically 0.004 Ω)
➩ 2–2.5 V supply range
➩ ± 2% accuracy at room temperature (includes accuracy of the internal
sense element) (LM3812-1.0, LM3813-1.0)
➩ Low quiescent current in shutdown mode (typically 2.5 µA)
➩ 50 ms sampling interval
➩ No external sense element required
➩ PWM output indicates the current magnitude and direction
➩ PWM output can be interfaced with microprocessors
➩ Precision delta-sigma current-sense technique
➩ Low temperature sensitivity
➩ Internal filtering rejects false trips
A National Semiconductor ➩ Internal power-on reset (POR)
Application

Elektor Electronics 2/99


38
averaged over 50 m s tim e p eriod s to
provide immunity to current spikes.
Th e d evices h ave a p u lse-w id th
2
modulated (PWM) output which indi-
cates the current magnitude and direc-
tion. The accuracy, including the accu-
racy of the internal sense element, is
better than± 2% at room temperature.
The shutdown pin may be used to
inhibit false triggering during start-up
or to en ter a low qu iescen t cu rren t
mode.
Th e LM3812 is u sed for h igh -sid e
sensing, and the LM3813 for low-side
sensing. The diagram of the LM3812 in
Figure 1 shows that the only external
com p on en ts n eed ed are tw o cap aci-
tors. Th e ap p lication d iagram of th e
LM3813 is equally straightforward.
Both ICs op erate from a su p p ly Figure 2. Functional
voltage of 2–5.25 V. Th ey are factory- block diagram of the
set in tw o d ifferen t cu rren t op tion s. LM3812/LM3813.
Th e sen se ran ge is –1 A to + 1 A or
–7 A to + 7 A. The sampling interval is
50 ms. If faster sampling is desired, ref-
erence should be made to the LM3814
and LM3815.
Th e d evices are available in eigh t
different versions in an SO 8 package.
In th e typ e cod in g LM381aXc-d , M
in d icates th at th e p art is available in
su rface m ou n t p ackage; a in d icates
high-side (= 2) or low-side (= 3); X indi-
cates that the part is available in mul-
tip les of 2500 on tap e or reel; c in d i-
cates the sampling time (c= P= 50 ms;
c= F= 6 ms), and d indicates the sense Pin description
ran ge (d = 1.0 for ± 1 A; d = 7.0 for 1 SENSE+ High side of internal current sense, also supply voltage (ground
± 7 A). in LM3813)
2 SENSE– Low side of internal current sense
O P E R AT I O N 3 FLTR+ Filter input provides anti-aliasing for delta-sigma modulator
4 FLTR– Filter input
Th e cu rren t is sam p led by a d elta-
5 SD Shutdown pin. Connected to VDD through a pull-up resistor for
sigma modulator as shown in Figure 2. normal operation.
The pulse density output of the mod- When low, the IC goes into a low-current mode (typically 3µA)
u lator is d igitally filtered . Th e d igital 6 PWM PWM output indicates the current magnitude and direction
output is then compared to the output 7 GND Ground
of a digital ramp generator, which pro- 8 GND Ground, but VDD in LM3813
duces a PWM output.
The duty cycle of the PWM is pro-
portional to the level of current flow- Figure 3. Typical timing diagram for mostly positive cur-
ing. A duty cycle of 50% indicates zero rent. The duty cycle of the PWM signal during any sam-
current. If the current is flowing into a pling interval indicates the current magnitude (average)
p ositive d irection , th e d u ty cycle and direction during the previous sampling interval.
> 50%; if it is flow in g in to a n egative
direction, the duty cycle < 50%.
A d u ty cycle of 95.5% (4.5%) in d i-
cates the current is at Imax (–Imax). The
3
IC can sen se cu rren t from –Im ax to
+ Im ax. O p tion s for Im ax are 1 A or
10 A. A typ ical tim in g d iagram for a
mostly positive current is given in Fig-
ure 3. The sense current is given by

I sen se = 2.2(D–0.5)(I m ax )

where D is the duty cycle of the PWM


signal and Imax is the full-scale current
(1 A or 10 A). Similarly, the duty cycle
is given by

D= (I sen se /2.2I m ax )+ 0.5.

Elektor Electronics 2/99 39


a b

Figure 4. Typical response of


an LM3812-1.0/LM3813-1.0 P
version (a) and F version (b).

N ote th at alth ou gh th e LM3812-7.0 exam p le, th e average cu rren t m ea-


an d LM3813-7.0 w ill read 10 A fu ll su rem en t is 502.3 m A. Th is valu e is
scale, they are rated for 10 A operation very close to th e actu al valu e of
for a duration of no more than 200 ms, 500 m A. Moreover, th e accu racy
and 7 A operation continuously. d ep en d s on th e n u m ber of read in gs
that are averaged.
OFFSET [990002]
The PWM output is quantized to 1024
levels, w h ich m ean s th at th e d u ty
cycle can ch an ge in in crem en ts of
1/1024 only.
Th ere is a on e-h alf qu an tization
cycle delay in the output of the PWM Source: Data sh eet ‘LM3812/LM3813
circuitry. That is to say that instead of Precision Current Gauge IC with Ultra
a d u ty cycle of n/1024, th e d u ty cycle Low Loss Sen se Elem en t an d PWM’
actually is (n+ 0.5)/1024. (National Semiconductor)
The quantization error can be cor- (www.natsemi.com/)
rected if a m ore p recise resu lt is
d esired . To correct for th is error, sim-
ply subtract 1/2048 from the measured
duty cycle.
The extra half cycle delay will show Electrical characteristics (VDD = 5.0 V, Supply bypass capacitor is 1 µF and filter capacitor is 0.1 µF)
up as a d .c. offset of 0.5 bit if it is not Symbol Parameter Conditions Minimum Typical Maximum Units
corrected for. This is about 1.1 mA for
1 A ICs, and 11 mA for 7 A devices. LM381aPM-1.0 0.882/0,864 0.9 0.918/0.936 A
LM381aFM-1.0 0.868/0.850 0.9 0.932/0.950 A
IACC Average current accuracy
AC C U RAC Y VS N O I S E LM381aPM-7.0 2.400/2.350 2.5 2.600/2.650 A
Th e grap h sh ow n in Figure 4 illu s-
LM381aFM-7.0 2.350/2.288 2.5 2.650/2.712 A
trates the typical response of ± 1 A cur-
ren t gau ges. In th is grap h , th e h ori- LM381aPM-1.0 2 mA
zontal (x) axis ind icates time, and the LM381aFM-1.0 12 mA
vertical (y) axis, the measured current en Effective output noise
LM381aPM-7.0 20 mA
(th e PWM d u ty cycle h as been con -
verted to cu rren t). Th e grap h sh ow n LM381aFM-7.0 120 mA
was generated for an actual current of Normal Mode 100 160 µA
500 mA. IQ1 Quiescent current
Shutdown Mode 2.5 10 µA
The difference between successive
readings manifests itself as jitter in the Precision Mode 0.1 %
DRES PWM resolution
PWM ou tp u t or n oise in th e cu rren t Fast Mode 0.8 %
measurement (when the duty cycle of Precision Mode 40 52 80 ms
the PWM output is converted into cur- ts Sampling time
Fast Mode 4 6 10 ms
rent).
Th e accu racy of th e measu remen t Precision Mode 12,5 20 25 Hz
fP Frequency of PWM signal
d ep en d s on th e n oise in th e cu rren t Fast Mode 100 160 250 Hz
w aveform . Th e accu racy can be VOH Logic high level for PWM Load current = 1 mA VDD - 0.2 VDD - 0.05 V
im p roved by averagin g several ou t-
VOL Logic low level for PWM 2V ≤ VDD ≤ 5.25V 0.04 0.2 V
p u ts. Alth ou gh th ere is variation in
su ccessive read in gs, a very accu rate PI Insertion loss ISENSE = 1 A 0.004 Ω
measurement can be obtained by aver- Notes: Specifications in standard type face are for a junction temperature Tj= 25 ∞C and those in bold type face apply over the
agin g th e read in gs. For exam p le, on full junction temperature range of –40 °C to + 125 °C.

averaging the read ings shown in this

Elektor Electronics 2/99 41


TEST & MEASUREMENT

datalogger for DMM


for Metex & Voltcraft DMMs
As you may know, the
combination of a PC
and a Metex or Volt-
craft DMM sporting a
serial interface may
be used as a record-
ing oscilloscope pro-
vided you leave the
PC switched on and
connected all the
time. Because that it
not always possible or
desirable, we present
a datalogger system
that can make do
without the PC.

Some of th e latest d igital mu ltimeters storage, and , if d esired , d isplays them


(DMMs) h ave an extrem ely u sefu l on an LCD. Relatively large d ata vol-
fu n ction : a serial in terface. By u m es m ay still be tran sferred to a PC,
Features lin kin g th is to a PC, you get a for p rocessin g later u sin g ‘big gu n ’
record ing oscilloscope for slow sp read sh eet/statistics softw are like
➭ Simple to operate
sign als. O n th e d ow n sid e, th e Excel.
➭ High accuracy
PC then has to be present at the An oth er m arked ad van tage of th e
➭ Supports all DMM measurement ranges
measurement location, and left system as described is that the use of a
➭ Compatible with Voltcraft and Metex DMMs
ru n n in g all th e tim e. Besid es, m u ltim eter en su res th at all m easu re-
➭ Data readout on internal LCD
th e DMM occu p ies th e serial ment ranges of the instrument in ques-
➭ Simple construction, low cost
port during the entire measure- tion are available w ith th e relevan t
Technical data m en t (w h ich m ay take several accu racy. Mu ltim eters w ith sp ecial
days to complete). These disad- measurement options like temperature,
Supply voltage van tages con sid erably com p li- p ow er an d so on fu rth er ad d to th e
Mains adaptor 9-12 V cate th e u se of th e DMM as versatility and appeal of the datalogger.
Battery 9 V PP3 d escribed , an d lim it its fu n c-
Average current drain 6.5 mA tionality. H A R D WA R E
Serial protocol (PC link) 1200/8/n/2 Th e d atalogger d escribed As you can see from the circuit diagram
9600/8/n/2
h ere avoid s th ese p roblem s. It in Figure 1, the datalogger is basically a
au tomatically cap tu res th e d is- ‘stan d -alon e’ m icrocon troller system
crete measurement values supplied by based on th e 80C31. Th e con trol p ro-
Design by R. Lock th e DMM, p u ts th em in p erm an en t gram is stored in a typ e 27C256

Elektor Electronics 2/99


44
5V
5V
1 C1 C4
5V

10µ 63V 100n 28 C6


IC2
R1 40 74HCT573 A0 10
100n
A0

10k
S1 39 AD0 AD3 2 19 A3 A1 9
P0.0 1D A1
9 38 AD1 AD2 3 18 A2 A2 8
RESET P0.1 A2
37 AD2 AD0 4 17 A0 A3 7 11 AD0
DWN P0.2 A3 D0
S2 1 36 AD3 AD1 5 16 A1 A4 6
IC3 12 AD1
P1.0 P0.3 A4 D1
2 35 AD4 AD5 6 15 A5 A5 5 13 AD2
P1.1 P0.4 A5 D2
3 34 AD5 AD4 7 14 A4 A6 4 15 AD3
UP P1.2 P0.5 A6 RAM D3
S3 4 33 AD6 AD6 8 13 A6 A7 3 16 AD4
P1.3 IC1 P0.6 A7 D4
5 32 AD7 AD7 9 12 A7 A8 25 17 AD5
P1.4 P0.7 A8 D5
ENTER 6 A9 24 62256 18 AD6
P1.5 A9 D6
7 30 11 A10 21 19 AD7
P1.6 ALE/P C1 A10 D7
8 1 A11 23
P1.7 21 A8 EN A11
P2.0 A12 2
22 A9 A12 20
C8 12 P2.1 A13 26 CS
INT0 23 A10 A13
13 P2.2 A14 1
INT1 24 A11 A14
100n P2.3
14 T0
25 A12 OE WR
15 P2.4
T1 80C31 26 A13 22 14 27
K1 P2.5
27 A14
P2.6
28 A15
P2.7
17
RD
10 16
RXD WR
11 TXD 29
2x 16 CHAR

PSEN 5V
31
P1 EA/VP
X1 X2
5V
20 19 18
X1 C7
10k 1 28
LCD

20 VPP
A0 10 100n
C3 C2 C5 A0
IC2 A1 9
A1
33p 33p 100n
A2 8
10 A2
11,0592MHz A3 7 11 AD0
A3 D0
5V A4 6 IC4 12 AD1
A4 D1
A5 5 13 AD2
5V A5 D2
R4 D3 A6 4 15 AD3
A6 EPROM D3
4k7

A7 3 16 AD4
R6 A7 D4
BAT85 A8 25
A8 27C256 D5
17 AD5
100Ω

A9 24 18 AD6
K2 A9 D6
BC547B T2 R2 S4 A10 21 19 AD7
R5 BT1 A10 D7
5V ON/OFF
4k7

1 A11 23
4k7 78L05 A11
6 A12 2
D1 K3 3 LP2950-5 A12
2 T1 A13 26
9V D2 IC5 5V A13
7 2 A14 27
A14
3
1N4148 1N4001 CS OE
8
BC557B 1 20 14 22
4 C9 C10
R3
9
4k7

5 470µ 100µ
16V 10V

990024 - 11

Figure 1. The datalog-


EPRO M w ith a size of ger consists of an su res are requ ired to op tion s you can p oin t to w ith th e
32 kBytes. A 62256 80C31 microcontroller safegu ard th e RAM arrow keys.
RAM w ith th e sam e system with RS232 data against corruption To p erform a m easu rem en t, con -
size is em p loyed for and LCD interfaces. by p ow er d isru p tion s. nect-up the supply voltage, switch off
storage of the measure- Th e low-d rop voltage th e DMM, con n ect th e d atalogger to
m en t d ata. Th e m icro- regulator type LP2950-5 th e DMM, an d th en switch th e DMM
con troller is clocked by an can be relied upon to completely drain on again. After starting the datalogger,
11.0592 MH z qu artz crystal. Th is fre- th e battery to th e last m icroam p ere- you will see the menu options
qu en cy m ay seem od d , bu t is d oes h ou r. In case th e d atalogger is to be
allow standard baudrates to be derived powered by the mains adaptor only, a MAI N MENU
easily. N etw ork R1-C1 p rovid es th e more conventional fixed-voltage regu- >Dat a r et r i eval
p ow er-u p reset sign al. Th e alp h an u - lator like the 78L05 may be used. In the >Measur i ng
m eric d isp lay is con trolled in 4-bit in active state, th e circu it d raw s a qu i-
mode via serial port 1. escen t cu rren t of abou t 6.5 m A. With H avin g selected th e op tion Measur -
The RS232 interface in the datalog- battery life in mind, it is fortunate that i ng and having pressed the Enter key
ger is a m in im u m -h ard w are d esign the average current d rain of the d ata- the following information appears on
consisting of a transistor buffer/inverter logger is n ot m u ch h igh er. Wh en a the display:
on th e TxD lin e an d a level con - measu remen t takes p lace, th e cu rren t
verter/in verter, also tran sistorised , on d rain briefly rises to ap p roxim ately Sampl i ng P 00: 02
the RxD line. 20 mA. Ent er mi nut es
The supply circuit allows the d ata-
logger to be p ow ered by a con ven - O P E R AT I O N You are p rom p ted to en ter th e m ea-
tion al m ain s ad ap tor. By m ean s of The first thing to do after switching on su rem en t in terval (P); th e h igh est
diodes D2 and D3, an external battery is the circuit is ad just preset P1 until the value allowed is 99 minutes and 99 sec-
‘OR-ed’ into the circuit, in parallel with text on th e LCD is clearly legible. Th e on d s. (99:99). Use th e arrow keys to
th e m ain s ad ap tor. Wh en th e ou tp u t first text to ap p ear w ill be DMDLE12. select th e m in u tes valu e, th en p ress
voltage from th e m ain s ad ap tor fails, Th e d atalogger is op erated w ith th e Enter. This menu appears:
th e battery takes over as th e p ow er arrow keys and the Enter key. The lat-
supply. In this way, a no-break power ter selects between the various menus, Sampl i ng P 00: 02
supply is created, and no further mea- and confirms the selection of the menu Ent er seconds

Elektor Electronics 2/99 45


COMPONENTS LIST
2 Resistors:
R1 = 10kΩ
R2-R5 = 4kΩ7
R6 = 100Ω
P1 = 10kΩ preset

Capacitors:
C1 = 10µF 63V radial
C2,C3 = 33pF
C4-C8 = 100nF
K1
C9 = 470µF 16V radial

T
P1
H2

H3

C10 = 100µF 10V radial

DOWN
C1
C2

UP
ENTER
C8
X1 K2 Semiconductors:
D1 = 1N4148
C3

R1
D2 = 1N4001

T2
IC1 D3 = BAT85

R4
T1 = BC557B

R5
T2 = BC547B

R6
IC1 = 80C31, 80C51 or 87C51 (40-
R3
C7 pin DIL case
IC2 = 74HCT573
D1 IC3 = 62256 (e.g. UMC62256E-70LL)

T1
R2
C4

IC4 IC4 = 27256 (order code 986522-1)


C6 IC5 = 78L05 or LP2950-5 (see text)

IC5
C10 Miscellaneous:
K1 = 14-way IDC connector for flat-
cable
IC2

S4
IC3
C5

C9 K2 = 9-way sub-D pinheader, angled


pins, PCB mount
K3 = mains adaptor socket
D3
D2

S1 = pushbutton, 1 make contact,


CTL3 (Multimec)
1-420099
ROTKELE )C( 9V K3
S4 = Slide switch, 1 x on
+

990024-1 X1 = 11.0592MHz quartz crystal


H1

H4

Plastic case, approx. size 145 x 90 x


28 mm (Pactec type HP)
LC display, 2 lines of 16 characters,
(C) ELEKTOR
e.g., LTN 211 R-10 (Philips) or
990024-1 LM16A211 (Sharp)
PCB, order code 990024-1

th e d isp lay w ill th en sh ow th e p revi-


ou sly cap tu red set of d ata, w ith th e
current measurement time on the sec-
ond line, for example,

DC 00. 00 V
00: 00: 08

Th e clock con tin u es to tick an d is


u p d ated every secon d . Th e m easu re-
m en t valu e in th e u p p er lin e is
updated depending on the previously
set sampling interval. The longest mea-
surement period is 100 hours less one
second.
If n o m u ltim eter is con n ected , th e
m icrop rocessor w ill ‘h an g’. To start a
m easu rem en t an yw ay, you p ress th e
Enter key.
Figure 2. The printed A m easu rem en t m ay be en d ed by
circuit board is easily Enter the desired no. of seconds of keep in g th e En ter key p ressed for
mounted in a case the measurement (sampling) interval, more than 1 s. Cancelling is confirmed
with a display window. and press Enter again. The next when the display indicates
prompt appears: STOP
Th e last d ata set an d th e associated
START y time mark are then ‘frozen’. By press-
MEASUREMENT? n in g th e En ter key again you are
returned to the main menu.
Press ‘y ’ to con tin u e. Th e first lin e of Tran sferrin g m easu rem en t d ata

46 Elektor Electronics 2/99


shaking lines. The construction of this
Simplest null-modem link
3 Set handshake to NONE
so-called null-modem (or zero-modem)
cable is illustrated in Figure 3.
D9 D25 D25 D9
DMMs with an RS232 interface are
3 2 TxD TxD 2 3
designed for direct connection to a PC.
2 3 RxD RxD 3 2
Th e serial in terface on th e PC m ay
h ave a 9-p in or a 25-p in con n ector. In
th e first case, p in 3 is th e ou tp u t, an d
pin 2, the input. The pin numbers are
5 7 SG SG 7 5 reversed on the 25-way connector! This
is taken into account in the serial cable
for the multimeter, no matter if a 9-pin
or 25-pin connector is used.
Basically there is only one-way data
traffic betw een th e PC an d th e d ata-
Full null-modem link
logger. The DTR signal on pin 4 (DB25:
p in 20) of th e PC con n ector in d icates
D9 D25 D25 D9 th at th e PC is read y to receive n ew
3 2 TxD TxD 2 3 data. The same applies to the RTS sig-
2 3 RxD RxD 3 2 n al on p in 7 (DB25: p in 4), w h ich is
7 4 RTS RTS 4 7 activated by th e PC to in d icate th at it
8 5 CTS CTS 5 8 wants to send data. Because many dig-
6 6 DSR DSR 6 6 ital multimeters require these two sig-
5 7 SG SG 7 5
nals to be able to upload logged data to
1 8 DCD DCD 8 1
a PC, p in 4 of K2 on th e d atalogger is
started to + 5 V, w h ile p in 7 is con -
4 20 DTR DTR 20 4
nected to ground.
At th e PC sid e, you m ay u se ju st
990024 - 12 abou t an y com m u n ication s p rogram ,
in clu d in g th e p op u lar
Figure 3. All about H yp erTerm in al u tility
zero-modem cables. which comes with Win-
from th e d atalogger to th e PC is even Out put - - > PC d ow s 95. Select th e
sim p ler. In th e m ain m en u you select CO M p ort an d th e fol-
Dat a r et r i eval . By p ressin g th e low in g com m u n ication p aram eters:
u p /d ow n arrow keys you call u p th e CONSTRUCTION 1200 bits/s or 9600 bits/s, 8 databits, no
following options: The design of the printed circuit board p arity, 2 stop bits an d hardware p roto-
shown in Figure 2 is pretty spacious, so col. A zero-modem cable with no more
>> Di spl ay constructing the datalogger and fitting th an th e tw o d ata lin es an d grou n d
>> PC numer i cal it in a ‘w in d ow ed ’ p lastic case sh ou ld will also work. The datalogger does not
>> PC al phanum. not present undue difficulties. em p loy h an d sh akin g, so you select
All ICs may be fitted in sockets. Do none for the protocol. Incid entally, the
Selectin g th e first op tion cau ses th e not forget the 13 wire links on the sin- data exchange between the datalogger
m easu rem en t valu es to be sh ow n on gle-sid ed board , an d m ake su re all an d th e DMM em p loys a d ifferen t
th e d atalogger LCD, w ith th e arrow p arts are m ou n ted th e righ t w ay com m u n ication s p rotocol: 7 d atabits,
keys available to scroll th rou gh th e around. With everything in place, give no parity, and 2 stop bits.
data sets. th e board a th orou gh visu al ch eck, Th e au th or u sed th e d atalogger in
Th e oth er tw o op tion s cau se th e lookin g for cold join ts an d sold er com bin ation w ith a Metex M-3610-D
data sets to be sent to the PC, either in splashes. and a Voltcraft VC 506. The prototype
n u m erical or alp h an u m erical form at. circu it bu ilt in the Elektor Electronics
Before that can be done however, you CONNECTING -UP design lab was successfully tested with
h ave to select th e d ata sp eed in th is Th e DMM an d th e PC are h ooked u p a Metex M-3650-CR. O th er DMMs of
menu to on e an d th e same th e 9-w ay su b-D th e same tw o bran d s can be exp ected
connector on the datalogger board, but to support the same protocol.
>>> BAUDRATE not simultaneously, of course. Like the (990024-1)
>>> 1200 baud serial port connector on a PC, this con-
>>> 9600 baud n ector is a p lu g, so th at th e DMM is
easy to con n ect. Con n ectin g th e PC
O n ce th at h as been d on e, you m ay h ow ever requ ires a sp ecial cable: it
lau n ch th e d ata u p load op eration by sh ou ld h ave sockets at both en d s, as
confirming the option w ell as crossed TxD, RxD an d h an d -

Elektor Electronics 2/99 47


MICROPROCESSORS

SX-microcontroller
evaluation system (1)
part 1: introducing
the Scenix SX micro

Design by Dr. M. Ohsmann

With a PC-like RISC


architecture and offering
clock frequencies up to
100 MHz, the new SX
processors from Scenix are currently the fastest 8-bit microcontrollers
around. Unfortunately, the cost of the development kit supplied by Paral-
lax is on the high side to say the least, and that is why we present an
alternative for home construction. The system consists of a program-
ming adaptor, an assembler, two demonstration boards and a variety of
example programs.
Elektor Electronics 2/99
48
1

Figure 1. SX microcon-
Scenix recently released troller architecture. ou tlin e; Typ e Th e in tern al arch itectu re of th ese
the first devices from of SX18AC/DP = DIL p rocessors is sh ow n in Figure 1. Th e
a n ew series of 8-bit microcon trollers. case), or in a 20-p in SSO P case (Typ e processor has several clock oscillators,
Although these early products are still SX20AC/SS). w h ich w ill be d iscu ssed in d etail fu r-
flaw ed by th e od d bu g, th ey allow The larger brother has port C avail- ther on in the series.
designers to get cracking. As far as raw able on pins. It comes in three different An in tern al low-p ow er oscillator
sp eed is con cern ed , th e n ew Scen ix 28-pin cases (SX28AC/SO = small out- m ay be u sed , or an extern al qu artz
products are currently the fastest 8-bit lin e; SX28AC/DP = DIL case, crystal or RC n etw ork m ay be con -
m icrocon trollers you can bu y. At a SX28AC/SS = small scale). The 75-MHz n ected . Next, w e h ave a ÷4 p rescaler.
clock frequ en cy of 50 MH z, th e stan - an d 100-MH z version s h ave th e If this is bypassed, the so-called Turbo
d ard version rockets alon g at a sp eed resp ective typ e d esign ation s Mode is selected, which guarantees the
of 50 MIPs (million instructions per sec- SX28AC75/DP and SX28AC100/DP. fastest program execution. The instruc-
on d ). Mean w h ile, th e first sam p les of
75-MH z version s h ave arrived , an d a
100-MHz version is in the pipeline.
Th e p rice, too, is righ t at less th an Table 1 SX Evaluation System Hardware and software overview
4 US dollars per unit for volume quan-
tities. On the down side, development PICKALOCK Programming adaptor for in-system serial programming
kits, assem blers an d p rogram m in g (ISP) of Scenix SX controllers
ad ap tors for th e SX series are p riced PICKLOC1.DOC Documentation of the PC/PICKALOCK interface
w ell over 250 US d ollars. As you can
see from Table 1, Th e d evelop m en t SX-Demoboard 1 Demonstration board for the SX28AC controller
system w e h ave in m in d is far less SX-Demoboard 2 Demonstration board for the SX18AC controller
costly, an d com p rises ju st abou t an y-
th in g you n eed for a h ead start w ith SXASM.PAS Assembler for SX controllers; source code (Pascal 5.0)
the extremely fast ‘SX’ microcontroller. SXASM.EXE Assembler for SX controllers (executable program)
Datash eets of th e SX p rocessors SXASM.DOC Documentation with assembler
m ay be d ow n load ed from th e Scen ix
w eb site at w w w.scen ix.com . Th ere SXPRO.PAS PC shell for SX-PICKALOCK; source code
you will also find the errata sheets for SXPRO.EXE PC shell for SX-PICKALOCK
the earliest chips. This information was SXPRO.DOC Operation manual
obviously taken into account while the
p resen t d evelop m en t system w as TIPS.DOC Tips for faultfinding
designed.
LED1.SRC Example program: LED flasher using 16-MHz crystal
THE S X PROCES S OR IRC1.SRC LED flasher using internal RC oscillator
FAM I LY RC1.SRC LED flasher using external RC oscillator
As we write this, the SX series consists SERIO1.SRC Serial hexadecimal I/O foe test purposes
of ju st tw o m em bers, w h ich d iffer in SERPWM1.SRC PWM/ADC and LED control
resp ect of th e n u m ber of p orts. Th e SINGEN1.SRC Sine wave generator, 1 kHz, PWM
sm aller version d oes n ot h ave p ort C SINGEN2.SRC ine wave generator, 455 kHz, using R-2R DAC
bon d ed ou t to p in s. It is available 18- MIW1.SRC Multi-wakeup test
p in cases (Typ e SX18AC/SO = sm all

Elektor Electronics 2/99 49


vid u al ou tp u t lin e is cap able of su p -
2 SX programming SX processor plying up to 30 mA for ‘high’ as well as
adaptor ‘low ’ levels. Th is en ables LEDs to be
12V5 d riven d irectly. Th e ch ip arch itectu re
OSC1 also comp rises an an alogu e comp ara-
tor. Th is su b-circu it m ay be in terro-
gated via p ort B, an d sh ou ld en able
efficient communication with analogue
peripherals to be set up quite easily.

OSC2 THE KEY TO THE S X


For your first experiments with a new
p rocessor you obviou sly n eed a p ro-
grammer, an evaluation board (prefer-
ably several) an d softw are (assembler
an d th e like). Alth ou gh th e SX starter
kit from Parallax
(w w w.p arallaxin c.com ) also offers
d ebu ggin g tools an d a d evelop m en t
990018 - 11
system , it is far m ore exp en sive th an
Figure 2. Principle of in-circuit comparable starter kits for other mod-
serial programming (ISP) of ern m icrocon trollers. Th e Parallax
tion s h ave a w id th the SX controller by way of ation s are p er- starter kit contains the so-called SX-key,
of 12 bits and arrive the two oscillator pins on the form ed w ith th e w h ich is basically a p rogram m in g
by way of a 4-stage chip. aid of the W regis- in terface th at en ables p rogram s to be
Pip elin e. Th at is ter. To add two val- downloaded into the processor. Unfor-
why branch (jump) u es load ed from tu n ately, th e SX-key is n ot su p p lied
instructions take more than one clock m em ory, you n orm ally n eed tw o sep arately. Th e fairly h igh cost of get-
cycle to execu te, after all, th e p ip elin e instructions. That is the hallmark of the tin g started w ith th e SX m icro
contents has to be handled first. RISC instruction set — complex oper- p rom p ted th e au th or to d esign h is
Th ere is an in tern al, in d ep en d en t ations are simply implemented by call- own programming adaptor called SX-
watchdog circuit which is useful if not ing in the help of several RISC instruc- PICKALO CK. Alth ou gh it d oes n ot
essential for no-break systems. An 8-bit tions. in clu d e a p rogram d ebu ggin g facility
timer is available with somewh at lim- Th e p rocessor core em p loys an (th e Scen ix d ebu g in terface is p rop ri-
ited possibilities, although that is easily internal 136-byte RAM, whose contents etary), th e system as d escribed h ere
com p en sated by th e h igh p rocessin g m ay be ad d ressed by m ean s of RISC d oes allow you to get started an d
sp eed of th e SX. Th e in terru p t u n it is ban k-sw itch in g comman d s. Th is p ro- apply debugging techniques you may
triggered by this timer or the wake-up ced u re sh ou ld be fam iliar from PIC alread y kn ow. So h ow is th e SX ch ip
u n it in Port B. In th is w ay, level p rogram m in g as d escribed by programmed?
ch an ges on th e 8-bit Port B m ay be Microch ip . Th ose of you w h o ‘grew
su ed to requ est in terru p t servicin g. A up’ with the 8051 may find this a little IN-CIRCUIT
w elcom e extra in th is arran gem en t is unusual, though. The program is con- S X P RO GRAM M I N G
th e con stan t laten cy of 60 n s at a tained in a 2-kword (12-bit wide) EEP- Scen ix h ave d esign ed an in gen iou s
50 MH z clock rate, w h ich gu aran tees RO M, w h ich m ay be accessed exter- protocol that enables the SX processor
jitter-free interrupt servicing. This use- nally by way of the ISP interface. More to be p rogram m ed via th e tw o p in s
fu l featu re is fou n d on very few real-w orld con n ection s are available n orm ally con n ected to th e qu artz
processors indeed. th rou gh p orts A, B an d C, w h ose crystal! Usin g su itably d esign ed cir-
A n u m ber of registers is available, inputs can be set up as Schmitt-triggers cu itry it is even p ossible to ap p ly th e
in clu d in g W, FSR, PC an d STATUS, or made to respond to different levels. protocol without removing the crystal
w h ich serve to select op tion s — th ey Th e ou tp u t lin es offer even m ore from the circuit. In other words, in-cir-
m ay be u sed as register p oin ters or op tion s an d sh ou ld be su itable for a cuit serial programming (ISP) is a real-
au xiliary registers for th e arith m etic vast number of applications. Any indi- ity w ith th e SX.
logic unit (ALU). The arithmetic unit is
capable of performing 8-bit subtraction
and addition. Special attention should
be given to the ‘carry ’ bit. By means of Table 2
an op tion you ch oose d u rin g p ro-
gramming, the carry bit is either taken Bits Command
into account or ignored. This will take C3 - C0 hex
som e gettin g u sed to, an d requ ires
strict d iscipline, particularly with pro- 1111 = 0F NOP (idle)
gram parts you have not written your- 0000 = 00 ERASE clear all EEPROM cells
self. 0001 = 01 READ-DEV read device word
Th e regu lar logic com bin ation 0010 = 02 READ-FUSEX read FUSEX word
op tion s are all available. A h ard w are 0011 = 03 PROG-FUSEX program FUSEX word with LOAD-REG
multiply unit is, however, not found in 0100 = 04 LOAD copy data into LOAD-REGister
the SX.
0101 = 05 PROG store data from LOAD-REG into current
The instruction set contains a large
n u m ber of in stru ction s for bit testin g address
an d settin g, so th at bit m an ip u lation 0110 = 06 READ read data from current address
an d logic in terrogation s are easily 0111 = 07 INC increment current address
implemented. Most transfers and oper-

50 Elektor Electronics 2/99


3 SYNC C3 C2 C1 C0 D11 D10 D9 D8 D0 SYNC

IDLE
FRAME

IDLE
FRAME "0" "1" "1" "0" "1" "0" "1" "0" "1" "0"
1 cycle

1 frame

T0 T1 T2 T3

128 kHz Clock

HIGH
SYNC cycle
LOW

HIGH Figure 3. The serial program-


"1" cycle
LOW ming employs a clever proto-
col based on frames consist-
"0" cycle ing of 17 cycles.

generated by transmitter
generated by SX CHIP
990018 - 12
receiver sample taken here

Figure 2 shows the basic circuit that high in the parts called T0, T2 and T3, C0 = 0110, D11-D0 = 10101…0.
gives the PICKALOCK access to the SX an d low in th e p art called T1. In a ‘0’
processor. To switch the SX chip to ISP cycle, th e O SC2 sign al is h igh d u rin g TRAN S M I S S I O N S P E E D
mode, the voltage at the OSC1 pin has the T0 part, and low in the T1, T2 and The documentation supplied by Scenix
to be raised to 12.5 V. First, h ow ever, T3 parts. The currently active transmit- via their web site states that each inter-
the internal SX oscillator has to be dis- ter defines the state during the T2 and val of T0 to T3 equals a 128-kHz clock.
abled as described in the ISP specifica- T3 parts. The receiver interrogates the In other words, a cycle has a length of
tion which may be found in the docu- level at th e O SC2 in p u t on th e tran si- 4/128,000 seconds or 31.25 (s. On a cou-
mentation supplied by Scenix. tion from T2 to T3. When the SX-PICK- ple of early processors (data code 9818)
Once in ISP mode, the SX processor ALO CK id les, i.e., d oes n ot execu te a clock rate of about 105 kHz was mea-
starts an internal oscillator which con- command s, and the SX chip is in pro- sured. Apparently the internal oscilla-
trols th e com p lete tim in g of th e p ro- gram m in g m od e, th e latter alw ays tor which creates the clock signal was
gram m in g sequ en ce. Data is th en tran sm its fram es con sistin g of a syn c a bit too slow. A sim ilar p oin t w as
exch an ged via th e O SC2 p in , w h ich cycle an d 16 ‘1’ cycles (IDLE fram e in fou n d in th e Errata sh eets abou t th e
acts as a kin d of op en -d rain bu s Figure 3). in tern al RC oscillator w h ich m ay be
together with the O SC2 connection of Th is fram e allow s th e SX-PICK- u sed to clock th e oscillator. Accord in g
th e SX-PICKALO CK an d an in tern al ALO CK to fin d ou t w h en th e fram es to Scenix, 3.2 MHz was reached instead
pull-up resistor inside the SX chip. start. O nce frame synchronisation has of 4 MH z, an d d oin g th e su m s,
been achieved, the SX chip and the SX- 128 kHz x 3.2/4 = 102 kHz, provides a
T W O - WA Y PICKALO CK are read y to start good explanation of the actually mea-
D ATA T R AF F I C exchanging data and commands. Each su red clock rate. Th e u p sh ot w as th at
The serial protocol is based on frames fram e alw ays ‘m oves’ 12 bits of d ata, th e PICKALO CK h ad to be d esign ed
con sistin g of 16 d ata bits. A fram e is an d 4 bits of com m an d in form ation . su ch th at it w ou ld be able to h an d le
divided in 17 cycles, the first one acting Th e first fou r bits (C3 th ou gh C0) in a different bit rates. The current version
as a syn ch ron isation aid . Th e remain - fram e are th e com m an d bits (MSB- accep ts bit rates betw een 95 kH z an d
in g 16 cycles p rovid e th e actu al d ata first). These are always transmitted by 140 kHz, which should be sufficient for
tran sfer. Th e system is illu strated in th e SX-PICKALO CK. Dep en d in g on most, if not all, practical purposes.
Figure 3. th e com m an d , th e n ext 12 bits th en (990018-1)
Every in d ivid u al cycle con sists of travel from th e SX ch ip to th e PICK-
four equally long parts, T0 through T3. ALOCK, or the other way around. The In next month’s instalment we will describe
There are three types of cycle. In a sync available com m an d s are listed in the construction and practical use of the
cycle, th e O SC2 sign al is h igh all th e Table 2. Figu re 3 in d icates a READ SX-PICALOCK, and the demo boards will
tim e. In a ‘1’ cycle, th e O SC2 sign al is frame with the following bit levels: C3- also be described.

Elektor Electronics 2/99 51


COMPUTERS

wave file player


a music box that you can
program with your PC
Spe cifica tions
Controller: Atmel AT90S2313
Memory: 2 Mbit flash ROM
D/A converter: 12-bit
Filter: 5th-order switched-capacitor
Serial interface: RS232
Serial format: 57k6, 8N1 *
Sampling frequencies:6, 8, 11.025 & 22.05 kHz
Playback: monophonic
Word size: 8 or 16 bits
Playing time: 8 to 43 seconds
Amplifier: 1 watt bridge
* see text

The wave file player is yet another circuit that Using modern electronic components,
it is p ossible to p ack a lot of fu n ction s
offers the prospect of several hours of enjoyable on to a relatively sm all circu it board .
Th e circu it is also based on existin g
tinkering. The PC and the soldering iron work as stand ard s. In practice, this means that
partners on this project. You have to admit that the controller works with ‘wav’ (wave)
files. Th ese are fam iliar to every PC
this is an Elektor project in its best form. The u ser. An oth er im p ortan t factor is th at
the configuration of the player is auto-
result is a compact circuit that, on command, m atically d erived from d ata in th e
plays back a sound file that has been previously sou n d files, so th at th e best p ossible
sound quality is always guaranteed.
downloaded via the PC. The wave player can be
used as a programmable doorbell, but it can B AS I C AS S U M P TI O N S
A n u m ber of con sid eration s p layed a
also be used for model railroading or to amuse role in th e d evelop m en t of th e w ave
file player. We wanted it to be compact,
your children. Depending on the desired sam- utilize industry standards and be flexi-
pling frequency and resolution, it can store up to ble in use.
The interface with the PC allows all
43 seconds’ worth of sound. the ‘tunes’ that the player has to repro-
duce to be generated conveniently and
‘mad e to measure’. Depend ing on the
capabilities of the PC used, sound frag-
Design by H. Bonekamp m en ts can be taken from a CD (bu t

Elektor Electronics 2/99


54
watch out for copyright restrictions) or
sampled via a sound card. You can use 1 GAIN
a sound editing program for this (such RS
as th e sh arew are p rogram Cool Ed it). 232
Also, th an ks to th e ‘u n iversal’ RxD
D
ap p roach u sed in th e d esign , a Win - DATA
dows environment is not essential. The AT90S2313 A
only thing that you need is a program PLAY
th at can gen erate an d ed it w av files.
Th e resu ltin g file m u st be tran sferred RECORD FREQ

to the player as a data file, via an RS232 MUTE


PLAY
interface. Standard terminal programs
can be u sed for th is, as lon g as th ey
support RAW ASCII. In addition, there 8V4
9V
is a sp ecially-p rep ared d ow n load er FLASH ROM 5V POWER
program available for Windows users. 0V
0V

A C L O S E R L O O K AT 990015-11

T H E H A R D WA R E
Th e block d iagram of th e h ard w are Figure 1. Block dia-
design is shown in Figure 1. The heart gram of the wave file
of the circuit is an AT90S2313 IC, which oscillator com p on en ts player. address is being sent to
can be connected to a PC via an RS232 are X1, C1 an d C2. Th e th e flash m em ory. In
in terface. O n th e an alogu e sid e w e ‘p lay ’ sw itch is ad d ition , th e d ata are
fin d a D/A con verter, a con figu rable debounced in software, and resistor R4 organ ized so th at th e least p ossible
low-p ass filter an d an ad ju stable ou t- protects the IC against electrostatic dis- am ou n t of tim e is lost in read in g th e
put amplifier. The d ata are stored in a ch arges. Cap acitor C3 su p p resses an y data.
flash m em ory. All th at’s left is th e cou p led -in h igh -frequ en cy sign als. Th e D/A con verter is con n ected to
power supply: from a 9 V input, it pro- LEDs D1 and D2 are connected to one th e CPU via th ree sign al lin es (CLK,
vid es th e circu it w ith 8.4 V an d 5 V of th e con troller ’s I/O p orts via series DIN an d LOAD). Its ou tp u t sign al
w orkin g voltages. Th e u ser in terface resistors. Th e 2-Mbit flash m em ory, (Vou t) is cap acitively cou p led to th e
consists of one switch (‘play ’) and two IC2, is organ ized as 1024 p ages each in p u t of th e low-p ass filter (IC4). Th e
LEDs (‘recording’ and ‘playing’). h old in g 264 bytes. Sin ce it takes 64 LTC1063 chip used here is a switched-
Th an ks to th e p ow er of th e con - clock cycles to read ou t on e p age, it is capacitor device, which filters the ana-
troller used here, the entire hard ware n ot p ossible to sim p ly tran sfer d ata logue signal under control of the CPU.
d esign n eed s on ly five in tegrated cir- d irectly from the flash memory to the A circu it trick is u sed to set th e in p u t
cuits. Figure 2 shows the full schematic D/A converter. A 64-byte circular buffer level to the filter to 2.5 V. The necessary
diagram. The serial interface consists of in RAM is u sed to d eal supplementary voltage
n o m ore th an a sin gle tran sistor an d with this problem. Data Figure 2. From theory is p rovid ed by R8 an d
th ree resistors. Th e h ard w are arou n d are read from the circu- to practice: the com- R9. Resistor R7 p ro-
the CPU can be quickly described. The lar bu ffer w h ile a p age plete circuit requires vid es a relatively high-
only five integrated
circuits.

K1
ISP 5V U+

2 R3
10k
R2 C4 C6 C8 R8
100k

C14 C13
4k7

T1
IC5 1
TxD R1 100n 100n 100n
20 100n VP 220µ
100k 8 6 25V

C7 R10 C12
BC547B 1 19 1 7 1 7 2 VIN 5 LS
RESET IC1 (SCK)PB7 CLK VOUT VIN VOUT 15k
OUT+
2 18 2 IC3 IC4
PD0(RxD) (MISO)PB6 DIN 6 100n 8 470n
3 17 LTC VREF LTC VOS
PD1(TxD) (MOSI)PB5 1063
6 16 3 1257 4 5 4 3 !OUT- 7
PD2(INT0) AT90 PB4 LOAD DOUT CLKIN CLKOUT
7 15 GND1 8Ω
PD3(INT1) S2313 (OCI)PB3 2W
8 14
PD4(T0) PB2 5 3 2
9 13 GND2 VC
PD5(T1) (AIN1)PB1
R4 R5 R11 11 12 R6 R7 6 4
PD6(ICP) (AIN0)PB0
TDA7052A
1k

1k
3k3

15k

100k

XTAL1 XTAL2
C3
5 4 10
X1
10MHz R9
S1 100n D1 C15 P1 D2 C10 C9 C11
C2
4k7

C1
4k7
2µ2 100µ 100n 1n
10V 22p 22p 10V

5V 5V LP2950CZ5.0 U+
32
D3 7...15V
IC6
5 29
SCK IC2 WP C5
28 6 1N4001
RESET SI C16
4 7 100n
CS AT45D021 SO
10µ 10V

990015-12

Elektor Electronics 2/99 55


TXD
T

T
S1
3

C3
H3

H2
R4

C8
R3
R2

D1
R1

IC2

C1
C2

T1

R6
R5
X1

D2
IC1

R11
C4

(C) ELEKTOR
990015-1
ROTKELC16

990015-1
C6
1-510099

IC4

IC3

C5
E )C(

K1
C11
R7
C10

C7
R8
R9 C15
C9

R10
IC6

C12
D3

IC5

P1

C13
+ 0
H4

H1

C14 LS

Figure 3. The copper-track layout and component overlay COMPONENTS LIST


show the compactness of the player. It can easily be fit-
ted into a small enclosure. Resistors:
R1,R2,R7 = 100kO
R3 = 10kO
R4 = 3kO3
impedance path for this voltage to the to various other programs since it pro- R5,R6 = 1kO
R8,R9 = 4kO7
in p u t of IC4. Th e filter ch aracteristics vid es good facilities for resam p lin g
R10,R11 = 15kO
can be ad ju sted by varyin g th e fre- sou n d files. Th is is an imp ortan t task, P1 = 4kO7, preset V
quency of its clock signal. which in large measure determines the
Th e fin al p art of th e circu it is th e quality of the sound. Capacitors:
ou tp u t am p lifier IC5. Th e TDA7052A A sh arew are version of Cool Ed it C1,C2 = 22 pF, ceramic
IC is w ired as a brid ge am p lifier an d can be fou n d at th e w ebsite C3…C6,C8,C9,C14 = 100nF,
p rovid es an ou tp u t p ow er of 1 w att. http://www.syntrillium.com. This pro- ceramic
Th e volu m e level can be ad ju sted via gram h as several fu n ction s th at are C7 = 100nF, MKT
C10 = 100µF 16V, radial
P1. Th e PD3 ou tp u t of th e p rocessor p articu larly w ell su ited to ou r objec- C11 = 1nF, MKT
controls the mute function. The output tives, in clu d in g alterin g th e samp lin g C12 = 470nF, MKT
am p lifier is m u ted after th e w ave file frequ en cy, selectin g a p articu lar p as- C13 = 220µF 25V, radial
has finished playing. sage and optimizing the amplitude. In C15 = 2µF2 10V, radial
Readers who have carefully studied addition, it is easy to make a mono file C16 = 10µF 10V, radial
the schematic may well wonder about from a stereo file. Th is is essen tial for
the function of K1. The answer is that the wave player, since it makes the file Semiconductors:
D1 = LED, high eff. red
this connector allows the processor to sm aller. Fin ally, th e resolu tion can be
D2 = LED, high eff. green
be programmed directly in the circuit. selected to be 8 bits (256 levels m axi- D3 = 1N4001
This is a handy option for anyone who mum) or 16 bits. T1 = BC547B
w an ts to m od ify th e m icrocon troller As can be seen from Table 1, th e IC1 = AT90S2313 10PC (order code
p rogram to su it h is ow n w ish es. Th e playing time is strongly dependent on 996505-1)
source code of the program, which was th e sam p lin g frequ en cy. A h igh sam - IC2 = AT45D021JC
d eveloped in the Elektor labs, is read - p lin g frequ en cy is recom m en d ed for IC3 = LTC1257 CN8
ily available from our Readers Services music (up to 22 kHz with this circuit), IC4 = LTC1063 CN8
IC5 = TDA7052A
(order number 996006-1). but a lower frequency can be used for IC6 = LP2950CZ5.0
Con stru ction sh ou ld n ot p resen t sp eech . By an d large, a sam p lin g rate
an y p roblems. A comp act p rin ted cir- of 8 kH z yield s a sign al w h ose sou n d Miscellaneous:
cuit board, whose copper track layout qu ality is equ al to th at of a good tele- 32-way PLCC socket for IC2
and component overlay are shown in phone connection. S1 = pushbutton 1 make contact
Figure 3, form s th e basis. If you u se Th e d ifferen ce betw een 8-bit an d LS = 8Ω 2W
sockets for the ICs, almost nothing can 16-bit resolution can be seen in the sig- K1 = 6-pin SIL pinheader
X1 = quartz crystal, 10 MHz
go w ron g. For th is reason w e can nal-to-noise ratio. The lower the reso-
Case: Bopla type E410
qu ickly sh ift ou r atten tion to th e soft- lution, the larger the steps. With 8 bits, PCB, order code 990015-1
w are, w h ich is th e key to th e w h ole on ly 256 sign al levels are p ossible. A Programmed controller: order code
show. larger step size results in a greater dif- 996505-1
feren ce betw een th e actu al valu e an d 3.5”-floppy disk with Windows-software
WO R K I N G the desired amplitude, which increases and source code file of controller pro-
WI T H C O O L E D I T the noise and distortion levels. For the gram: order code 996006-1.
Wave files to be played back by this cir- best quality, 16-bit resolution should be
cu it m u st first be m ad e to fit, an d for u sed . Note also th at th e p layer circu it
th is you w ill n eed a sou n d ed itor for red u ces th is to 12 bits, sin ce th e D/A
the PC. One possibility is the Windows converter has its own limitations. With
program Cool Edit, which is preferable th ese 12 bits w e ach ieve an op tim u m

56 Elektor Electronics 2/99


com p rom ise betw een th e sign al-to-
noise ratio and the memory capacity.
The best possible sound quality can be
ach ieved by u sin g th e sou n d -ed itin g
program to adjust the amplitude of the
signal so that the full dynamic range is
utilized.
Sin ce th e w ave file p layer sim p ly
cu ts off th e sou n d at th e en d of th e
available playing time, it is also neces-
sary to modify the sound file so that it
starts an d en d s softly. A bit of exp eri-
m en tin g w ill qu ickly teach you h ow
everything works.
O n ce th e file is read y, it m u st be
transferred to the wave file player via
the serial port. A terminal program can
be used for this, as long as it supports
the RAW ASCII option. This is the only
way to be sure that the data will not be
corrupted on its way to the player. For
Windows users, we have developed a
utility program that drastically simpli-
fies file d ow n load in g.
Th is p rogram en su res Figure 4. The share-
that the complete wave ware version of Cool
file is qu ickly an d reli- Edit can be used to
ably tran sferred to th e make sound files that
p layer ’s m em ory. are suitable for the
Proper configuration of wave file player.
Cool Ed it is imp ortan t,
since the controller soft-
ware checks the structure of the wave
file. Wh en th e file is received , it is LED is extinguished. Christmas or a birthday) by loading an
checked to see that: Th e green LED (D2) is lit w h en ap p rop riate tu n e in th e RO M. You
- it is a wav file, p ow er is ap p lied to th e circu it. It cou ld also con sid er p rogrammin g th e
- th e sam p lin g frequ en cy is equ al to flashes while a stored wave file is being sou n d of barkin g d ogs for you r vaca-
one of the predefined values; p layed back (in resp on se to p ressin g tion time. This should confuse would-
- the signal is monophonic; S1). be thieves who try to see if anyone is at
- PCM coding is used and If the player is used as a doorbell, a home by ringing the doorbell!
- the word size is 8 or 16 bits. mains adapter can be used to supply it (990015-1)
If all these conditions are satisfied, then with power. The d oorbell switch then
th e file can be p rop erly read in . If an functions as S1. You can welcome your
error is detected, the red LED is imme- gu ests on sp ecial occasion s (su ch as
diately lit.
There is in practice a problem when
Win d ow s 3.1 is u sed . With th is soft-
ware the maximum speed of the serial Table 1. Files, formats and playing times.
in terface is con sid erably less th an
57.6 kbps, which is used here. It is thus Sampling rate word size file size playing time
n ecessary to d rop back to a low er 22.05 kHz 8 256 k 11.92 s
sp eed . If sw itch S1 is h eld d ep ressed 16/12 341 k 7.94 s
while the power is switched on, a ser- 11.025 kHz 8 256 k 23.83 s
ial data rate of 9600 baud is selected. All
16/12 341 k 15.89 s
other settings remain unaltered.
The red LED (D1) flashes while data 8 kHz 8 256 k 32.77 s
are being downloaded. As soon as the 16/12 341 k 21.85 s
flash RO M is fu ll, it stays on con tin u - 6 kHz 8 256 k 43.69 s
ou sly. If n o m ore d ata are sen t to th e 16/12 341 k 29.13 s
controller for an interval of 500 ms, the

Elektor Electronics 2/99 57


AUDIO & HI-FI

Titan 2000
High-power hi-fi and
public-address amplifier

It could be argued
that most of the out-
put amplifiers pub-
lished in this maga-
zine lack power.
Although this is a
debatable point, it
was felt that a true
heavyweight output
amplifier would make
a welcome change for
many constructors.
The Titan 2000 can
produce 300 watts
into 8 Ω, 500 watts
into 4 Ω, and
800 watts into 2 Ω.
For those who believe
that music power is a
reputable quantity, the
amplifier can deliver
2000 watts of this
magical power into
Br i e f p a r a m e t e r s
4 Ω. Sine-wave power output 300 W into 8 Ω; 500 W into 4 Ω; 800 W into 2 Ω
Music power* 2000 W into 4 Ω
Harmonic distortion < 0.005%
Slew limiting 85 V µs–1
Open-loop bandwidth 55 kHz
Power bandwidth 1.5 Hz – 220 kHz

* See text about the validity of this meaningless quantity.

Design by T. Giesberts

Elektor Electronics 2/99


58
INTRODUCTION ‘P R O G R AM M AB L E ’ age across the loudspeaker and the r.m.s.
Am p lifier ou tp u t h as been a cau se of P O WE R O U T P U T current flowing into the speaker. The term
argu m en t for as lon g as th ere h ave Th e am p lifier h as been d esign ed in music power is generally meaningless,
been au d io p ow er am p lifiers. For su ch a m an n er th at its ou tp u t is ‘p ro- because to some manufacturers it means the
d om estic u se, a p ow er ratin g of gram m able’ as it w ere. With a sin e product of the peak voltage and peak cur-
2×50 W is more than sufficient. With w ave in p u t, it d elivers an average rent; to others it means merely double the
th e volu m e con trol at m axim u m an d p ow er of 300 W in to an 8 Ω load , true power; and to yet others, even more
th e u se of correctly m atch ed good - w h ich sh ou ld m eet th e requ irem en ts disreputable, it means quadrupling the true
quality loudspeakers, this will provide of all but the power drunk. Compared power).

± 85V
1
regulator auxiliary main power
supply
± 78V power supply
2x 15V
± 70V
T43...T52

voltage amplifier current amplifier

T1...T10 T27...T34
T15...T26 T35...T42

input stages & drivers & output stages


cascode amplifiers
offset control

protection 0
circuits

heat sink U in U out


sensor

thermal
control
fan

Figure 1. Simplified block dia- 990001 - 12


gram of the Titan 2000. The aux-
iliary power supply, protection
networks and thermal control
are discrete circuits built on dis-
crete PCBs. with the output of 50 W from a However, power is not the only cri-
d om estic au d io am p lifier, th is terion of an amp lifier. Low d istortion ,
gives an in crease in SPL of good slew lim itin g, an d an exten d ed
a sou n d p ressu re level (SPL) equ iva- 7.5 d B. If even h igh er ou tp u ts are power bandwidth, as possessed by the
len t to th at of a gran d p ian o bein g n eed ed , th e load im p ed an ce m ay be Titan 2000, are also hallmarks of a good
played forte in the same room. low ered to 4 Ω, w h ich w ill give an amplifier.
However, not all amplifiers are in crease in SPL of 10 d B com p ared Pow er ban d w id th d en otes th e fre-
intended for domestic use: many are with a 50 W output. qu en cy ran ge over w h ich th e p ow er
destined for discos, small music halls Alth ou gh m u sic p ow er is a d ep re- falls to not less than half its maximum
and other large rooms. But even here, catory term , sin ce it d oes n ot really valu e. Th is is m u ch m ore tellin g th an
what power is really required? Since give the true power rating of an ampli- the frequency response, which is usu-
doubling the amplifier output increases fier, read ers m ay n ote th at th e Titan ally measured at a much lower output
the SPL by a barely audible 3 dB, it was 2000 can d eliver 2 kW of th is m agical level.
felt that 300 watts sine wave power into p ow er in to 4 Ω. (True power is average Slew limiting is the maximum input
8 Ω would appeal to many. power, that is, the product of the r.m.s. volt- voltage ch an ge th at can occu r in on e

Elektor Electronics 2/99 59


85V R56
2
15Ω
R57 R62 BF245A BC639 BC550 BD711 BF871
BF256C BC640 BC560 BD712 BF872

15k
1V

330Ω
T47 R13 R18 D4 R24 R25 R26
D10 C16 C4 C8 C20 C21 C17

68Ω
68Ω
68Ω

1k00
270Ω

1V45
0V83
D8 100p 2n2
1N4004 100n 100p 100p 100p
BD712 5V6
30V T43
R16 T15 T16 T17
R63 0W5
1W3 C32 G D E B C E
+78V

150Ω
BF S C B

15k
245A 2µ2
2x T11 B E
R58 63V
C
BC T21...T23=MJE340 E B

270Ω

0V36
T45 639 T46 70V
R22 T29...T31=2SC5171 C

3k3
2mA1 C43 C44 C45

35V
C31 1W T29 T30 T31

39V
C28 C29

53V
R60 R61 R64 T13 100n 100n 100n
15n
15V T21 T22 T23 5V
470µ 100V 220n

12k

22Ω
22Ω

60
BF256C +5V
R59 P2 R36 R39 R40 R41 R78
T9

39V
5k6
2k2

8V4
10Ω
10Ω
10Ω

560Ω
38mV
250Ω
R19 D5 R76
D1 IC2 I
BF256A P4 C6 C10 C9
D9 T44 R5 100Ω
BF871 2 8 6

10k
C30 C33 C34

1V7
330Ω
T35...T38=2SC5359
39V 220µ R74
25V 100µ 1W 100n 15V
47µ 220n 470µ T5 1W3 T35 T36 T37 T38 C42
63V 1W3 100V 25V
100Ω

5k T3 1n
BF R31 R33
R75 R77
245A BD 3 7 5
33Ω 100Ω

22k
R4
T27

220Ω
D3 139 6N136
1N4148 T7 R12
C3 R45 R46 R47 R48 R79

22Ω
JP2

53mV
MUTE
2Ω2

22Ω
0Ω22
0Ω22
0Ω22
0Ω22

1n

45mV
20mV

T1
R10 R11 LS+ LS+ L1
Re1
470Ω 470Ω
R38 R49 R50 R51 R52
JP1 C15
C1 R2
K1

150Ω

2V24
0Ω22
0Ω22
0Ω22
0Ω22

20mV

562Ω R9 100n

470Ω
R34 Re4 Re3 Re2

essence, fairly straightforward.


2µ2 D19 D18
T2

390Ω
P3
V23042-A2003-B101 R14
R8 R30 2R
500Ω
P1 R
R6

22Ω
5k

22Ω1
1R

45mV
R1 R3

22Ω
C2 T8 T39 T40 T41 T42

53mV
P-IN BF T4 C14

1M
47k
245A LS1
1n T39...T42=2SA1987
T6 T28 C
BD R37 R42 R43 R44

22k
R21 D7 140

220Ω
C13 C12 LS- LS-
10Ω
10Ω
10Ω

560Ω

P5

10k
32mV

R32 R35
R7 T10
D12 R68 C7
C37 C41 100µ 1W 100n 15V
C40
1W3

1V7
39V

470Ω
25V T27...T42 on common heatsink

5k6
220µ
47µ 220n 470µ D2
25V
63V 1W3 5k 100V BF872

sion of a highly complex design, the amplifier is, in


BF256A
C46 C47 C48
T14

-30V
T32 T33 T34
100n 100n 100n

-39V
T49 15V

Figure 2. Although the circuit diagram gives the impres-


BF256C T24 T25 T26
R69 R70 R73 T32...T34=2SA1930

-53V
70V
R23 P-LS
D16

12k
C35

22Ω
22Ω
C36
3k3

C38 T12 15V


35V

1W C26 R53
470µ 100V 220n 1N4004
T50 T51
1M

-39V
15n
T24...T26=MJE340 2µ2 63V
D11
2x R17 C24

Elektor Electronics
T48 BC
640 BD139 MJE340 2SC5171 2SA1987

150Ω

30V R72 BD140 MJE350 2SC5359


BF C39 5 2SA1930
1W3 T18 T19 T20
7

15k
245A R15 R20 D6 2 D14
-78V C18 C5 C11 C22 1
2µ2 C23 C19
R67 6 12V
63V
68Ω
68Ω
68Ω

IC1 0W5
1k00
270Ω

1V45
0V83

100p 3

270Ω

0V36
BD711 2n2 100n 100p 100p 100p D15
D13 5V6 R27 R28 R29 4
0W5 OP90G
R66 R71 R55 R54
1N4004
T52 4M7 4M7 C27
1V

15k
330Ω
C25 E B E B B E
D17 B E
T1, T4, T5, T15...T17 = BC560C 2µ2 63V C C C
15Ω 15V C
T2, T3, T6, T18...T20 = BC550C 68n
85V R65 1N4004 990001 - 11

2/99
microsecond, and to which the ampli- works next to impossible. To obtain the transistors T35–T42.
fier can respond. requisite output power, the use of par- Th e offset con trol stage p reven ts
allel n etw orks of symmetrical p airs of an y d irect voltage ap p earin g at th e
DESIGN transistors is inevitable. output of the amplifier.
C O N S I D E R AT I O N S In view of th e foregoin g, bip olar Th e lou d sp eaker is lin ked to th e
Th e Titan 2000 is based on th e ‘com - tran sistors are u sed in th e cu rren t amplifier by three heavy-duty relays.
pact power amplifier ’ published in the am p lifier of th e Titan 2000. H ow ever, The current amplifier operates from
May 1997 issue of this magazine. That th ese can n ot be d riven as read ily as a ± 70 V supply, which is provid ed by
was a typical domestic amplifier with a IGBTs, which means that current drive two 50 V mains transformers. To enable
power output of 50 W into 8 Ω or 85 W in stead of voltage d rive is u sed . Th is th e voltage amp lifier to d rive th e cu r-
in to 4 Ω. Th e sp ecial p rop erty of th is en tails a su bstan tial u p grad in g of th e rent amplifier to its full extent, it needs
fu lly balan ced d esign w as th e u se of d river stages an d th e p reced in g cas- a sligh tly h igh er su p p ly voltage to
cu rren t feed back in stead of voltage code amplifiers (which also consist of a com p en sate for th e in evitable losses
feed back, w h ich resu lted in a fast- cou p le of p arallel-con n ected tran sis- cau sed by in evitable voltage d rop s.
resp on d in g am p lifier w ith a large tors). The good news is that the power This is accomplished by superimposing
op en -loop ban d w id th . Th e am p lifier transistors in the Titan 2000 are consid- a ± 15 V p oten tial from an extern al
performed well both as regards instru- erably less exp en sive th an IGBTs: an auxiliary supply on to the main ± 70 V
m en t test an d m easu rem en ts an d lis- im p ortan t factor w h en eigh t of th ese su p p ly an d d rop p in g th e resu ltin g
ten in g tests. H ow ever, to serve as a devices are used. voltage to ± 78 V with the aid of regu-
basis for the Titan 2000, its output cur- Finally, the protection circuits have lator T43–T52.
rent and drive voltage range had to be been en h an ced in view of th e h igh er Th e com bin ed p rotection circu its
increased substantially. voltages and currents. The circuits pro- constantly compare the input and out-
For a start, the supply voltage has to tectin g again st d irect voltages an d put voltage of the amplifier: any devi-
be m ore th an d ou bled , w h ich m ean s sh ort-circu its are su p p lem en ted by ation from the nominal values leads to
th at tran sistors w ith a h igh er p ow er n etw orks p rotectin g again st overload th e ou tp u t relays d iscon n ectin g th e
ratin g h ave to be u sed in th e p ow er and (too) high temperatures. The latter lou d sp eaker an d th e in p u t relay
supply. The higher supply voltage also is cou p led to a p rop ortion al fan con - decoupling the input signal.
results in larger potential drops across a trol. The thermal protection circuit mon-
n u m ber of com p on en ts, an d th is In sh ort, a large p art of th e Titan itors th e tem p eratu re of th e h eat sin k
mean s th at d issip ation p roblems may 2000 is a virtu ally n ew d esign rath er and, if necessary, switches on a fan. If,
arise. than a modified one. w ith th e fan op eratin g, th e tem p era-
Th e large ou tp u t cu rren t requ ired tu re ap p roach es th e m axim u m p er-
for th e Titan 2000 m akes a com p lete BRIEF DESCRIPTION m issible lim it, th e ou tp u t relays are
redesign of the current amplifier used The block diagram of the Titan 2000 is deenergized and disconnect the loud-
in th e ‘com p act p ow er am p lifier ’ shown in Figure 1. The voltage ampli- speaker.
unavoidable, since that uses insulated- fier consists of input stages T1–T10, and
gate bip olar tran sistors (IGBTs). cascode amplifiers/pre-drivers T15–T26. CIRCUIT DESCRIPTION
Alth ou gh th ese are excellen t d evices, The current amplifier is formed by dri- The circuit diagram of the Titan 2000 is
th e large sp read of th eir gate-em itter ver tran sistors T27–T34, an d ou tp u t shown in Figure 2. In spite of the large
voltage makes their use in parallel net- n u m ber of com p on en ts, th e basic cir-

Elektor Electronics 2/99 61


Tr1 gain of 20 dB).
3 D3 D1
K3
Th e am p lification of th e cascod e
amplifiers is determined largely by the
F1
ratio of parallel-connected resistors R31
160mA T 85V an d R32 an d th e p arallel n etw ork of
D4 D2 R24–R26. With valu es as sp ecified , th e
C1 C3
R1
am p lification is abou t ×850 (rem em -
12V / 1VA5

1M
4x 1N4007 ber, this is a push-pull d esign), so that
K2 470µ
K1 70V 100V 100n th e overall amp lification of in p u t sec-
tion plus cascode amplifiers is ×8500 (a
gain of close to 80 dB).

Current amplifier
70V R2
C2 C4 Since one of the design requirements is

1M
Tr2 4x 1N4007 that the amplifier is to work with loads
470µ
100V 100n K4 d ow n to 1.5 Ω, th e ou tp u t stages con -
D5 D7 sist of four parallel-connected pairs of
F2 85V transistors, T35–T38 and T39–T42. These
160mA T
transistors have a highly linear transfer
D6 D8
characteristic and provide a direct-cur-
ren t am p lification th at rem ain s virtu -
12V / 1VA5 990001 - 13 ally constant for currents up to 7 A.
Like the output transistors, the dri-
ver stages need to remain within their
Figure 3. Circuit dia- safe op eratin g area (SOA), w h ich
cuit is straightforward. gram of the requisite an d T8. In view of th e n ecessitates a th reefold p arallel n et-
As alread y noted in auxiliary power supply. requ isite stability, w ork. Th e tran sistors u sed in th e d ri-
th e p reviou s p ara- d iod e D 1 is th erm ally ver stages are fast typ es
grap h , tran sistors cou p led to T5 an d D 2 (f T = 200 MH z).
T1–T10 form th e in p u t to T6. Setting the bias voltage for the req-
am p lifier, T11 an d T12 are bu ffers, T13 Any imbalance of the input stages is u isite qu iescen t cu rren t is accom -
an d T14 are cu rren t sou rces, T15–T26 com p en sated by m akin g th e cu rren t plished by balanced transistors T27 and
form th e cascod e amp lifier/p re-d river th rou gh T5 equ al to th at th rou gh T6 T28. These transistors are mounted on
stage, T27–T34 are the driver transistors with potentiometer P 2. the same heat sink as the output tran-
in the current amplifier, T35–T42 are the sistors and driver transistors to ensure
output transistors, and T43–T52 form a Cascode amplifiers/pre-drivers good th erm al cou p lin g an d cu rren t
sophisticated supply voltage regulator. Th e large ou tp u t cu rren t of th e Titan con trol. O f cou rse, th e cu rren t rises
2000 n ecessitates a p rop ortion ally during full drive conditions, but drops
Input amplifier large p re-d rive voltage, w h ich is p ro- again to its n om in al level w h en th e
Strictly speaking, the input amplifier is vided by three parallel-connected cas- amp lifier cools off. Th e qu iescen t cu r-
form ed by tran sistors T3–T4. Cascod e cod e am p lifiers, T15–T26. Th e cu rren t rent is set to 200 mA with potentiome-
stages T9–T10 serve m erely to en able through these amplifiers is arranged at ter P 3.
th e in p u t section h an d lin g th e h igh 10–15 m A, bu t th e cu rren t feed back O wing to the large output current,
voltages. These voltages are limited by used may cause this level to be appre- the connection between amplifier out-
zener diodes D5 and D7, which are part ciably higher. This is the reason that the p u t an d lou d sp eaker is n ot arran ged
of th e p oten tial d ivid er th at also sets tran sistors u sed in th e T21–T26 p osi- via a single relay, but via three. Two of
th e op eratin g p oin ts of T21–T26. In tion s are typ es th at can h an d le cu r- th ese, Re 3–Re 4, are con trolled in syn -
view of the requisite stability, the cur- rents of up to 50 mA when their collec- ch ron y by th e p rotection circu its.
ren t th rou gh th e zen er d iod es is h eld tor-emitter voltage is 150 V. When they are deenergized, their dis-
con stan t by cu rren t sou rces T13 an d Th e in p u t section is lin ked to th e abling action is delayed slightly to give
T14. Resistors R22 an d R23 lim it th e cascod e am p lifiers by bu ffers T11 an d the contacts of the third relay, Re2, time
potential across, and thus the d issipa- T12, which results in a lowering of the to op en , w h ich is of im p ortan ce in a
tion in, these field-effect transistors. in p u t im p ed an ce. Th e arran gem en t fault situation.
O therwise, the input section is vir- also en ables an in crease in th e valu es In p u t relay Re 1 is sw itch ed off in
tually identical to that of the ‘compact of R13 and R15, which results in a 3 dB syn ch ron y w ith Re 2 to en su re th at
power amplifier ’. The drop across the in crease in am p lification of th e in p u t there is no input signal by the time Re 3
em itter resistors of bu ffers T1 an d T2 section. and Re 4 are deenergized.
determines the drop across the emitter Th e fu n ction of resistors R19 an d Optoisolator IC2 serves as sensor for
resistors of T3 an d T4, an d con se- R21 is threefold: they limit the dissipa- th e cu rren t p rotection circu its. Th e
qu en tly th e settin g of th e op eratin g tion of th e bu ffers; th ey obviate th e light-emitting diode in it monitors the
p oin t of th e overall in p u t section . To need of an additional voltage to set the voltage across R48–R52 via p oten tial
eliminate the influence of temperature op eratin g p oin t of th e bu ffers; th ey divider R74–R75, so that the positive as
variation s, T1 is th erm ally cou p led to lim it th e m axim u m cu rren t th rou gh w ell as th e n egative ou tp u t cu rren ts
T3 and T2 to T4. th e bu ffers, an d th u s th e cascod e are gu ard ed . Th e u se of an op toisola-
Since the operating point of buffers amplifiers, to a safe value. tor p reven ts earth loop s an d obviates
T1 and T2 is critical, current sources T5 The open-loop amplification of the comp en sation of th e ± 70 V common -
and T6 have been added. The reference Titan 2000 is d eterm in ed solely by mode voltage. The + 5 V supply for the
for th ese cu rren t sou rces is p rovid ed those of the input section and cascode op toisolator is d erived from th e p ro-
by light-emitting diodes (LEDs) D 1 and am p lifiers. Th e am p lification of th e tection circuits.
D 2. Th e cu rren t th rou gh th ese d iod es in p u t section d ep en d s on th e ratios
is d eterm in ed by cu rren t sou rces T7 R13:(R12+ R8) and R15:(R14+ R8) and, Feedback
w ith valu es as sp ecified is ×10 (i.e., a Th e feed back loop ru n s from th e ou t-

62 Elektor Electronics 2/99


put of the power stages to the junction Offset compensation is provided by in evitable losses th rou gh p oten tial
of T3 an d T4 via resistors R10 an d R11. in tegrator IC 1, w h ich en su res th at if drops, the supply voltage for the input
Th is is cu rren t feed back becau se th e there is any direct voltage at the output section and cascode amplifiers needs to
current through T3 and T4 depends on of the amplifier, the operating point of be h igh er th an th e m ain ± 70 V lin e.
the potential across R8, which is deter- T1-T2 is is shifted as needed to keep the Fu rth ermore, th e in p u t voltage to th e
min ed largely by th e cu rren t th rou gh ou tp u t at earth p oten tial. Th e op era- regu lators m u st be h igh er th an th e
R10 and R11. The overall voltage ampli- tion al am p lifier (op am p ) u sed d raw s wanted output voltage to ensure effec-
fication of the output amplifier is deter- on ly a tin y cu rren t (20 µA) an d h as a tive regulation.
mined by the ratio R8:(R10+ R11). very small input offset (450 µV). Fortu n ately, th e cu rren t d raw n by
Supply voltage for IC1 is taken from th e voltage am p lifier is fairly low
Compensation the ± 15 V line for the input section via (about 70 mA) so that the input voltage
Capacitors C3–C5 and resistors R16, R17 diodes D 16 and D 17. This arrangement to the regulators can be increased with
form p art of th e com p en sation n et- en su res th at th e su p p ly to th e IC is a simple auxiliary supply as shown in
work required for stable operation. retain ed for a sh ort w h ile after th e Figure 3. Th is con sists of tw o sm all
Low-pass filter R2–C2 at the input is main supply is switched off so that any m ain s tran sform ers,tw o brid ge recti-
essen tial to p reven t fast, th at is, h igh - interference is smoothed out. fiers, D 1–D 4 and D 5–D 8, and the neces-
frequ en cy, sign als cau sin g d istortion . Diod es D 14 an d D 15 safegu ard th e sary reservoir and buffer capacitors.
This filter is also indispensable for sta- in p u t of IC 1 again st (too) h igh in p u t The ± 15 V output is linked in series
bility ’s sake. voltages in fault conditions. with the ± 70 V line to give an unregu-
Cou p lin g cap acitor C 1 is n eed ed Th e valu es of resistors R54 an d R55 lated voltage of ± 85 V.
because the available offset compensa- arrange the level of the compensating Th e 39 V referen ce is p rovid ed by
tion network merely redresses the bias current at not more than 1 µA, which is zen er d iod e D 9. Th is m ean s th at th e
current of the input buffers and is not su fficien t to n u llify th e d ifferen ce regu lator n eed s to am p lify th e refer-
intended to block any direct voltages at between the base currents of T1 and T2. ence voltage ×2 to obtain the requisite
the input. output voltage.
Relay Re 1 at th e in p u t en ables th e Regulation The zener diode is powered by cur-
in p u t sign al to be ‘sw itch ed off ’. It Alth ou gh cu rren t feed back h as man y ren t sou rce T43, to en su re a stable ref-
form s p art of th e overall p rotection advantages, it also has a serious draw- erence, which is additionally buffered
and in particular safeguards the input back: poor supply voltage suppression. by C30.
section again st overd rive. Th e overall Th is m akes it essen tial for th e su p p ly Differential amplifier T45-T46, whose
p rotection circu it w ill be d iscu ssed in voltage for the voltage amplifier to be operating point is set by current source
detail next month. regulated. In view of the requisite high T44, compares the output voltage with
Netw ork R9-P 1 is in ten d ed sp ecifi- symmetrical potential and the fact that th e referen ce via p oten tial d ivid er
cally for ad justing the common-mod e the unregulated voltage that serves as R63-R64-P 4. This shows that the output
su p p ression w h en tw o am p lifiers are in p u t voltage can vary su bstan tially voltage level can be set with P 4.
u sed in a brid ge arran gem en t. It is u n d er th e in flu en ce of th e am p lifier Transistor T47 is the output stage of
n eed ed for on ly on e of th ese am p li- load, two discrete low-drop regulators, th e regu lator. Th e ou tp u t voltage
fiers, an d m ay be in tercon n ected or T43–T47 and T48–T52 are used. remains stable down to 0.2 V below the
disabled by jumper JP 1 as needed. As m en tion ed before, ow in g to input voltage.

Cu r r e n t - f e e d b a ck
In an amplifier using voltage feedback (Figure a), the differential voltage at its inputs is multiplied by the open-loop
amplification. The feedback loop forces the output voltage to a level that, divided by network R1-R2, is equal to the
input voltage.
Whereas an amplifier with voltage feedback has high-impedance inputs, an amplifier with current feedback (Figure
b) has an high-impedance and a low-impedance input. Its input stage consists of a buffer with unitary gain between
the inverting and non-inverting inputs. Essentially, the inverting input is the low-impedance input. The buffer is fol-
lowed by an impedance matching stage that converts the output current of the buffer into a directly proportional out-
put voltage.
The current feedback loop operates as follows. When the potential at the non-inverting input rises, the inverting input
will also rise, resulting in the buffer current flowing through resistor R1. This current, magnified by the impedance
matching stage, will cause the output
voltage of the amplifier to rise until the
output current flowing through resistor R2 a b
U in U in
is equal to the buffer current through R1.
The correct quiescent output voltage can
U out U out
be sustained by a very small buffer cur- A(s) Av=1 R(s)
rent. The closed-loop amplification of the
circuit is determined by the ratio I
(1+ R2):R1.
A interesting property of an amplifier
R2 R2
with current feedback is that the closed-
loop bandwidth is all but independent of
the closed-loop amplification, whereas R1 R1
that of an amplifier with voltage feedback R2
becomes smaller in inverse proportion to Av = 1 + Av = 1 + R2
R1 R1
the closed-loop amplification – a relation 990001 - 14
known as the gain-bandwidth product.

Elektor Electronics 2/99 63


Resistor R57 an d d iod e D 8 p rotect T43
against high voltage during switch-on,
w h ile D 10 p reven ts cu rren t flow in g
th rou gh th e regu lator in th e w ron g
direction.
Capacitors C31 and C32 enhance the
rate of operation of the regulator.
N etw ork R56-C 28-C 29 p rovid es
ad d ition al sm ooth in g an d r.f. d ecou -
pling of the ± 85 V lines.

NEXT MONTH
Next mon th ’s secon d an d con clu d in g
in stalm en t of th is article w ill d escribe
details of the protection circuits, the fan
con trol, an d th e con stru ction of th e
am p lifier. Th e in stalm en t w ill also
include detailed specifications and per-
formance characteristics.
[990001-1]

Elektor Electronics 2/99 65


GENERAL INTEREST

auto shuttle service


for model railway
From A to B and back
The service provided
by the circuit
described in this arti-
cle is known as a
shuttle service (as for
instance through the
Channel tunnel
between England
and France – named
Le Shuttle). It
enables a train to
travel to and fro
between two stations
without the necessity
for a manual instruc-
tion. Compared with
a number of other
types of shuttle ser- An important advantage of the pre-
sent circuit is that it does not require
switches or relays in the track. This
means that small magnets for operat-
vice, the present one a change-over track or platform. The ing these devices must be fitted
point in time when the polarity of the (glued) to the underside of the loco-
has several interest- drive voltage of the train should be motives used for shuttling between
ing advantages. reversed is determined by two reed stations A and B.

Features:
✔ the distance between the two stations may be quite long
✔ the duration of the stop-over at each of the stations can be preset
✔ no run round loop required
✔ power lines of shuttle circuit and train are isolated
✔ wearfree electronic change-over of direction of travel
✔ standard, inexpensive components are used

Design by M. Metzner

Elektor Electronics 2/99


66
Visit our Web site at http://www.elektor-electronics.co.uk

1 10V
10V
IC5
7810
B2

IC4 14V
10V P1 R3 C4 CNY17
10k 2 4
R1 C11 C10 C9 C8
500k 220µ 14 D1
C3
16V
10k

IC1 1µ 100n 100n 1000µ


2 1 100n B40C800
IC1a 7 25V 25V
1 RCX CX
3 5 6 R6 1 6 5
2 & IC2a R7
R11

1k

1k
S1 ≥1
4 7 5k6
C2 T5 T3
R BD244 BD243
100n
IC1c T1
3 8 R5
10
9 & 150k BC516
D5 D3
B1
10V 10V P
IC1d T2
12 R8
11 Q
13 & 150k BC516 D6 D4
S2
C1 13
R T6 T4
100n 12 9 R9 R10
IC2b 10V BD244 BD243 B40C3300
IC1b

1k

1k
5 ≥1 R12
4 11 10 IC3
6 & 5k6
1 6 5
R2 RCX CX
16 D2
C6 IC1 = 4093 C7
14 15
10k

IC2
IC2 = 4538
P2 C5 100n 8 2200µ
R4 D3...D6 = 1N4003 25V
10k 2 4
10V 500k 220µ CNY17
980080-11
16V

Figure 1. Circuit diagram of the shuttle track control.


The direction of travel is reversed by power transistors
T3–T6. The time the train remains at station A or B is set
with P1 and P2 respectively.

CIRCUIT DESCRIPTION gate IC1d become high also, the output The track voltage is derived from
To understand the function of the of the gate goes low, and T2 conducts the normal railway power supply set
shuttle service circuit, imagine a train so that the LED in optoisolator IC3 as required for the track speed. The
travelling from A to B. The train can lights. Power transistors T3 and T6 then bridge rectifier, B1, ensures that the
move only when neither of timers IC2a come on and connect the drive voltage supply to power transistors T3–T6 is of
and IC2b is set (see Figure 1). This is with reverse polarity to the rail track. correct polarity at all times. Capacitor
always so when the train is at a stand- The train is then able to leave station C7 smooths the track voltage and
still at station A or B. Pin 3 of the B and travel to station A. short-circuits any spikes on it.
bistable (flip-flop) formed by IC1a and When station A is approached, reed The supply voltage for the control
IC1b is then logic low (0), whereas switch A closes when the locomotive circuit is derived from the normal rail-
pin 4 is logic high (1). Pins 6 and 10 of passes over it. This causes bistable IC1 way lighting supply (14 V a.c.) via
IC2 are also low, while pins 7 and 9 of to change state again, whereupon a bridge rectifier B2 and regulator IC5.
IC2 are high. The inputs of NAND gate similar process as described for station
IC1 are high, but its output is low. This B ensues. Now, however, timer IC2a, CONSTRUCTION
means that T1 conducts whereupon which determines how long the train The control circuit is best built on the
the LED in optoisolator IC4 lights. stops at station A, is triggered. printed-circuit board shown in Fig-
Power transistors T4 and T5 conduct In this manner, the train travels ure 2. Experienced constructors will
and link the drive voltage to the rail continuously between the two stations have no problems in completing the
track. The train is then able to leave (provided the power is switched on). board. Those with less experience
station A and travel to station B. Diodes D1 and D2 indicate which of should pay particular attention to the
When station B is approached, reed the two optoisolators is enabled and polarity of electrolytic capacitors,
switch B closes when the locomotive therefore in which direction the train diodes, ICs, bridge rectifiers, and so on.
passes over it. This causes bistable IC1 is travelling. When the train is at either Wire bridges also need close attention:
to change state, whereupon pin 3 of of the two stations, both LEDs are out. make sure that these are soldered in
IC1 goes high, and pin 4, low. This Because the inverse trigger inputs place before any components are fit-
results in the input (pin 11) of IC2 (pins 5 and 11) of IC2 are used, timers ted.
being triggered, so that its normal out- IC1a and IC1b are triggered by the neg- Although, strictly speaking, power
put (pin 10) goes high at once and the ative edges at pins 3 and 4 of IC1. Since transistors T3–T6 do not need a heat
inverted output (pin 9), low. The out- the timers change state after the set sink during normal operation, it is
put of the NAND gate remains high, time has elapsed, even when the trig- wise to fit them on one to allow for
however, for as long as the timer is set. ger inputs are low, operational errors any unforeseen events.
During this time, darlingtons T2 and are prevented. This is particularly Circuit IC1 should preferably be a
T2, as well as the power circuit, T3–T6, important to avoid a fast moving loco- Type 4093, which has high immunity
remain cut off so that the train cannot motive closing the same reed switch to interference, but a Type 4011 (pin
leave station B. twice in succession or a slow train compatible with a 4093) may also be
When the time set by IC2b has stopping with the locomotive above used.
elapsed, pin 9 of the timer goes high the reed switch/relay and so keeping When the power is switched on for
again, whereupon the inputs of NAND this closed. the first time to the track and the con-

Elektor Electronics 2/99 67


Parts list

Resistors:
R1–R4 = 10 kΩ
R5, R8 = 150 kΩ
R6, R7, R9, R10 = 1 kΩ
R11, R12 = 5.6 kΩ
P1, P2 = 500 kΩ preset

Capacitors:
C1–C3, C6, C9, C10 = 0.1 µF
C4, C5 = 220 µF, 16 V, radial
C7 = 2200 µF, 25 V, radial
C8 = 1000 µF, 2 V, radial
C11 = 1 µF, 25 V, radial

Semiconductors:
B1 = B40C3000 bridge rectifier
B2 = B40C800 bridge rectifier
D1, D2 = LED, high efficiency
D3–D6 = 1N4003
T1, T2 = BC516
T3, T4 = BD243
T5, T6 = BD244

Integrated circuits:
IC1 = 4093 or 4011 – see text
IC2 = 4538
IC3, IC4 = CNY17-2 trol circuit, the timers are set by the to via an isolating track, small magnets
IC5 = 7810 negative edge at their inverse trigger may be fitted (glued) underneath the
inputs. Therefore, the train will not last carriage instead of the locomotive.
Miscellaneous:
move until the relevant time has This enables the train to be fairly long
S1, S2 = reed switch or reed relay
PC1–PC10 = solder pins elapsed; at the first switch-on, this may while retaining the same distance
PCB Order no. 980080 (see Readers take a little while. between the front or rear of the train
services towards the end of this If the train, on first switch-on, and the terminals of the shuttle track.
issue) moves in the wrong direction and its [980080]
passing over a reed switch has no
effect, the polarity of the track voltage
must be reversed.
Because the circuit is controlled via See also ‘Shuttle Track’ in the July/August
two reed switches or relays as opposed 1996 issue of this magazine.

2
T

T
S2

S1

R2
H4

H1
C2
C1

R1
P1
C3

IC1
C6

C4
980080-1 D1

R3
IC2
C5

R4
R5
R8
P2
T2

T1

R6
R9 R10 R7
C10
D2

IC3 IC4
D3
T3

C11

R12
P

R11
D5
T5

IC5
C8
Q

C7

C9

~
D4
T4

14V
D6

B2

~
T6

Figure 2. The
B1

printed-circuit board
for the shuttle track
1-080089 control.
H2

980080-1
H3
V~

(C) ELEKTOR ROTKELE )C(

68 Elektor Electronics 2/99


Elektor Electronics

2SC5359 2SA1987

Transistors Transistors
AF, high-power AF, high-power
D ATA S H E E T 2 /9 9 D ATA S H E E T 2 /9 9

2SC5359 2SA1987
MAXIMUM RATINGS (Ta = 25ºC) MAXIMUM RATINGS (Ta = 25ºC)
Silicon NPN Triple Diffused Power Transistor Silicon PNP Triple Diffused Power Transistor
CHARACTERISTIC SYMBOL RATING UNIT CHARACTERISTIC SYMBOL RATING UNIT
Manufacturer Manufacturer
Collector-Base Voltage VCBO 230 V Collector-Base Voltage VCBO –230 V
Toshiba Toshiba
Collector-Emitter Voltage VCEO 230 V Collector-Emitter Voltage VCEO –230 V
Features Features
Emitter-Base Voltage VEBO 5 V Emitter-Base Voltage VEBO –5 V
2/99

❍ High Collector Voltage: VCEO = 230V (Min.) ❍ High Collector Voltage: VCEO = –230V (Min.)
❍ Complementary to 2SA1987 Collector Current IC 15 A ❍ Complementary to 2SC5359 Collector Current IC –15 A
❍ Recommended for 100W High Fidelity Audio Base Current IB 1.5 A ❍ Recommended for 100W High Fidelity Audio Base Current IB –1.5 A
Frequency Amplifier Output Stage Frequency Amplifier Output Stage
Collector Power Dissipation (Tc = 25ºC) PC 180 W Collector Power Dissipation (Tc = 25ºC) PC 180 W

Application Example Junction Temperature Tj 150 ºC Application Example Junction Temperature Tj 150 ºC
High-Power AF Amplifier, High-Power AF Amplifier,
Storage Temperature Range Tstg –55 to + 150 ºC Storage Temperature Range Tstg –55 to + 150 ºC
Elektor Electronics February & March 1999. Elektor Electronics February & March 1999.
69


2SA1987 2SC5359

2/99
Transistors Transistors
AF, high-power AF, high-power
D ATA S H E E T 2 /9 9 D ATA S H E E T 2 /9 9

Elektor Electronics
ELECTRICAL CHARACTERISTICS (Ta = 25ºC) ELECTRICAL CHARACTERISTICS (Ta = 25ºC)

CHARACTERISTIC SYMBOL TEST CONDITION MIN. TYP. MAX. UNIT CHARACTERISTIC SYMBOL TEST CONDITION MIN. TYP. MAX. UNIT

Collector Cut-off Current ICBO VCB = –230V, IE = 0 — — –5.0 µA Collector Cut-off Current ICBO VCB = 230V, IE = 0 — — 5.0 µA

Emitter Cut-off Current IEBO VEB = –5V, IC = 0 — — –5.0 µA Emitter Cut-off Current IEBO VEB = 5V, IC = 0 — — 5.0 µA

Collector-Emitter Breakdown Voltage V(BR)CEO IC = –50mA, IB = 0 –230 — — V Collector-Emitter Breakdown Voltage V(BR)CEO IC = 50mA, IB = 0 230 — — V

hFE(1) (Note) VCE = –5V, IC = –1A 55 — 160 — hFE(1) (Note) VCE = 5V, I C = 1A 55 — 160 —
DC Current Gain DC Current Gain
hFE(2) VCE = –5V, IC = –7A 35 70 — — hFE(2) VCE = 5V, I C = 7A 35 87 — —

Collector-Emitter Saturation Voltage VCE(sat) IC = –8A, IB = –0.8A — –1.5 –3.0 V Collector-Emitter Saturation Voltage VCE(sat) IC = 8A, I B = 0.8A — 0.4 3.0 V

Base-Emitter Voltage VBE VCE = –5V, IC = –7A — –1.0 –1.5 V Base-Emitter Voltage VBE VCE = 5V, I C = 7A — 1.0 1.5 V

Transition Frequency fT VCE = –5V, IC = –1A — 30 — MHz Transition Frequency fT VCE = 5V, I C = 1A — 30 — MHz

Collector Output Capacitance Cob VCB = –10V, IE = 0, f = 1MHz — 360 — pF Collector Output Capacitance Cob VCB = 10V, I E = 0, f = 1MHz — 200 — pF

(Note) hFE(1) Classification: R= 55-110; O = 80-160 (Note) hFE(1) Classification: R= 55 -110; O = 80 -160

70

You might also like