leading the
The leaders in PIC development
OF USE
♦
♦
♦
♦
All you need to get started with PIC
Industry standard/quality board
Open the box and get coding
Available with C compiler or
use our PicScript to write programs using
simple commands...
NO ASSEMBLER,
NO COMPILER,
JUST WRITE AND RUN
AUTOMATION
SCRIPTABIUTY
PicDev Board with PicScript
£ 99.00 (plus p+p)
This is a complete development suite
for the novice or non programmer.
It is shipped with:
• PicDev Board
• PicShell and PicScript software
• Breakout board
• Cables
• Example scripts
Both items require 'J'q order"
* PC with serial port available
* Power supply adapter \vww.pagnL$p,uk-
PicDev Board with C Compiler
£165.00 (plus p+p)
This is a complete development suite for
the more advanced programmer.
It is shipped with:
• PicDev Board
. PicShei! and PicScript software
• C compiler
. Breakout board
• Cables
• Example scripts
1CD1
sales@pfagm.ca.uk Tel: -44 (0)1792 89 1927
Our wireless future
Few readers will doubt that our future will be Wireless' in many respects. Just look
at the tremendous success of mobile telephones — the younger generation would
not have o social life without these gizmos. Meanwhile the UMTS licenses that
allow much faster Internet-like connections have been auctioned off for immense
sums and the nets are rolled out for practical use. Unexpected competition however
has appeared in the form of WLANs (wireless local area networks) or ’wi-fi' net-
works not only available in many a home and company building but olso increas-
ingly found in public buildings where they go by the name of 'hotspots'. The main
advantage of hotspots is their low cost structure and much higher data speeds than
the current UMTS offerings. On ihe down side, the available range is limited to a
few tens of meters. Hence WLAN has no use in cars, where, come to think of it,
mobile phones or UMTS is not much use either unless you are the passenger, want
\o risk a fine or far more grim consequences. When WLAN marches on, the billions
spent on UMlTS licenses are wasted and the odd telecom provider is sure to fold.
As olways, she outcome of a technology battle will be determined by reality rather
than (technical) bells and whistles. GSM/UMTS activities require telephone-like
devices small enough to disappear in your trouser pocket or be carried around all
day and quietly forgotten about. WLAN is more geared to notebook or iablet PCs.
Alas, no news from the tablet PC and no signs either of an imminent breakthrough.
My prediction is that today's mobile phone will become so small it easily fits in your
wristwatch. Also, whol's now recognized as a notebook PC will transform into a
collapsible touchscreen. Both,, 1 am convinced, will have open wireless connectivity.
Whether the connection will be to hotspots or UMTS (or even HSPDAj will eventu-
ally depend on eose of use and running costs.
Prediction means making lines from the past longer. You can see me pictured
before a prehistoric flint quarry. Spectacular developments have taken place since
the days our ancestors were first able to make sharp tools from flint. Flint, by the
way, consists of silicon dioxide. Nov/ what was ihe stuff again all modern ECs and
transistors ore mode of?
Karel Wairaven, Heed of Design
elektor electronics
Volume 30, Number 333, June 2004 ISSN 0268/45 19
Elektor Electronics aims at inspiring people to master elec-
tronics at any personal level by presenting construction proj-
ects and spotting developments in electronics and informa-
tion technology,
Sector Efectronics s produced and piibfcfred by SeWtor B&dronks (Rufefishing).
RO. Box 190, "Enbadge Wefc 7N5 7WY, Errand. Tel: (+44) (0)1 580 200657,
foe (+44) (0)1560 200616. Emai: .
msgaz r-e is.a i:s ne.vsagents ard - 2 'a esc " z r e3 out-
or cci 3uiJ$CnpttG*i.
Bg&r EfeararaJes e pubfehed 1 1 timesayear wih a dotiiSe issue for jiiy & jftcgjsi.
Ureter the name Befeur and Bd&uur, the msgssr-e k sko published in French.
Gejrr&n Dutch- leather wfth franchised erftjtfoS the rragaane is on orcufo-
■ c - - 50 countries
International Editor i'ac nc-r-r Han ‘
Editor l&\ F: .. ■ -g ■- : -? t : ■ ~ . ■ )
Internationa! editorial staff: Harry ii£ge r Dave Oilmen Pc’ Getfstendcrf,.
E rrn '".'ere-peki'jen G /-’ FGaderscscf. v=in P&c. .
Design stiff: ?Gj-el ; esgr Ton Pac
Luc Le/rar-er: ('* - ~ '
Editorial secretariat Hadwig Hera^ekens (secrd^jfo^t@se^nani£ifiQ
Graphic design DTrt or. Gl. re'T Ge Z-z i
Managing Director Publisher Rz_ Erafoers
Circulation Control: '-Vrne' Deis : - :
Subscriptions;
.Va r ii.’, '4e EGdser ito- Serv.;= U--. : -
G&35 ^TLrnr. ?±ir t- Pcsc . T cer 7 ' -5 ~ _= =" : d.
;0. GET 203657 fec:~44 0 5ED2IE6S6
BreT se ; a ‘ . . _■
Riles 3 rd rerrr.-: s _ t g-.e-r c~ "s Sdiscr icon Gnkr - —
Head Oflke:
Segrrent b.v RO. Bex 75 Bee- Tf.e
Tatepboos: (+3 1 ) 46 4309444. fee (+31)46 4370161
DbtribtOiotL: Seymour, 86 StredL London WiP 3LD, Engird
UK Advertising
Eclt eiu H l 5 Gs>s " a ”2 rr see
CnehEr _ s — GL: " 1 ~ : =. Er
G - -44 0 242 5 07£€. fe- - 0 242 226626
Erra: . - - 1 - :"
A dxettkrr?g rates iro Berms ava bts ect rec-jest.
International Advertising
K CG'ie- - address as -e.se CFce
Ems3: i: +~- : x. G= -
-c.i rsies ~ri i -,i si s c-n recces:
Copyright notice
The Croats described h ths a/e fgc domestic use- oni/. AS photo
granfm 1 pnmj droit board bytxrtsend enids puifched in the ecstorfo setDon of
i! re ”.s.pz "e as ; i r. ^ - s i SegTiEiri b . 3rd reav i- si _ oi. :sd
any form or by arty rrears. inducEng photDcopyx^ scanng ai reeon&ig, in whote or
m pert vxsthom prior v/ritiien parri^on from the F\4K&ief5. Efodi wricen pemaisaon
must sfeolK ofefej'ed before any pert cd ths ptkfez&on 5 stored in & reuiasl
C- =T-> r.STi :T P
feterit protectien msy in respect of droits,, devkeSr comprarants etc descrSsed in
this fTBEasre The ftjbtefosr does r3'r=tcn
1032. 19S3, 19S4
£ JO. 35 US5ZLCS
304 Circuits
fiss, 1980, 1000
£13.45JUS$27M
305 Circuits
1001.1032.1093
£15,55 1ISS 31,00
307 Circuits
109M9SS-. 19M
£ 18.20 USS 37.00
3i>d experimeiKSfs h\s
;{i tsst kJKtfinrafits
riOMmS 3300
J £j*r r'~—
Elgctwnic test
instruments
A YaftfStfe
ihe pfatfie^l use
See also www.elektor-electronics.co.uk
Audio & Video
I*—
Designing Audio
Circuits
Handbook}
Designing Aydm Hpjtdhoek for
Circuits Sound
How (ices i&ci n im ns
music, or, meteed. A di>q*:. ssi the
any sesmd get foam tedinlcaf aspedEs c‘
she c iS. CO r er H&j f seid'xds slistfio.
sssssls tape to the £ 20, 75/VSS 42,00
fcaHtr ^W ? Ths boefs
£nd3£vmir5 is ore a
answer
£2d.7mss 4200
Build your own Modern High-end
High-End Aurtia Valve Amplifiers
Eq Q
g a
prograiTimipg language caSed
hi BL (MalcftBax fsagrage), wbicii
has its oiigms irt BASIC anrt Pascal.
£ 25.95/USS 52M
Elektor Electronics (Publishing)
P.O. Box 190 - Tunbridge Wells TN5 7WY England
Telephone ^44 (0) 1580 200 657 Fax +44 (0) 15S0 200 616
Dictionary of Monitor
Technology
A psjnssTOfc3 hook ol irrsmpasssd
is?ge whidi dsarty .tocumtots sH
aspects of the &ys 55 {kr 3 ii oi
c 2 mjmf fir fra>nf(KS_ £ 25. 95/fISS 52, SO
Buiid your own
Audio Valve Amplifiers
This book proves that the thermionic
valve is making a come-back.
£ 15.55/USS 31.00
Order now using the Order Form
in the Readers Services section in this issue.
STBS
Microcontroller
Practical jmiigtafflm i n$
Ol tTd& ST 62 Kf of
FlfCIWOntlTlfere fT3T!J
SGS thotnaja
£24.§5jVSS5QM
elektor
electronics
Books from
elektor electronics
308 Circuits
Summer Circuits compilation
20 DO. 2001,2002
£ 18.20/VS$37.0Q
Short Course 8051/8032
Microcontrollers
A course describing the hardware and
software (assembler code) to make
a complete microcontroller system
based on an MCS-51 controller.
£9, 95/USS20. 00
Faultfinding in
Computers and
Digital Circuits
This book covers faultfinding
not just in microprocessor
systems, microcontrollers
and industrial PCs, but also
in consumer items such
as personal computers,
multi- media devices, digital
television and so on.
£ 31. 15/US$ 63.00
305
CIRCUITS
307
CIRCUITS
><311 VY2fll tfl 50rt {Jilt
a jnnb&m hi a SCSI
system.
£ 24.95mS 50.D0
PC Interfaces under Windows
Measurement and control using
standard ports PC Interfaces can be
used for more than just the printer,
mouse, modem and joystick!
£ 25.95/USS 52.08
hr
Faultfinding in
Computers and
Digital Circuits
Wrjitp
Dcg^Wt
Tfe ix»k comes Yirth
3 GB-8GU aiifl vdl
PtCs in Practice
Ife FtC 1 6C5v; ferr^y e
a ssrc*s e? imcm-
cofiliolfes Uai lend
fh^fnseh'ss a : t-3?j
vari^fy of
£24,95 jUS$ 50UD
Handyscope HS3 2 Ch
Resolution Menu - 12, 14 or 16bits
Sample Rates - 5,10,25,50,100 Ms/s models
/ Oscilloscope
/ Spectrum Analyzer
/ Voltmeter plus!
/ Transient Recorder
/ Arbitrary Waveform Gen.
/ Two hi-z probes 1:1-1:10
/ USB 1.1 or 2.0
/ Windows OS- all
* nr
l 1 p Ltd
28 Stephenson Road, industrial Estate. St Ives, Cambs, Pe27 3WJ
Telephone: 01480 300695 Fax: 01480 461654
info@itp1Q1.com www.itp101 .corn www.tiople.com
5 ERV1G1NG YOUR COMPLETE PROTOTYPE NEEDS
O Prototypes 5/ * faction of the cost
O Tgou iff and setup included
O Any contour
0 Ff4 1. 6mm. 35pm Cu
mOCARDzim
O fnnustiy sisndsrd qm’Jy
O- Fti-tOw up scms runs
O GAM f CAD consulting
t Tooling
r Photo plots
+ VAT
£ 29 . 89 *
*£.:=- -j ~:e: -i,- ,-=y F - ; - =
Hh' Il'lI ^
•*ate w—
\ t X i
M:+E3miwm
fed -IS 3 fflM?
f,e * ph «
o»oo-»®» 8 *
5/rnp.V send your fiks end ordsr QftUNh
WWW. PCS- POOL COM
Jk oread
wore
2 in Target easily & quickly. \
Fall ANSI ‘C compiler, assembler
& linker all Windows32 based.
-i-iA
‘.I|m r* t i r. _ 1
m Source Level Debug.
i Full Driver Support with
• Libraries.
\
df Time Multitasking OS with
a free run time licence.
5
EE Unlimited email support./
:r
•A
||rAl [ ] |
irwr
■ y.t jo 1
tmui
W¥ .cms.uk.com
see our web site for full details
CAMBRIDGE MICROPROCESSOR SYSTEMS LTD
Unit 17-18 Zone 'D' Chelmsford Rd. Ind, Est
Great Dun mow. Essex CM6 1XG
Telephone: 01 371 875644
email: sales@cms.uk.com
6/2004 - izkoi ekdnnks
Micro-
controller
program-
mers are
usually ded-
icated to the
devkes of one
particular manu-
facturer. This multi
programmer/ however/ can
not only program the most important mid-range microcon-
trollers made by Atmel (and soon also Microchip)/ but also
serial EEPROMs. Thanks to its USB interface/ programming
is simple, flexible and quick.
10
d=!rfor dectr&ftfi -6/200-1
This multi' -programmer is tailored to
the requirements of the semi-profes-
sional user. It Is not designed for the
entire range of microcontrollers from
one particular manufacturer, but rather
for general use with standard 8 -bit
microcontrollers which have limited
memory capacity. The hardware is
capable of programming microcon-
trollers from more than one manufac-
turer (currently Atmel and Microchip)
as well as serial EEPROMs. Since
these use different programming algo-
rithms and voltages, this is something
of an unusual feature.
'Semi-professional 1 also means that
the programmer is a development
tool, and so must be suitable for use
while debugging. The programmer
must be fast so that the job of getting
software to work correctly does not
become a chore.
The programmer must also be con-
trollable, which is achieved by using a
USB interface. HID (Human Interface
Device) compatibility means that the
device will work straightforwardly
with versions of Windows from 98SE
onwards. All that is needed to oper-
ate the multi-programmer is a spare
USB port on the PC. The device takes
its power from the USB port (it is
'bus-powered'), and so no mains sup-
ply is needed.
The microcontroller used does not
have its own program memory, and so
the firmware is downloaded directly
from the PC over the USB cable when
it is plugged in. Updating the
firmware simply requires changing a
file on the PC.
It is also possible to store the firmware
in an EEPROM on the programmer
board, accessed by the microcontroller
on pov/er-up. In this case the USB
must be used to upload new firmware
versions into the EEPROM.
A special feature of this device is that
the microcontroller to be programmed
does not have to be removed horn the
target circuit and put in the program-
ming socket. The programmer has two
ISP (in-system programming) inter-
faces available, one for Microchip
microcontrollers, one for Atmel
devices.
USB Microcontroller
At the heart of the hardware is the
TUSB3210 (1C 1) from Texas Instru-
ments. This is an 8 052- compatible
microcontroller with a full speed
(12 Mbit/s) USB interface, offering four
I/O ports each with 8 port pins, a
UART r a watchdog timer and an I 2 C
interface. The TUSB3210 does not have
its own flash memory, and so the
firmware must be reloaded every time
power is applied. Software is loaded
into the 8k-by-8 (8 kbyte) RAM mem-
ory by a built-in hoot loader: this can
he over the USB interface, or, alterna-
tively the software can be stored in
serial EEPROM IC5 (a 24LC64). The
EEPROM is connected to the I 2 C inter-
face pins SDA and SCL of the
TU SB 3 2 1.0: its contents are read when-
ever the device is reset and copied to
the TUSB3210’s RAM. If the USB option
is used a driver is required on the PC
to send the software to the TUSB3210.
Whether from the EEPROM or from
the PC, once all the firmware has
been copied into RAM the boor loader
software disconnects from the USB.
The program stored in the RAM is run
and the device is then reinitialised
over the USB.
Programming
voltages
IC1 controls all the programming sig-
nals and voltages over its 32 I/O pins.
In order to generate the programming
voltages required by various micro-
controllers the 5 V supply from the
USB is converted to approximately
6/2004 - elskler e fettic rib
13 V using a step-up regulator. Nor-
mally the output voltage of the
switching regulator would be a con-
stant 12 V t but a diode in the feedback
path of IC3 raises the output voltage
by the forward voltage drop of the
diode: this higher voltage allows PIC
microcontrollers to be programmed.
The programming voltages are
switched as required using p -channel
and n- channel FETs. A voltage of 0 V r
5 V or 12 V can be made to appear on
pin 1 or pin 31 of the programming
socket. A voltage of 13 V is available
for the MCLR signal on ISP connector
K3, which is used for programming
FICs, Diodes D5 and D7 reduce this
voltage hack down to 12 V: this lower
voltage is used when programming
Atmel microcontrollers.
TTL gates with open-collector outputs
(type 74LSG7) are used to drive the
FETs. This allows a voltage of 0 V to
appear between gate and source,
ensuring that the transistors can be
fully turned off. If used directly, me
voltage on the I/O port pins could only
rise to about 3.3 V T giving a gate- source
voltage of 10 V: the transistors would
then still conduct.
Some microcontrollers require a pro-
gramming voltage on the reset or crys-
tal inputs. In the case of the 90S 1200,
for example, a minimum voltage of
0.85 V cc = 4.25 V (assuming a b V
supply) is required on the reset input.
Since the TUSB321Q runs from a 3.3 V
supply it can only deliver a logic high
level of 3.3 V; the remaining gates in
IC4 are used to produce a high level of
over 4 V.
Programming soeket
Most devices can be programmed
directly in socket IG5. Crystal X2 pro-
vides a dock source for Atmel 89Cxx
and 89Sxx type microcontrollers.
Because of the limi ted number of I/O
pins offered by the TUSB321G only a
4-Vcc
©
rVj3
e;
17
SI
tit
-L
I!
T d "
;ai4 |3i§
e
ICS
** 5-Ci.
A3
24LC64
WC
■a
ri
_z.
—
n
"■*
JL_i
*
C3
i Fl'2^
© © ©
KST (CJ
t hout
TESTS
BSV
.‘C
fC
FEV
F3*
FT 1
PCJZ
POJ
FQ.4
P34
Kls
FIT
rl 3
Fl.l
Fl_2
p;jj
Pl.i
Pi, 5
PI. 5
Ft 7
ij
FOIS
iS
45
Fi-iy
47 FC^/
4-i.
z -iS
45
=-:
FIT/
C .J
52
Pit / •
53
34 Pliy
15
-'V
pisy f
45
'■V
4T
FtJ/ j
22
F29y |
23 Fit / i \
71 PK/
'
T?
Fit/ ;
25 F 13/ !
29
p s=y
3G
p 11 /
53
piiy
57
p^iy
B
ptay !
£=3
54
FJi/
53
pisy J
g?
pjjy
51
pj-y^
24
(Alrr.=
E2d
iSP
(Microchip)
CSEH-tl
Figure 1 „ TFe TUSB32 7 0 mc/iPOes /^C one/ USB interfaces, and so the only additional hardware needed is o step- up converter
and a tew MOSFETs .
certain range of microcontrollers can
be programmed. Other (larger) micro-
controllers can, however, be pro-
grammed using the ISP connectors.
On closer inspection, you will notice
that there is no ground connection on
pin 10, as would be required, for exam-
ple, by an 89CxG51. Since the supply
current is not particularly high during
programming, it is sufficient to provide
the ground via port pin P3.6 of IC1.
The voltage does indeed rise a little
above ground, but remains within rea-
sonable limits.
PC software
The software running on the PC is
written in Delphi 7. The menu lan-
guage can be set (under Setup, as
shown in Figure 2) to English, French
or German. This setting, along with all
other settings, is siored in the registry
and automatically recalled when the
program is next run.
Also under Setup are options to control
whether signature bytes are read, and
whether the device memory contents
are verified after programming.
The device type is set under the
Device menu item (see Figure 3),
There are two sub-menus available
here: Socket (he., IC5) and ISP Connec-
tor (Le. P using connectors K2 and K3).
Currently only the Socket option is
available. Toe next choice is between
Atmei MCU and serial EEPROM. Under
Atmel MCU the available ranges of
microcontrollers are 890x051, 89C5x,
89Sx and the two AVR microcon-
trollers, 90S 1200 and 9QS2323. Of
course, functions such as lock bit and
fuse bit programming are supported.
On 89C5x microcontrollers only lock
bits 1 and 2 can be progr amm ed, since
there are not enough port pins avail-
able on the TUSB321G to allow pro-
gramming of lock bit 3. None of the
lock bits can he programmed on 89Sx-
type microcontrollers. If a type
90S 1200/9 0823 13 microcontroller is
selected, then when configuring the
second fuse bit two variants (the
RCEN fuse bit and the FSTRT fuse bit)
are displayed. If the microcontroller
type is detected, the text changes to
show the name of the fuse bit sup-
ported by the device in question.
If a serial EEPROM device is selected,
there is in some cases more than one
device rime ending in the same digits
(the digits correspond to the size of the
memory)- Devices in the 24AAxx and
24CxxC series with the same capacity
diner, however, in their page size: this is
the number of bytes that form one Tow’
in the memory that can be programmed
in one cycle (approximately 2 ms). The
bigger the page size, the quicker the
12
e!d:t:r tkiiic* Its -6, iOOi
overall programming operation.
AH programming functions such as
program, verify, erase, read, program
E EPROM, read EEPROM, read fuse or
lock bits and detect device are directly
available either using buttons or under
the Action menu (see Figure 4). If the
microcontroller has been selected as
autodetect, then it can be tested using
Detect Device. This causes the signa-
ture bytes to be read from the device.
The bytes are analysed and informa-
tion including the memory capacity,
progr amm ing voltage and exact part
number are displayed in the upper
right-hand comer of the window under
Device.
When an action is selected, the signa-
ture bytes are first automatically read
out of the microcontroller before the
action is carried out. Tne signature
byte test can be disabled by deacti-
vating the Read signature bytes option
in the Seine menu. This might be nec-
essary if a fault in the microcontroller
makes it impossible to read out the
signature bytes.
The Read action reads the entire mem-
ory contents out of the device. Tne
number of bytes to be read is deter-
mined from the Information in the sig-
nature bytes or by the digits at the end
of the part number in the case of a
serial EEPROM. If, in the case of a
microcontroller, the signature byte has
not been read, then the maximum pos-
sible memory 7 size for a device in the
selected series is used. For example, if
the 890x051 senes is selected, then
4 kbyte will be used, since this is the
memory capacity of the biggest device
in this series, the 89C4051.
Under the Buffer menu you can choose
whether the data in the buffer can be
altered using the hex editor (Buffer
editable). You can also select whether
da! a in the buffer is synchronised with
the data in the previously -opened file
before any write or verify action is
started (Update buffer horn hie).
j*j
Fie &/F w Chc«
* rcSdfiJTvX-.j'f I t't
* -,‘rl L . &£? * rci
OxOtO 7EDB 12 DO
GX02Q 7E8A 0575
0x333 ZlXr
0x3*3
£ CIVV “Fl7
T5 ±?75 =::£
Owlsch
IOE5
It" 7
FT 17
■172
- fr
1711
ODi*
ir _ :
G17F
a i ~ ~
I’f -
03 1 2
0FI2
E 7" C
t r t ■»
7^F0
1175
IS 3 =
-ZDZ 1
7550
r“£-t
. L 1
75E^0
-Y7F-5
F.~r
0112
C-2 1 7
"It
1200
EE 15
1 030
r-TT”
iii-5
- - - =
BOa.F
3 • : :
i - T.“
■ - 1 1
2DT6
C-lS 3
53 ET
5! 5 4
"7 2-4
ZTl;
TTEZ
lz f;
ZM 3
I3FC
21 1 E
2 E IB
2F Zi
TTT
“1 "T
1I5E
F51S
J2l±
22 SF
12 27
24 Cl
227 7
---.-0
SM9
LE14
,^7
*5li
■
1ST-;
? : f
“Si:
TlS
14C2
5Ei;
3F 1 '
.77
sscc
27 77
III 1 ,
Iz
EslE
12;;
r i . :
7512-
0075
ICGO
I2C 0
I;7-7I-
7 712
FSES
f:-75
812 Q
0220
i2 E
t-;i 5
±4F5
Co 12
90 T 2
1212
EF±2
FITT
= 317
isr-i
TllS
mm
zoic
iZZO
7/E-i
- ^- 0 .
, . Uaf] u' y* ul.
T. .6
. A*dT?,
. . :±E£ry!>H
® 1
rirVZXl
tuner lex
3 IS F -£ ?
Figure 4, Using 'Detect Device' the signature bytes and other data can be displayed
in the upper right-hand corner of the window
used which gives the number of bytes
in each packet. A further byte indi-
cates whether the data packet sent is
the last one (byte is zero) or whether
further packets follow (byte is 1).
When reading, a count of the number
of bytes to be read is sent to the pro-
grammer, Generally the size is speci-
fied in kilobytes or kilobits. The soft-
ware in the programmer can deduce
how to interpret the value from the first
byres that were sent.
After each action the programmer
sends a number of bytes back to the
PC to indicate that it is ready for more
data to be sent or to carry out the next
action.
Programmer
software
The software in the programmer was
written using the Keil pVision2 C com-
piler, The main routine first disables
the watchdog timer and then takes ah
pins on the programming socket to 0 V
using the function ResetPragrammer().
Next the USB registers are set up.
When the boot loader software in
ICl completes, it disconnects from the
USB by taking output pin PUR low so
that R1 no longer pulls up to 3.3 V. The
downloaded software must set the
SDW bit in the MCNFG register to
reactivate this output: the programmer
will then reappear on the bus.
The PC host then sends a number of
SETUP tokens to identify the device
and configure its USB interface.
These tokens are processed by end-
point 0. The data transferred includes
the unique address for the device,
which is subsequently used to com-
municate with the progr am m en Vari-
ous descriptors are also transmitted
to the host during the setup phase,
providing information about the
device and its functions and charac-
teristics. These include the report
descriptor, which in this case identi-
fies the programmer as an KID -com-
patible device.
Once all the descriptors have been
sent to the PC, initialisation of the USB
interface on the device is complete and
it is ready to operate. The direction of
data transfer is specified by a token. If
the TUSB3210 detects an IN token,
then data, such as status information
or a data packet, is to be sent from the
programmer to the host. If an OUT
token is received, then the data packet
is impacked by the programmer and
the payload programmed into the
device (assuming that that is the
selected action).
The advantage of initialising as
an HID -compatible device is that
no special Windows driver is
required to communicate data
between the PC and the pro-
grammer. Windows versions
from 9SSE onwards support this
standard.
Under the HID standard, data is
exchanged in so-called reports*
During USB enumeration the PC
provides a number of descrip-
tors. The device descriptor
includes information such as the
Vendor ID (VID), Product ID
(PIDJ, and the USB version sup-
ported by the connected device*
The configuration descriptor
includes information on the cur-
rent consumption of the hard-
ware and the number of avail-
able endpoints* The report
descriptor gives the size and
number of reports to be
exchanged between the PC and
the programmer* It specifies
how many bytes are to be sent
or received and the function of
the attached device (mouse/
keyboard, joystick/ memory
stick etc*)* More detailed infor-
mation on USB and HID can be
found on the USB homepage at
14
tlekltf efeifionsts - 6/2004
figure 5. Component mounting plan for the doublesided printed circuit board.
f igure 6 . Tiny ana tricky to solder: the USB microcontroller comes rn □ 64 -lead SPFP
package .
Program ming
routines
The data received is decoded by the
routine DecodePrcgramnierDetaf) in
the file Prog.c. The first byte of the 64*
byte report contains the code for the
selected microcontroller, while the sec-
ond gives the desired action. These
values are nsed to call one of a number
of different programming algorithms
for different devices, as given in the
microcontroller data sheers.
Each device series has its own power-
up rontine which applies power to the
correct pins and sets the programming
signals used to defined levels. Once an
action has been successfully com-
pleted, the routine to reset the pro-
grammer is called, which sets all the
signals on the programming socket
back to 0 V Since in general it is
desired to program more than the 64
bytes contained in one report, the PC
must send a further data packet to the
programmer as soon as the previous
one has been processed. The program-
mer sends a defined message to the
software ru nnin g on the PC to notify it
that the next packet can be sent.
The PC then prepares the next report
packet and sends it to the hardware.
The last packet to the USB program-
mer contains a zero byte. When the
device is read, data is also transferred
in reports of 64 bytes each, where the
first byte gives the number or valid
bytes in the packet.
Tne above description of the program-
mer software can give only a broad
overview of its operation. More detail
can be found in the thoroughly-com-
mented and clearly-structured soft-
ware itself.
Construction and
operation
Populating the printed circuit board
would be child's play were it not for
the tiny TUSB3210 in an S-PFP-G64
package with many fine leads. Solder-
ing such SMD ICs requires not just a
steady hand but also nerves of steel
and a good deal of confidence. After
fixing the IC in place with a drop of
glue, you must take the soldering iron
and do what you would normally try to
avoid at all costs: rather than soldering
the ICs leads to their corresponding
pads, solder all the leads together. This
should be done as quickly as possible,
so the device does not get too hot.
When this big short-circuit and the IC
have cooled down, lay some unused
desoldermg wick across the pins and
use it (and not a solder pump!) to suck
away the excess solder. Again, take
care not to get the IC too hot. Finally,
check with a magnifying glass under a
good light, and using a multimeter,
that all the pins are well soldered and
no longer shorted to their neighbours.
Once the TUSB3210 has been correctly
soldered to the printed circuit board,
the remaining construction is relatively
straightforward. All the ICs (except for
the tiny voltage regulator) are provided
with sockets. Even the zero insertion
force socket should be fitted in a
6/2004 - eStklcr elfdrolts
15
Devices currently supported
The programmer firmware can 'easily be
updated to the latest version at any time:
ou simply need to v/rite the new
rmware into the EE PROM and, IF nec-
essary, replace the software on the PC.
Currently ihe firmware is capable of
programming the microcontrollers and
EEPROMs listed below. An update is
expected shortly that will support PIC
microcontrollers and ATmega devices.
This, os well os all Future updates, will
be included with the PC software
available for free download from the
Elektor Electronics website under
product number 020336-1 1 , see
month of publication.
Aim el microcontrollers:
890051, 89C205 1,8904051,
socket rather than being directly sol-
dered to the board.
When construction is complete and
yon have inspected the board, you can
carry out the first test. If a ready-pro-
grammed EE PROM is available, no
Windows driver will be required. If the
programmer is now connected to the
USB, it should appear in the Device
Manager as an HID -compatible device.
You are now ready to program your
first microcontroller.
If no serial EE PROM is fitted, the
firmware must be downloaded over
the USB. The TUSB3210 boot loader
registers itself, Windows recognises
the new device and will now need the
Texas Instruments device driver. This
driver (called the 77 AppJoader Driver)
is not provided as part of the Elektor
Electronics disk or download, but can
be obtained for free from the TI web-
site at wwtv.ti.com . Select the direc-
tory with the file TUSB321G.inf and
install the driver and then the file
Aploader.sys from the same direct of/.
Finally you will be asked for the direc-
tory containing the firm w are: enter the
path to the file TUBBS 2 10. bin. This will
automatically be copied into the direc-
tory /System 32 ./drivers, along with the
file Aploader.sys. lithe programmer is
now reconnected, the driver will send
the firmware from the file /Sys-
tem32/drivers/TUSB32 10-bin; after a
brief delay the code will start execut-
ing on the pro gr am tti rt. Toe program-
mer will now be re -enumerated as an
HID device.
-2Z3S35-I]
9051 200, 905231 3, 89C51 , 89C52
89C55, 89LV51 , 89LV52, 89LV55.
89S53, 8958252
EEPROMs:
24xxG0, 24xx01 , 24xx02, 24xxG4,
24xx08, 24xxl 6, 24xx32, 24xx64,
24xxl 28, 24xx256, 24xx512
COMPONENTS
LIST
Resistors:
Rl = 1 kI25
R2 = 470li
R3 r R6 = 1 80 kD
R4.R5.R9-R1 3 - 10kQ
R7,R8 - lOOkQ
R14,R15 = 2kQ2
Capacitors:
Cl ,C2,CI2,C1 3 = 33pF
C3,C4,C5,C1G,C13 = 100r,F
Co = 10 H P 16V radial
C7,C9 = 47[if 16V radial
G8 = InF
Semiconductors:
D1 = LED, red
D2 - 0A5 or 1N5&17 (Parnell # 573-
097)
D3,D5,D7 = IM4148
D4,D6 - BAT43
IC1 = TUSB321 QPM
IC2 = LP2950CZ-3.3 or LE33C2 (FarneSI
# 302 4568)
IC3 = MAX734CP
!C4 - 74L504
IC5 - 24LC64
]C6 = 40-way ZIP socket with wide slab
Tl J2J4J5J8 = B5250
T3J6J7J9 = BS170
Miscellaneous:
K1 = USB 'B' connector, angled, FCB
mount
K2 = 6 -way pin header
K3 - 5-way pinheoder
LI = ■ 1 8 pH miniature choke
X1,X2 = 1 2MHz quartz crystal
FC8, available from The PCBShop
Disk, PC software and firmware / source
code files, order code 020336- 1 1 or
Free Downlead
16
d'tlor - 6/ 28D4
Forest Electronics - PIC and AVR ANSI C Compiler Products
FED : s ANSI C Compiler for PIC or AVR processors
* Fully integrated editor with syntax highlighting, multiple pages etc,
* Full project support - include and manage multiple source files, simulator,
assembler files and notes/commenls within one project
* Fully integrated simulator and waveform analyser step from C line to C line,
or examine code in assembler form. View device pins using a logic analyser
application.
* Simulator supports LCD modules, keypad, buttons, LED's, displays,
analogue inputs, serial and asynchronous data.
* Designed to ANSI C standards
* PIC- Supports 18xxx r 16xxx, 12xxx series 14 and 16 bit core processors
* AVR - Supports standard and MEGA core processors
* Generates MPLAB/AVR Studio projects and source files and completely
standard hex output files.
Prices from £45.00 - www.fored.co.uk for full details.
W/Z- C / AVID ICY
Drag and Drop rapid application development
using ANSI C for PIC and AVR
* Rapid Application Development for the PIC or AVR microcontroller using the
C language (WfZ- C for the PIG, AVID ICY for the AVR)
• Drag and drop your software component selections on to your design
* Included components support timers, serial interfaces, 12C, LCD, 7 Seg
displays, keypads, switches, port controls, many bus interfaces including El C
and Dallas [Button, AVR/FIC Hardware, and more.
• Connect software components to MCU pins by point & dick
* Parameters set from drop down list boxes, check boxes, or text entry
• Links your code automatically into library events (e g. Button Pressed, Byte
Received etc.)
* Automatically generates your base application including full
initialisation, interrupt handling and main program loop
* The complete C Compiler and AVR Simulator programs are
integrated into AV1DICY - total editing I compilation
assembly / simulation support in one program
* Also includes the Element Editor to enable you to create
your own components with ease,
* Demonstration available from our web site
Prices from £50.00 - full details from www.fored.co.uk
Forest Electronic Developments
12 Buldowne Walk, Sway
LYMINGTON, Hampshire, 5041 6DU.
Email -
“infodfored. co.uk"
01590-681511 (Voiee/Fax)
Full details from - www.fored.co.uk
Electronic prototyping prod; Ms and
services frora the makers of WeroboiE d
Veroboard
Prototyping Boards
Extender Boards
Wiring and Terminal Pins
Standard Backplanes
Verowire
Card frames
Front Panels
IBM PC Brackets
Vvero
TECHNOLOGIES
Vero Technologies Limited
Unit 25, SoSent Trading Estate, Shamblehurst Lane, Hedge End, Hants, S030 2FY
• 01489 776931 telephone * 01489 776938 fax * sales@tferoil.com email *
sales; 087 0225 9505 internet; www.verotl.com
6/2004 - cLkiot electronics
17
Harry Baggen
That s class. . .
audio amplifiers from A to T
The final amplifier is the power source of every audio
installation. Its job is to convert a small alternating
voltage into a powerful signal suitable for driving
loudspeakers, with as little distortion as possible. During
the years since the invention of electronic audio
systems, designers have come up with various
approaches to this problem. It all started with Class A...
- «, _
more noise, a lot more power
For many people/ the amount of power an amplifier can produce h an important factor in judging its
characteristics (So your amplifier delivers 2 x 40 watts? Mine does 2 x 701)* But In practice, power
plays only a minor role*
You can already make a fot of noise with just a few watts* If you use a set of loudspeakers that can
produce a sound pressure level of 86 dB at 1 W (which is a value commonly stated by manufactur-
ers in speaker specifications}/ you can manage 90 dB with just 2.5 watts* With 25 watts, you have
enough for 100 dB. That's already rather loud sand harmful to your ears as well!].
Our ears perceive each 6-dB Increase in the sound pressure level as a doubling of the volume level,
but this requires increasing the power by a factor of four. This means that if you really want to have
a bigger final amplifier with more power than what you presently have, you will need an amplifier
with at least four times as much power to actually notice any difference*
Delivering a large amount of power is not a simple task for an
amplifier. Voltage amplification and current amplification are
both necessary in order to provide sufficient power to the
speakers connected to the amplifier. Dus is because loud-
speakers have an efficiency of only a few percent* which
means that several watts are certainly necessary to generate
an adequate sound pressure level in a living room. In the case
of concerts or outdoor events* quite a bit more is required, and
the necessary power can easily amount to several kilowatts.
To produce power amplification in a final amplifier. Various
concepts have been developed for using transistors or FETs to
generate high-quality output signals author improve the
efficiency of the output stage. (Here we leave
valve amplifiers out of the picture. I
When devising an output stage,
the designer must take
into account
the
specific properties of ihe semiconductor devices being used.
If we could work with idea]’ transistors or FETs, it would be
much easier to build good amplifiers. Unfortunately, all semi-
conductor devices suffer from non-linearity in their amplifica-
tion characteristics, and this causes major problems, espe-
cially for processing analogue signals. These problems can be
minimised by using properly dimensioned feedback. There
are also other nasty side effects that also occur, depending on
the selected configuration* such as the notorious problem of
crossover distortion.
Especially with large amplifiers, heat generation is another
factor that must be taken into account. It can lead to far-reach-
ing thermal effects, such as drift of the quiescent current set-
ting and thermal modulation distortion.
Final amplifiers are normally classified according to the con-
figuration of the output stage. This largely determines their
efficiency and quality, since die output stage is where the
actual power amplification takes place*
The various amplifier configurations are designated
using the letters of the alphabet, although the
letters do not say anything about how
they w ork* It all just started
with the first letter of
the alphabet.
19
Class A
Figure I . A Class A
amplifier has very
low efficiency, but it
is ioially free of
crossover distortion.
A^[)o
Figure 2. In o Class
B configuration,
each transistor
conducts for half of
the sine-wave cycle.
Here problems arise
orovnd the zero-
crossing point.
+Us
©
r©
L©
0
-U s
0*2122-12
Figure 3, Class C
uses □ tracking
power supply whose
voltage is
continuously
adjusted to match
the signal
amplitude.
tIIb war
h©
signal
detection
-© d
-Up var woicz-is
Figure 4. Class H
limits i tself fa
switching between
several different
supply voltages ( in
this case two).
US2
drive
electronics
HS 1 Q 2 -U
Here ue begin wiih the simplest configuration, the Class A
final amplifier, which H also one of the be>t configurations
for bigh-qualit) audio reproduction. In its basic form, this
configuration can be implemented using a standard emitter
follower (Figure Ik The quiescent current through the tran-
sistor is equal to the peak AC output current which means
that the transistor is biased in the middle of its working range
and simply conducts more or less current when driven by an
alternating voltage. The efficiency is very low: 25 T at maxi-
mum output amplitude, and even less at low signal levels. The
efficiency can be improved by using a symmetrical design
with tw o transistors, but even then die highest efficiency that
K— -i*
can be achieved is 50 € d
Class B
The Class B configuration employs two transistors, each of
w hich conducts for exactly half of the signal cycle
t Figure 2 I. Tn the quiescent state, no current at all flows
through die transistors. The efficiency of a Class B output
stage is around 7S FT but the primarily disadvantage of this
configuration is the 'transfer distortion' that occurs each time
the load must be transferred from one transistor to the other.
Due to the sharp bend at the bottom end of the transfer char-
acteristic, the tw o hah es of the signal waveform do not prop-
erly align with each other. This leads to ihe notorious prob-
lem of crossover distortion . w hich is a quite audible degrada-
tion of the signal waveform.
To solve this problem. Class A and Class B were combined to
produce Class AB. This is a Class B configuration in which a
small quiescent current flows, causing the output stage to
actually work in Class A at low power levels. This approach is
presently used in various forms in most final amplifiers. The
efficiency remains approximate!) the same as for Class B.
GandH
Hey. just a minute! Haven't we skipped a few classes? We
hav e indeed, but we did so on purpose. Classes C. E and F
also exisn bin the) are actual!) only suitable for high-fre-
quency applications, which means the) more or less fail out-
side the scope of what we're talking about here. And the
design of Class D amplifiers is so different from Class A and
Class B that it we decided to deal with it separately. So, let's
first look at classes G and H. which hav e an important feature
in common. This is that in both of these classes, the supply
voltage is adjusted according to the magnitude of the output
signal, in Class G (Figure 3), the supply voltage is continu-
ously adjusted to match the desired amplitude of the output
signal. Such a 'tracking' supply voltage can be implemented
relatively easily using modem sw itching power supplies,
although it is of course important to have a sood regulator cir-
cuit to allow the ^uppl) voltage to respond sufficient!)
quickly to changes in the amplitude of the signal generated by
the output stage,
in Class H (Figure 4), what happens is essentially die same
as in Class G. except that here the supply voltage is switched
between several distinct levels i usually two) instead of being
20
ddttor dcdronlts - 1 '2604
+u 0
©
Figure 5- A Class 0
amplifier consists of
a pulse-width
modulator with a
power output stage
and a low-pass
filter.
continuously varied. This allows the dissipation in the output
stage to be considerably reduced, especially v, hen large
amounts of power are involved*
Class D
With the Class D amplifier configuration, the letter 'D doesn’t
have anything to do with 'digital' (that’s just a coincidence k
It refers to a sw itching amplifier that uses pulse-width modu-
lation i Figure 5i. The input signal is compared with a trian-
gular waveform, and the signal from the comparator sw itches
the output stage to the positive or negative supply voltage.
This is done using a very high switching frequency, which is
usually ten times or more higher than the audio bandwidth
(which me;ms 200 kHz or above ).
With this form of modulation, the pulse w idth depends on the
level of the input signal. If a low -pass filter is placed after the
output stage, the pulse-width signal is integrated and what is
left is an analogue signal w ith the same form as the input sig-
nal. but of course amplified.
As the output stage only has to sw itch, it^ efficiency is very
high. However, there are also a number of drawbacks to this
approach. It is rather difficult to keep the signal waveform
free of distortion, a hefty output filter is required, and drastic
measures must be taken to limit radiated interference For
low-distortion amplification, it is always necessary to u^e
negative feedback (analogue or digital).
Classes S and T
Although the w orking principle of the Class D amplifier is
already several decades old. it never managed to become truly
established in hi-fi applications. This w as primarily due to
excessive distortion and a lack of good semiconductor devices
(fast power FETs I. In the meantime, several manufacturers
have dev ised variations on this theme, and in many cases they
have siven them their ow n designations. For instance. Crown
_ [47Cu | tK"
&3V -53V 1 25 OY :
-+ * ♦ *■
Vj-jh
25DV
47_
i 25V
C33
IDOfl
-Qvhid
Figure 2. The circuitry around the amplifier fC.
28
&!^.icrecctfc."iH -6 20C4
Protection
To protect the amplifier, the driver IG
monitors the supply voltages and the
currents through, the transistors. The
VFPSENSE input is used to monitor the
main positive supply voltage for over-
voltage and undervoltage; the
VNN SENSE input is used in the same
way for the main negative voltage. If
the supply voltage is outside the
allowable limits, the output stage is
disabled (mute mode). If the supply
voltage returns to within the allowable
limits, the output is again enabled. For
the calculation of the associated com-
ponent values, please refer to the data
sheet. Theoretically, the amplifier could
become 'stuck' in situation in which it
constantly detects an overvoltage.
However, that is very unlikely t since
both detection inputs need more than
roughly 68 V before they respond. This
thus primarily amounts to protection
for the IC itself, since several of the
power supply capacitors are only rated
for 63 V.
The calculations for overcurrent pro-
tection are certainly more interesting
that those for voltage protection, since
they determ in e the minimum load
impedance the amplifier can handle at
maxi m u m output power. Since the out-
put stage operates in switch mode, the
MOSFETh used in the circuit determine
■he maximum load capacity of the
amplifier. Hera we have selected a rel-
atively heavy-duty ST Micro electronics
type, the STW38MB2G. This transistor,
which is housed in a TO -247 package,
can handle up to 38 A and has a maxi-
mum dr ain- source voltage of 200 V.
The maximum channel resistance with
a gate-source voltage (U GS ) of 10 V is
G.G65 Q {I D = 19 A). A disadvantage of
MQSFETs with this sort of specifica-
tions is that their input capacitance
(C iS£ ) is rather large, in this case as
much as 3800 pF. That explains why
the drivers in the 1C must be able to
deliver rather substantial currents in
order to switch the MQSFETs suffi-
ciently quickly. We primarily chose
these transistors in order to reduce the
risk of unpleasant surprises when
using speaker systems with unknown
impedances. Naturally the break-
before-make time could be made
shorter if transistors with significantly
smaller gate capacitance axe used,
which would reduce the distortion
level. However, our choice was in
favour of a design that can tolerate low-
impedances.
Overcurrent detection is provided by
the two low-inductance resistors R6
and Rll (R27 & R32), which are con-
nected in series with the transistors as
sense resistors. R6 is used for positive
half-cycles in series with the drain of
T1 t while Rll is used for negative half-
cycles in series with the source of T2,
The response threshold of the protec-
tion circuit is set in combination with
R21. The IC directly measures the volt-
ages across the sense resistors and
uses these voltages to generate a cur-
rent through R21. The maximum out-
put is determined by comparing the
voltage across R21 with the overcur-
rent threshold voltage V TCC . C13 (C36)
filters the voltage from the rectifier. The
relationships between these compo-
nents are given by the following two
equations:
Ima* - 3580 X (VTOC - (Ibias X H21))
* (R21 X R6)
R2I = {3580 X VTOC) - (Imax X R6 d-
3580 X Ib ia3 )
Here VTOC is the threshold voltage for
overcurrent detection (typically 0.97 V)
and I bias is 20 flA.
The first equation can easily be
rearranged to allow the component
values to be calculated. The second
equation can be used to determine the
value of R21 (R42). We have chosen a
m aximum output current of nearly 20
A t so that a load of somewhat less
than 3 Q just avoids triggering the
mute mode.
The mute mode can only be reset by
briefly switching rhe level at the Mute
input or briefly svritching off the ampli-
fier, When the mute mode is active, the
HMUTE output is High, and this signal
drives a LED that can be fitted to the
front panel if desired. A red high-effi-
ciency LED should be used for this pur-
pose, since reducing the value of R43
would overload the output.
Fewer supply
The supply voltages for the amplifier
board are provided by a second printed
circuit board. This board includes,
among other things, the -5-V and
VNiO supplies, as well as fuses for the
main supply voltages, it also supplies
a delayed 'un-mute’ signal that pre-
vents switch- on plopping 1 * To avoid
creating an earth loop and prevent rip-
ple currents from flowing though the
input stage ground path, the mute sig-
nal is fed to the IC via an optocouplar It
is located on the amplifier board. The
input of the opto coupler is thus fully
isolated from the amplifier, but an
active signal is required to switch the
amplifier Mute input.
The main supply voltages (VPP and
VNN) for the TA3Q2G are decoupled as
well as possible using special elec-
trolytic capacitors (030, 031, 034 and
C35) and MKT capacitors (C32, C33,
G36 and C37). A simple decoupling
network is used for the 5-V supply volt-
age for the input amplifiers.
Tb suppress possible interference from
the output cue uit as well as possible,
analogue ground and modulator
ground {which is also the ground for
the rest of the circuit) are kept separate
and coupled on the solder side of the
board at a single location using an
SLID inductor.
- eleVfoi derirofUB
29
Layout
As already mentioned at the beginning
of the arcide, the amplifier relies on a
carefully designed layout. The layout
thus forms an essential part of the
overall amplifier. Tripath emphatically
recommends copying the reference lay-
out, since otherwise the large high-fre-
quency currents could give rise to
unexpected effects. Naturally, some of
the components we have selected dif-
fer from ihose used on the reference
board, primarily with regard to their
dimensions. This is because we have
given special attention to the avail-
ability of the components ( preferably in
single quantities). Some of the tracks
have been shifted slightly in some
places, and a few components have
been added, but by and large we still
succeeded in maintaining the recom-
mended layout, if you take the trouble
to look at the photo of the reference
board in the data sheet, you vriM see
the resemblance to the photos of the
prototype. For some of the components
shown in the schematic that are fitted
on the solder side of the board in the
Tripath layout, we have put them on
the component side instead. This is
why the circuit board is placed paral-
lel to the heat sink in our version, with
the transistors mounted below the
board. This produces an attractively
compact and robust module, but we’ll
save further comments for the con-
struction description in the second
part of the article. What we can tell
you already is that although the mod-
ule looks vary simple at first glance, on
closer examination you will notice that
compared with the schematic, a few
things seem to be missing. Many of the
components are SMD types, and they
are fitted on the solder side of the
board. This yields the lowest likelihood
of interference problems and results in
an amplifier board with very modest
dimensions for a 2 ¥ 300 W" amplifier.
Most of these SMD devices come in
0603 ‘shapes’, which in all honesty 7 are
nasty little things to work with. To
make things easier for you. we will try
to supply the circuit board in the near
future with the SMD components
already fitted.
In the second part of this article (Sep-
tember 2004 issue), we give detailed
attention to the construction of this
unusual amplifier.
Web pointers
TA3020 data sheets & application note:
v/wn-v. tri path, com / dawnloa ds
TA302Q.pdf
TA3020 reference board -
vjvrw. tripath. com /downloads /KB -
TA302Q.udf
See your design in print!
Elektor Electronics (Publishing)
are looking for
Freelance Technical Authors/ Designers
If you have
# an in novo five or otherwise original design you would //fee fo see in print
in Europe's largest magazine on practical electronics
# above average sk/f/s in designing electronic circuits
# experience in writing electronics-re iated software
# basic skills in complementing your design with an explanatory text
# a PQ email and Internet access for efficient communication with our
in-house design staff
then do no i hesitate to contact us for exciting opportunities in getting your designs published on a regular basis.
F/ekfor F/ecFromcs
K, Watraven f Head of Design Dept
EO. Box 75 , NL-6190-AB fieefe The Netherlands, Fax: (+31) 46 4370161
Email ; k, walra ven @segm en t. nl
30
£':■ lor rltrtit-nia -6/2004
Visit our website
www.disteLco.uk
1
THE ORIGINAL SURPLUS WONDERLAND!
THIS MONTH'S SELECTION FROM OUR VAST EVER CHANGING STOCKS
Surplus always
wanted for cash!
]
GIANT 10" 7 SEGMENT DISPLA YS I 1C 's -TRANSISTORS - DIODES
U
At.< erases ls te cvc to -rese
CAST 7 segrertdgl^ eispteys s a new anhr&bto
pric£j The 10™ character sizu gwes esrepfara raed-
atffly at bng dstences srri eratfe a ho£ tf
tiers hiding ware boards, titgfel docks, cou>
tars, event time re ofc. As the tnts 2 re a s-'mp*a
*2bdTyix*±a"«2J e£?Ase and operate Tom 12 V PC,
ffTpg sAridirg va s^rfcres, rateys, RG or PC rrey
be used to ccrtro sngfe cr m_rxte cgs Lr fefo^j a
rretrai Zero Foust’ rreroy wtidii gas?/ smptfses
design. For an ex calient DIY practical article, see toe May issue cf
'Evaydsy & Practical EJectrorJes’ megazLoe Ideal School i Cobeoe con-
struction project Stopfed in gasd RFE pcrdcm. m Tpeto ifii tosf she^i
Less than 30 2 /;
of makers price I
Idi:* T It- -rr “ j^-«r=
" *ncj ‘>c~i C--14A1 r«
Only £29.95, e) or 4 / £99.0 Q[dj
OteRt V44 Order FH26
THE AMAZING TELEBOX
TV SOUND &
VIDEO TUNER
CABLE COMPATIBLE'
Converts your colour monitor Into a QUALITY COLOUR TVE!
“re TSLEdOX e eh EjacbiS ‘ufy cased mss papered mi ccrtsnrc si
e echoes reedy b pfm i ito a host at vtiaa n eriflij □, or AV aq u^j peri v.tocri
are fsd uni a ccmpceia yoso or SGArtT rem i he m p rai a vrv«iri ^ t
w3 aso p jg anecuy into mss .tmo rsaardsre. ato*T£ r^cepmo cr TV
chiftneSs net normafy recfcVsbfo on mast teiov&icn recefrert* (TELE-
--* - ' - - " ■ - - - - m ofBiJv
OBSOLETE - SHORT SUPPLY - BULK
10,000,000 items EX STOCK
Fcr MAJOR 1 SAVINGS
CALL or see web site www.distel.co.uk
COMPUTER MONITOR SPECIALS
Legacy products
High spec genuine muitysync.
CGA, EGA, VGA, QVGA
Hnautiahi FA341STTKL 14” SVGA Multisync a±xir rrcnfcr .vte fne
E12fl rfct ftfth tie End :-s±£rn rf 1G24 X 7ocL A VSTr
at/ of rp_& ath%3 ctmacfm to a hert cf carcctofs
fcdje .-3 ISM PCe in CGA, EGA, VGA & SVGA
mnrfcg BSC, COM-V ODORE ! rc3_drci Ami==
ARCHIMEDES end APPLE Mary fe^ixes: Etered
teradet* lad «r,to.cr.rc and LOW RADjATK}*iJ f ?PR
K*ed-G£icn_ Fifty cusrar:esd n EXCELLELT ‘t_£
usedcmdbDrLTi?t£,S*7vfi Bass £4.75
veAatfcfofBMPcmcixtei Only £129 (E) °SST
External rabies for other types cf Cafnptjdsf5 ar/aEtobfe’ CALL
Generic LOW COST SVGA Monitors
tVp ch cose the n iske, which includes Compaq.
MitsubushK IBKl etc. Supplied ready to run with a-7
BOX I r e). Plea tiim cortte on trs Fort perei akw -scepoon
inaafcia Cr cr LrF cdrtr crarrrt?, TELE50X 1® co.^rs ,ti>-
sfy a| Idsvisrti Feoutnoes Vr7 arc UK- ricLdrig the HYPERHAND £5
usad tyjnost cabia TV operators, tosei tor daMop computor video sys-
tems k PiP [jxtia h pcLtb) saups Far compie'e: mrrpefiwty - &se~ c-r
-ncrKirs v.mcLi scxnd - an regret 4 wan arto ampfinar and tow B R
3030 ojzxi. ara cr/.'ded s saroanL S'and new - Bh/ g jaraTsed
T t LE G OX ST fef corripcsito vxSsct input type men ftc ^ £35,95
T E LE B OX STL as ST but tKsd with integral speaker 09. 50
T E LE G OX H B )/ Ut h^r-d VK F.L h =.'C ai- a- Kyperoaid iu r»er ££9.95
Fc - 3 . £-3£i3 PAL verier.? state 5 5 cr S_mHz: sound speefeaben..
'Fcr cst:E 1 hypsfband s's^al racapdon t e^a£*ox W3 should be sen-
recied to a csb-ls type sefvtos. Stepping cn s3 Te'^bcXs, code (3)
State of the art PAL [UK epee) UHF TV tuner module
* nl
cao. r E5. Standard RTB 90 day c
14"
£59.00
order IDB4
15"
£69.00
order TG21
17”
£79.00
order TJE6
Supp.'KJ /n good u^d coodrt/c/i. Shfpp/ng code ;D;
PHILIPS HCS35
WDEO MONITORS
isarne styie £> C. .13333) sSiadrvEiy stj.c-d
with both RGB and standard camposita 15,525
with compfifirte IV pp v&eo
pp w550 * rtlCAM hi 0 e&rso sound
c-jtaucs. Micro electronics ail cn one smaS FC3 only 73 x
"160 x 52 mm enable fUi tuning conuxi via a simple 3 wire link to
sn BV pc tj-pa oompu^r. Stppf&d compie te wSh simple working
program and dOQjntontabc-rx. Rtagulras ^12V & + 5V DC to ope^to.
BRAND NEW- Grtfar is MYOO. Only £39,95 code (B)
See wwjv.cfj Sfel.co.uk^daLj^myOd.htrn for picture * foil cf* tells
HARD DISK DRIVES 2V 2 " - 14‘
2Vt TOSHIBA VK1CD2MA,- 1.1 Gb laptop! 1 2 5 nun H) Wew £59-95
2K 1 TOSHIBA J.EK4313MAT 4.SGb isp^p (3.2 mm Hi A r sw'£105,00
21:' T0SHlBAMKo40aMAV6.lGDiabtopt12.7rr-^H:/fe 1 v E9B.00
T TOSHIBA MK'314GAV 16 Go laptop (12 mm H) New £149.95
21 V to 31 i‘ ccnversion Jot Fc; Pc’s, ccmpteEs wrh oennerii^rs £1 5,95
j’ F COW PAQ 31 37D6-32 1 (IBM) 9 gh_lJLT/SCS 13 New £ 1 99,00
INDUSTRIAL COMPUTERS
3V FUJI rK--^9-2S 20 tL MFM 1/F
3’ : r C0?1NER CP3024 23 mb tDE I/P (Orequrr.) RF£
TE tfF {orequY.j RFB
3 r A' CONNER CP3044 40 mb IDE UT {or squhf.
K ■' QUANTUM 40S Pradrfva 42mbSCSI VF.
5VJ MEN ESCRIBE 3425 2Cmts MFM t'T [or &qy-y.) RFE
5% m SEAGATE ST-233R 30 mb RLL Vr fteforti
K / CDC 94205-51 40mfc HH MFM W RFE tssled
5 J ■/ HP 97543 650 Mb SCSI RrE testob
HP C3010 2 Ghjis SCSI differential FFE tes:srd
B" tiEC D2246 B5 Mb SiJD interface Mew
6 1 F LT J IT S U M 23 22K 1 60?, to S.M D L F RFE tested
£ l FUJITSU M2392K 2 Gb SWD Lr RFE tested
Many other floppy £ H drives, IDE, SCSI. ESDI etc from stock ,
see wefrslfe for foil stock Ust Shipping on all drives is code (6)
£59,95
£59,95
££9.00
£49.00
£49.95
£69.95
£69.95
£99.00
£195,00
£99.00
£195.00
£345,00
1 my & ~ 1= : z x srzed industrial 40 f.lhz 366 PC system measuring
coiy (mm) 266 w X S3 h X 272 d. Ideal For dedtoated Control appE-
catffins nmnlng C CS. Lin-mt ar even Vfindo^s ! S-t&st case cctv
lafns 65 1 3 265 VAC 50/60 hz 70 Vfatt PSU. a 3 5 tot ISA pasaro
tedrp = n = = -da Rocky 318{FCl04ji slendenJ, single board com-
PLI3 ; wiii 3 MByte NON VOLATILE sold state "Disk On Cte>'
RAM DISK, System comprises: Rocky 31 a [PCI 01 J S3C ISA card
vi^ih 40 M Hz AU 3o6SX CPU, 72 pin SIMM slot YjK h 16 Mfyto
SIMM, AMI BIOS, battery backed up rea. : time dock. 2 x9 pVi O
I600O s a rial pe ns. EPP/ECP preitor pod, mira 01 N keybas.'ti con-
nector, floppy port, EDr port for hard qK.’SS ltd to 526 MByte
espssfiy^ wstEftoog timer end PC 1 04 bus szdtet. Ttee B MByte
s-u'l-d stsis 'disk on a cri p 1 has its BIOS, and esn b&Ftfeked r
Fcatnailfid & boded. Supplied BRAND NE^V fully tested and rassr-
anteed. For ful dele see featitoBd rtem on website. Order 55 &G3-B
TOG’s of a p pi seasons inc:
n raw's! routers, robotics etc
Only £99.00 di
TEST EQUIPMENT & SPECIAL INTEREST ITEMS this section are pre crwnecL
.MITSUBUSHI FA3445ETKL 14Knd. spec SVGA utw^ors
FARNELL CL60V DC ^ 50 Amps, bench Power SuppSes
EARN ELL AP30B0 0-3OV DC @ 80 Ampsi bench Suppy
KJNGSHILL CZ403 1 ! tFSGV @ DC 2CO Amps - NFiV
1 kVV to 400 JeW ' 400 Hr3 phesa power sourc&a - ex stock
IBM B230 1 ypa 1. Tc-'ori ring base unh dm'&r
Wayne Kerr RA2CO Audio frequency response £!xe _.^er
IHFQDEC 1U, 24 pert RM5 rietw^rk p^lchpanafe. =TH93
3CG?i' 16570 12 Pod Ethymci hus - RJ45 connectors =LDi7
3€Q?4 16671 24 Pori Etoemet hub - RJ4o ccniecters
SCO 111 16700 S Part Etncmot hub - fU45 connecti&rs. ’ JEVi 1
IBM 53F5501 Ttften Rng iCS 20 peri :cde nxxLto;
IBM MAU Token ring distribution panel 822B-23-50 3 C .
AIM 501 Lzw tSstorecn Osdletor9Hzb330Khz, IEEE L'O
ALLGON 3360.1 15C5-1S60 .MHi hybrid pewer orrt'r^'s
Trend DBA 274 Dato A rilisy. - 2~Z% 2'S i 4 . 0
Marconi 6310 PrugrsrTJT.at'e y :-3 22 GHz svreep generate:
Marconi 2D22C ItfKHz-IGHs Rr signal generator
H P 1 6 50 G '-ogc Ar.g fystr
H P 37 6 1 A Pa Scm genere 1 ,^ : 5 H P37 32A Error D electo-r
HP6621 A Dual P t Ctf dJMtyW e GPiBPSU 0-7 V 160 walla
HPB264 Rszx mount varabto Q-23V 3 2QA rrtetored PSU
HP54121 A DC Xo 22 GHz fourchannd tost set
HP31 2 DA opt 020 300 L ,^Hz piLes generator, GPIG elc
HP A 1, A3 3 pen HFGL hfob speed dium. - fm-m
HP DRAFTM ASTER 1 6 pen htoh speed p'ctle^
£G-*G Bronkdeal 95035C Preasfcn tock rn amp
Keith Sey 590 CV eapactof / vottssn ans'yser
Rata! ICR40 dys! 40 channa! v^'-co recorder iji'iem
Fisk era 45 KVA 3 ph On Uno UPS - New caneriea
Emereon, API 30 2_^KVA Ir.b^sEr.ai LIPS
.Mann Tally MT645 H sh soeed printer
Intel SBC 436/133SE V, u»U* 455 6Mb Rsm
£245
£995
£1850
£3950
£POA
£760
£2500
£49
£69
£69
£39
£POA
£45
£550
£250
£POA
£4500
£1550
£3750
£PQA
£1300
£475
£POA
£7900
£550
£750
£1600
£PQA
£3750
£4500
£ 1495
£2200
£94 5
HP 6030 A (F2Q0V DC $ 17 Amps ber.cn pewe-r sup: , £1950
I n t e 1 S BC 4SS/1 25C0 a Eri tier- red h l .\i Itoiie {?.! SA \ lie Mr £ 1 1 50
Nikon HFX-f 1 {Epri ctjcL exp^siire central ur 1 £1450
PHILIPS P M 55 1 8 pro. TV signal genoretor £ 1 250
Motorola VME G_a Bo^ds A Compcrierris LtcL 3AE CALL EPOA
Trio 0-16 vdc '-"esr, motored 30 en^ bench PSD. New £550
F ufltsu M.3041 R ECO LPM hlgb speed band printer £1950
Fujltau M3D41D SCO LPM pnntsr WThi rvehrtcr-'. Interface £1 250
Siemens K4490 &4Kb to 1 40Mb demux analyse r £29 50
Pa rki n E! mar 299 B 1 ntared specmopteclcmeter £500
Parkin Eimar 597 Infrared sp ^uu nohmab r £3500
VG Elactiranlcii 1035 TELETEXT Deeding Margin Meter £32=0
Light E and 60 output h'-gn sp so 2u rack tHini V'dec VDA J s £495
S a kemi e SD 1 50H 1 S cteann el e g itaJ Hybrid ebart reccnS a; £ 1 935
BSK 2633 Ktcrcphnne pra amp £300
T aylo r Ha bs on 7s 3ysti if ampdfer / receiver £750
ADCSS200 Carbon d toxide gas defoctof / mon .for £1450
BBC AM^BO PPM Mfftof [Ette^E TLLTy&f) * d-Tre eSectranjcs £75
ANRITSU 9 654 A Opt^aJ OC-2-5G/b wavefofm m = - : = - £5550
AH RJTSU f, f L91A cfsttoal pCTA^jr meter £930
ah R iTSu Firs Gjitic characteristic 1st sel ep q a
R&S FTDZ Dual* wound unit £650
R&5 SB UF-E1 Vfadtm md(Ua tor £775
V7ILTROH 6630B 12,4 / 2GGHz RF s^ffiep generator £5750
TE K 2440 1 50 MHz 4 tre ce osc oscc^ £1 250
TE K 2465 300 M hz 300 V Hz oac':tosccps rack mount £ 1 9 55
TEK TD53S0 4DGMhz cEgrtal realLme + disk drive. FFT efo £2900
TE K ID S S 24 A 5O0Mhz ag ital realti rr e ^ ccfcii r disp’ay eto £5100
H P 3 535 A Opt 907 20Hz Ed 40 M hz specbtin enslyaef £3 9 50
PHILIPS PW1730 *1Q 60KV XRAY generator k accessories £POA
VARlACS - Largo rang 9 from slock - call or sen our website
C LAU □ E LYO fiS 12A 24QV single phase auto- teas £325
C LAU □ E LYO N 5 1 0QA 24a'4 1 5V 3 priaso auto vofo n-- 5 £2300
19” RACK CABINETS
Europe's Largest Stocks of
quality rack cabmets ]
enclosures and accessories.
Over 1000 Racks from stock
This month’s special
33 / 42 / 47 U- High Quaiity 4
Ail steel Rack Cabinets
#
f
Miilc r/ Eurocrari. Enctosuims Lid to toa higha$1 pos-
sible sp o iva SCARi seeder) ard most V: da:
reccrder?. Unft runs from 12V DC so
ideal tor security A portable applica-
tions where mars pewsrnot BVBrebfc.
Overall d'rosnsforis c5 mm wide x 117 deep x 43 k'£h Suppl^c
BRAND MEW & fully guaranteed with uae ,r da3. iCO's cf spe ra-
tfons T -nctodtog Security. Hcm= '. r dec Web TV Wsb Cams et- etc
Order as LK33 ONLY £79.00 or 2 for £1 49.00 mi
SOFTWARE SPECIALS
NT4 Workstation* complete with service pack 3
and licence - OEM packaged, ONLY £89.00 s
EN CARTA 85 - C DROM, Hat tbs latest - but at this price I £7.95
DOS 5.0 cn 3 W c s*s with ccrtctsa boc'-s c .'. - F=s. : c £14.95
Windows for Workgroups 3.11+ Dos 6.22 on 3.5'' disKs £55.00
V/indaws 95 CDROM Onfy - No Uranra - £19.95
WordPerfect 6 COS t: r'.S z --s .'.iHi manual £24,95
shipping charges for soft.vars is code B
SOLID STATE LASERS
rod, BTOnrri toser diode assembly- Urol runs from 5 V DC al
approx 50 mA. Criguiaily msdg for coritrajpus nee si ir/efcstrial b5. J -
coda st srzvETs, the LiSEr s mounted ri a rsmovshtB solid shjjrirtxifn
b?ock, l'.hich fu.Tcbcns as a hsatskiV; find rigid optical mount. Dims c {
b’oek am 50 w x 50 d x "5 n rom. intEgifi! fezlures inffuda a , i , er tsm-
psretore shutdtJWTi, curmnl rartrol, Laser G.< c _ put, and gfitod TIL
Chi / OFF, Many for fixperinrenteJ opt-cs, cemrs 5 . t
cm SupgGad campfsto wltti data sheet
O ■■ es TD9 1 ONLY £24. 95 w
DC POWER SUPPLIES
Virtually every type of power supply you
can imagine. Over 10,000 Foiver Supplies
Ex Stock - Call or see our web site.
RELAYS - 200,000 FROM STOCK
5 5 .■a rP? r *x (jy choosing yp-ur next relay from rxir Massive Stocks
-O'.srfog types sucri 35 If. ---^ Zz:-i Crar 2 See'er
Ccntinentei, Ccrtfactors, 1 bps Delay, Mercury Wetted. Scfid
State, Printed Cfrcuit Mounting etc. . CALL or see our web s/re
www.riIrfsiI.co.uX for mens information, Many ebafefe types frnm
stock. Save ££££s
• lit
*
*
fill
* * ■ ■ 1 v m *
• «- ■ * •
t 1 1 1
■ ■ ■ m www #
■ ■ ■
• • •
I flr
* ■
• • • ■ fl
■
* W
w m
v
in
-ELECTRONICS-
ALL MAIL TO I
18 Million Items On Line Now 1
ALL ENQUIRIES
0208 653 3333
Dept EK, 29 / 35 Osborne Rd
Thornton Heath | ]
Surrey CR? 9PD, UK .; |
S$CUr£ Ordering, Pictures, information
vfesign www.distel.co.uk
Open Mon - Fri 9.00- 5:30 ,
Seijis
emaii ^ admfn@distBl.co.uk
FAX 0208 653 8888 \
[£
\*i
Pi*
25
1 j
t i
Yess
A! foi fo for L< Mafflnarel L.< cus£tnaH add 175% VAT n TOTAL erdar amoj-t J^rinxm cpier £10 Set -, a Bde accourt orasrs scrac,-^d tem Gp.^rn-ert Svnccs
Uriv-ersees sri Lcot Aunt rtes - rririrrmi acoxrt ertis £100. Cheques c.er £1.00 sne storid & 7 viO^tro daye Carriage dnsrras • Ap£3 g0 Bp£5 fo 1 >Z=--'J
Dr£1 3- CO. (E S=£1 8.01 F — 2*1— AJav approf 3 d3>s far shepne - fessr CALL AI goods doolsri to our Ston^rd Ccrabo ns of Sae wtitcri esn be v a ax arc
Lrtess ss led gusrsm^d fcr 50 bays. A1 gjErarfoes cn a fe^an to ee&= bss. A2 ng-ts res er, ed to d’tar g e prices spec rc£±rs ^ toout :r :r nocce to sax
DLcxxrts for ’rfcLme lop CASH trees pan tor suti us goods AJ rodaratos. traoersres tto acrinaAtoctet : = CLtr,t, E5ecr™s2SQ2. E i G s
6. i<3Q4 - *!skloi eSfedrojiia
3?
Design Your Own 1C
Part 2: CPLDs in practice
Following the description of the hardware in last month's issue (Part 1),
it's now time to start working with the experimenter's board.
We assume that you have already installed the Altera software and
read the tutorial.
t!i ! « toi electronic* - 1 200 -5
Designing digital circuits usually
amounts to repeatedly breaking down
the problem into subproblems until
you finally arrive at a design consist-
ing of variety of basic logic functions.
Based on this, you can develop the
electronic circuit and, if necessary, a
printed circuit board.
De5cr/pHve
languages
Designing digital logic circuitry is eas-
ier if you use a descriptive language.
The purpose of such a language is to
allow specific functions to be
described {hence the name). A
descriptive language allows intelligent
software to be used to design an elec-
tronic circuit that meets the descrip-
tion specified by the designer
There are presently several different
descriptive languages. Two of them
are manufacturer-independent and are
supported by a large number of manu-
facturers: Verilog and VHDL. In this
article, we use Verilog as our descrip*
live language.
Verilog
We chose Verilog because it is some-
what clearer than VHDL. However, the
two languages are the same in many
aspects. The biggest difference
between them is in how the descrip-
tions are formulated. This means that
many of the considerations, pitfalls and
the like described in this article are
also directly applicable to VHDL.
It's possible to generate hierarchical
designs using Verilog. This means that
die design can be divided into smaller
designs. These smaller ‘subde signs 1
can in turn be further divided into var-
ious sub designs as necessary. In Ver-
ilog parlance, such sub designs are
called 'modules'.
Dividing a design into several modules
has the beneficial side effect that it
may be possible to reuse tire modules
in other designs. A counter is an exam-
ple of a type of module that is used rel-
atively often, so it is definitely a good
idea to put a counter into a separate
module.
Mx&mple I
The best way to learn something is by
actually doing it. Consequently, we
can begin right away with an example.
Before you can get started, you must
download the examples from the
Elektor Electronics Internet site
{www. e lekt or- e le ctronic s . c o . uk ) . The
examples are located under item num-
ber 03038541 for the June articles. All
you have to do is unpack the Zip file.
Example 1 can be found in the Exl
folder. Just double-click on the
exLquaitus fiie T and the design soft-
ware will start up automatically. In the
schematic diagram that is displayed,
you can see that the various I/O pins of
the IC are connected to a block in
which several signals are listed. These
signals are the inputs and outputs of
this block.
As you have already seen in the tuto-
rial (you did look at the tutorial, didn't
you?), you can view the associated
source code by double-clicking on the
block. In this case, the source code is
written in the Verilog language. The
text shown in green is all comments as
far as Verilog is concerned, so it has no
effect on the ultimate result. However,
Quart us uses these lines to store infor-
mation, so it’s a good idea to leave
them as they are.
I^u«fure
Verilog source code is always organ-
ised using the same structure. It starts
with the module declaration. This part
of the code begins with the word 'mod-
ule', followed by a name. This is
Figure L Schematic diagram ora
Standard crystal oscillator.
accompanied by a collection of inputs
and outputs in brackets, separated by
commas. The whole thing is termi-
nated by a semicolon. This can be seen
in lines 30-35 of our example.
The next thing you have to do is to
define the directions of the signals
(ports) identified in the module decla-
ration. You can see how this is done in
lines 39^45 of our example. There are
three options for each signal: input,
output , oi inout (bi-directional). Here
we have only used 'input 1 and 'output’.
Each line is terminated by a semicolon
(;). In the first line, you can see that
several signals can be defined in a sin-
gle line if commas are used to separate
the definitions.
The outputs require an additional
specification. If the function of an out-
put is described in a procedural state-
ment (don't worry, we'll explain what
6, Md - eiklti ekrircnitf
33
Table 1. Boolean functions
& =
=
1
A _
s
AND
NAND
OR
NOR
NOT
XOR
XNOR
Table 3.
Arithmetic operators
+ =
add
• =
subtract
* _
multiply
/ =
divide
% =
modulo
Table 3.
Relational operators
> greater than
> = greater than or equal to
< less than
< = less than or equal to
= = equal to
I = not equal to
this means further on), it must have
the type reg (register = output of a flip-
flop). In line 47. signals D2, D3 and D4
are denned as registers.
Now that weVe taken care of the
administrative duties, we can start
with the actual design. This example,
as befits every initial example, is very
simple. Here we demonstrate the ways
in which signals can be described
using Boolean algebra.
This can be done in two manners in
Verilog; either by using an assign
statement, or in what is called a 'pro-
cedural statement . Listing 1 shows an
example of each of these methods.
The first method is demonstrated in
line BO. Here the description says that
signal Di is the result of an AND oper-
ation on signals 51-54, That T s another
way of saying that Dl is only active if
$1-54 are also active (T). hi ah other
cases, Dl is inactive ("O’),
The symbol thus stands for the
AND function. The Boolean functions
in Verilog are summarised in Table 1.
PB , @g@€hs¥£$li
statements
The remaining outputs (D2-D4) are
described in a procedural statement.
Procedural statements are always pre-
ceded by the word always. This key-
word is described in more detail in one
of our later examples.
Just as in the Pascal programming lan-
guage, you can combine a group of
statements into a unit by using the
keywords begin and end . All of the
statements between these two words
are collectively regarded as being a
single statement.
If you look at line 54, you will see that
signal D4 is described as a signal that
becomes acrive if SI or S2 or S3 or S4 is
active. Here we intentionally used the
word ‘becomes instead of ‘is\ The
symbol < — means becomes' or
assumes the value'. As a general rule,
we can say that this symbol is used in
a procedural statement instead of the
= sign.
It's not difficult to figure out the func-
tions of signals D3 and D4 if you use
Table 1 for a bit of help.
The advantage of putting signals in
procedural statements instead of work-
ing with assign statements will
become clear in a later example.
Finally, the keyword endmoduie indi-
cates that the description of the mod-
ule is finished.
Now we're getting close to the point
where you have to roll up your sleeves
and get to work. First, the design has
to be compiled. The compiler already
knows exactly which signal must be
connected to each pin of the CPLD.
Tnat ! s because we already did this for
you. This makes compiling child's play;
just click on Start Compilation in the
Processing menu and the software go
into action.
Various messages will be shown on
the screen, and several progress bars
will move along. After a while, the pro-
gram will report that the compilation
was successful. That means it has cre-
ated a programming file that you can
use to program your 10,
As already mentioned in Part 1 of this
article, to program the CPLD you will
need the JTAG programmer described
in the September 2002 issue of Elektor
Electronics . Of course, an original
Altera ByteBlaster is also OK, We
assume that your programmer is con-
nected to the printer port of the PC and
the JTAG connector is attached to con-
nector K2 of the experimenter's board.
Now switch on the power for the
experimenters board.
In Guartus, first select the Tools menu
and then Programmer, A new window
will appear. Check that the program-
mer is set to JTAG' and the correct
interface (ByteBlaster) is selected.
In this window, there is a line that has
'FPM7i28SLCM' in the Device column.
On the same line, the programming file
exl.pof is shown in the File column.
Everything is now ready for program-
ming the CPLD. You must tell the pro-
gram you want to program tills IC by
placing a tick mark under the Pro-
gram/ Conhgure column .
Finally, click on the Stan Programming
button, which is located at the very top
and looks like a sort of 'Play' button.
After being programmed, the CPLD is
immediately active, which means that
the programmed design can be used
right away. Make sure that jumpers
JP1 and JP2 are fitted.
Checking the design is easy. LED Dl
should only be on if all of the switches
are in the T position. In all other
cases, the LED must be dark. By con-
trast, LED D4 should do just the oppo-
site. That means that if Dl is on T D4
must be off, and vice versa.
We have described D2 as an OR func-
tion, which means that this LED must
be on if one or more switches are in the
T position.
LED D3 must light up whenever 51
and 52 are both in the T state OR S3
and 34 are both in the ‘ i state. These
functions can he easily checked using
the switches.
Now try to modify the design in Quar-
tus to cause LED Dl to be on when-
ever SI is in the T state and S2 is in
the *0’ state. The states of the other
switches don't matter. Good luck with
your design!
Compiling
Testing
Pfogrammlng
34
eteklM electron ks - 6/2&ft4
Listing I. Boolean algebra
50
assign D1
= SI
&
S2 S S3 6 S4 ;
51
52
always
53
begin
54
ii
V
CM
O
si i
S2
1 S3 | S4 ;
55
D3 <=
{ 31
&
S2) | (S3 S S4 } ;
56
D4 <=
-(SI
a
S2 S S3 S S4 ) ;
57
end
Example 2
As already mentioned, Example 1 is
very simple. The special power of Ver-
ilog is that it allows designers to
develop designs in a more descriptive
manner. Boolean algebra can occa-
sionally be handy in Verilog, but it is
certainly not the intention that rela-
tively complex designs must be
entered entirely in Boolean algebra.
This can be demonstrated using Exam-
ple 2. in which we set about designing
two flip -Oops ana a latch.
The files for Example 2 can be found in
the ex2 folder. In this folder, open
ex2,quartus, and the program will
automatically open all of the other nec-
essary files.
In the schematic diagram (ex2.hdi) f
you can see that switches S1-S4 are
connected to a functional block named
flipflop . SI is connected to the CLK
input, etc. Double-click on the block to
open the associated VerOog source
code.
Always @
Up to line 46, there's nothing new to
be seen. But in line 46 you can see
something added to the keyword
always: an @ character followed by a
comparison. This code segment can
also be seen in Listing 2. The @ sign
indicates that the procedural state-
ments belonging to tills always state-
ment are only allowed to be evaluated
(but not 'executed': only processors
execute statements) if the following
comparison is satisfied In this case,
that means that the following state-
ments are only applicable at the
moment when the clock signal (CLK)
OR the reset signal OR the SET signal
has a rising edge (posedge). Just to
avoid any confusion, a rising edge is
the transition from a Low level to a
High level.
Verilog also has the modifier ‘negedge\
which in normal English means 'nega-
tive edge’ or * falling edge \
If any one of these conditions is satis-
fied, this section of the code is evalu-
ated. First, a check is made to see
whether the RESET signal is T. If this
is the case, OUT becomes inactive (0 T )
and this code segment is done. Other-
wise, a check is made to see whether
the SET signal is *1\ If it is, the OUT
output goes to T and the code is done.
Beside the values T and 'O', each sig-
nal can also assume the values ! x T
{unknown) or'z’ (high impedance).
If neither RESET nor SET is ‘1\ CLK
must have a rising flank, since other-
wise this code would not have been
evaluated. The intention is that on the
rising edge of the clock signal, the out-
put of the flip -flop assumes the value
present at the input.
But what happens to the output when-
ever there isn't a rising edge on GLK r
RESET or SET? The answer is very
simple: nothing. In line 45, the OUT
signal is defined to be a register, which
means that the value most recently
assigned to this signal must be held.
Whenever the code is not active, the
value of this register will not change.
By adding the character to the
always statement, we can thus indi-
cate the conditions under v/hich a por-
tion of the code is allowed to be evalu-
ated, During the rest of the time, the
output that is controlled by this block
must remain the same.
From the code, it can clearly be seen
that the RESET input has higher prior-
ity than the SET input. However, that
doesn't mean that he CPLD evaluates
these two signals one after the other
when it is operating. The CPLD will
respond just as fast to the RESET sig-
nal as to the SET signal The sequence
is only important for the compiler. It
evaluates a section of code and deter-
mines what must happen to the output
for every imaginable combination of
input signals. Based on this evaluation,
the compiler ‘designs' a bit of digital
logic that respond in exactly the man-
ner described in the code.
ffteme
A second flip-flop (appropriately
named b flip0op2’) is also shown in the
schematic diagram (ex2Jjdf). The asso-
ciated Verilog file is very similar to the
file for the first flip-flop. The only dif-
ference with respect to the first flip-
flop is that the state of the SET signal
is checked before the state of the
RESET signal. That means that for this
flip-flop, the SETT input has a higher pri-
ority til an the RESET input. The output
will thus go to T if the RESET and SET
inputs both have a value of Tl With
the first flip-flop, the output will go to
‘O’ in this situation,
Lmteh
The final block in the schematic is a
latch. A latch is also a frequently used
type of component in digital designs.
The operation of a latch is actually
quite simple. As long as the clock
input is T, the latch's output must be
the same as its input. If the input state
changes, the output must immediately
follow the change. By contrast, if the
clock signal is inactive ( O’), the last
known state of the output must be
retained, regardless of any changes to
the input state.
The Verilog file ieEch exam p/e. v shows
how this can be described in the Ver-
ilog language. The output signal can
change if the state of the clock signal
changes OR the state of the data input
changes. Tins can happen on the ris-
ing edge as well as on the falling edge.
After the @ sign you can see (posedge
CLK or D) 1 . What’s special about this is
35
Listing 2. A docked flip-flop
4fi always § (posedge CLK or posedge RESET or posedge SET)
41 begin
48 if (RESET)
49 OUT <= 1'bG;
50 else if (SET)
51 OUT <= 1 J bl ;
52 else
53 OUT <= D;
54 end
that signal D is named without
'posedge’ in front. This means that the
code must be evaluated for every
change in the state of signal D,
In the code belonging to this always
statement, you can see that the com-
piler first looks at the state of the clock
signal. If the clock signal is active ( 1 ),
the output is the same as the input.
Otherwise nothing happens, and the
current state of the output remains
unchanged.
You can compile this example and pro-
gram it into the CPLD in exactly the
same manner as for the previous exam-
ple. After doing so, use the experi-
menter’s board to verify that the
design actually does what you expect it
to do. After this, as an exercise you can
see whether you can provide the latch
with SET and RESET inputs. As the
saying gees, practice makes perfect!
Arifhmetie
The previous examples demonstrate
how to describe functions without hav-
ing to worry about logic gates. Boolean
algebra and so on. After working with
Verilog with a while, every designer
will certainly be able to appreciate this.
The relatively trivial tasks are handled
by the compiler instead of the designer.
Our third example shows that arith-
metic is also not difficult in Verilog, In
this example we use counters. Coun-
ters need clock signals, and that’s
where we si art.
Figure 1 shows the schematic diagram
of a standard crystal oscillator. Except
for the inverter, a 11 of the components
are present on the experimenter’s
board. If we now place an inverter
between pins 71 and 81 of the CPLD,
we have a crystal oscillator.
If you open Example 3, you will see
this inverter drawn between two leads
of the 1C at the top of the schematic.
After the CPLD has been programmed,
the result is thus an oscillator whose
output (pin 81 on the circuit board) is
connected to pin 83 of the CPLD. This
input is specially intended to act as a
clock input.
Arrays
We assume that you are familiar with
doing ari thm etic in the binary number
system. If you are, you are certainly
aware that numbers are usually repre-
sented by a group of signals. In Ver-
ilog, several signals can be conve-
niently grouped into a structure called
an ’array'.
In the Verilog file for the Count block,
you will thus see the following in line
40: output [7:0j D: . This specifies an
array of eight signals (Di?].. D[Q]). This
group of signals can be collectively
written as ! D’.
To avoid possible confusion, we have
to explain line 47. Here a new signal is
declared. This signal is not present in
the module declaration, which means
that it is not externally visible (outside
the module). Such a signal is purely for
internal use.
The next interesting line is line 51:
temp -temp -l; 1 . This shows that we
can count by simply using the - sign.
Table 2 lists additional arithmetic oper-
ators that can be used with arrays in
Verilog.
In line 52 you can see a comparison
(‘ = =’ means to check whether the left-
hand term is equal to the right-hand
term). All of the relational operators
(such as ■ = = ) are listed in Table 3.
The number 24d4000000 may appear a
bit strange at first glance. This is the
notation for writing numbers in Ver-
ilog. The first number indicates how
many signals are involved (in this case,
24). The d indicates that the constant
is stated in decimal notation. Finally,
'4000000' is the actual constant.
In this case we must use 24 signals,
since the register temp consists of 24
signals. Note that in Verilog, 24 zeros
is not the same as 23 zeros! That
means that you must make sure that
the same number of signals are pres-
ent on each side of the 1 - — 1 symbol.
if you analyse the Verilog code, you
will see that the value of register temp
is incremented on each clock pulse. As
soon as the register reaches the value
4,000,000, register D is incremented by
the value ‘IV, temp becomes 'O’ and
output SLOW becomes T. If register
temp has not yet reached the value
4,000,000, SLOW receives the value 'O'.
With a 4. 000 4vlHz clock signal, this
means that the value of register D is
incremented once per second, with
output SLOW briefly going to T.
SLOW is thus a 1-Hz clock signal,
IS CP e@HB$f&r
The 1-Hz clock signal goes to the clock
input of a BCD counter. This is labelled
h BCD_counier' in the schematic dia-
gram..
The Verilog code for the BCD counter
has three separate sections, each of
which begins with an always state-
ment. in addition, we should point out
that two registers are declared for
internal use: SEG and COUNT.
The first function (starting at line 52) is
a counter that causes the COUNT reg-
ister to count from 0 to 9. When it
reaches the value 10, COUNT is
reloaded with the value 0.
The second function is traversed each
time COUNT changes, in line 60 you
will find a new statement with the
name case. An example of this can be
found in Listing 3. C programmers will
36
cither c'ffffnsria - 6/2004
Listing 3.
The case statement, and grouping signals into an array
59 always £ (COUNT)
60 begin
61 case (COUNT)
62 4'dG : SEIM 'bill-1110;
63 4 f dl : SEG=7 ' bOHGOOO ?
71 4'd9 : SEG— 7' bll 11 Oil;
72 default : SEG=7' bOOOOOOl;
73 endcase
74 end
75
76 always §(SEG)
77 f SEGA , SEGB , SEGC , SEGD , SEGE , SEGF , SEGG } = SEG;
find this a familiar concept, in this
instance, the case statement has one
argument (COUIIT). This means that
the following lines:
4 4‘d 0 : SEG = 7b 111111 0;
4 r dl : SEG=7b01 10000;“
can be translated as:
if {COUNT = -4d0) SEG=7b...
else if (COUNT = =4 dO SEG=...*
and so om
The line starting with default is
processed if the current value of
COUNT does not appear in the list.
The last section of the Verilog code
stans at line 75, As you can see* it is
evaluated if the value of register SEG
changes.
An. interesting feature of Verilog can be
seen in line 76: several signals can be
grouped into an array by using the '{*
and y characters. As SEG is an array
and the outputs for the seven -segment
display have been declared as indited'
ual signals, they must be combined
into an array.
Another possible solution would be to
couple each signal to an element of the
array, for example by using:
SEGA - SEG[G]; -
This method works just as well, but it
would make the code quite a bit longer
and thus more difficult to read.
Testing
With regard to testing this example,
we must mention a shortcoming of the
experimenter's board.
When the CPLD is being programmed,
all of its outputs assume the non- active
state. Immediately after being pro-
grammed, the CPLD is active. As a
result, the oscillator does not start
properly. This means that after pro-
gramming the CPLD, you have to
briefly reset it. You can do this by fit-
ting a pushbutton switch with a make
contact between pins 2 and 20 of con-
nector K6. Alternatively you can briefly
switch the power off and then on
again.
€@mBwgi©Bt
Ybu can do a lot more with the Verilog
language than what we've been able
to describe in this article. Here we
have limited ourselves to the most
commonly used features of Verilog.
Still, these features allow users to
design quite complex digital functions.
Various sites dealing with a wide vari-
ety of designs using Verilog can be
found on the Internet. By studying and
simulating these designs, you can
quickly accumulate experience with
this interesting language.
An important aspect that we were
unable to discuss in this article (due to
lack of space) is simulating designs in
Quartos. The Quartos tutorial should
help you quite a bit in this regard, and
there is also always the Help function.
Incidentally, it's a good idea to develop
a design in small parts and simulate
these small 'subdesigns 1 one by one in
order to determine whether they work
the way they should.
We would appreciate hearing from
readers who have created their own
interesting applications using the
experimenters board. Good luck!
Web pointers
http:// v/v/vs. alters. com /support/
exam nlas/venlo g/ verilo u. h tmJ
ht:u: vj v\ v. a sic- \ vorJd^coM /verilop
/LnfexMml
Tips
- A module con consist of several
code segments, each of which is
proceeded by the statement
'always'. Here the [imitation is that
on output can only be defined in a
single code segment. To get around
this limitation, a designer can define
two signals (such as wires T1 and
T1 ) and control these two signals
using separate code segments. The
actual output can then be defined as
a Boolean function of these two sig-
nals.
- Ensure that all Rip-flops in the
design respond to the same signal
edge (rising or falling). This yields a
more efficient (faster] design.
- Bear in mind that the compiler eval-
uates the code. This is fundamental-
ly different from what happens
when o processor executes a seg-
ment of code. If a design contains
several segments using the 'always'
keyword, these segments will actual-
ly be executed simultaneously
t, 2004 - dsklar derfrerks
37
In many magfc
instantly $nc|
i M 1 w
j, j [ « .
L HI
JMt J . ' ,
IV* vV. ^
f */ * x, — t i
jltf-
, ■ 5 * Vjd|
i Wl |(J
.l;l|IljllV1
,-j^^ ij _| wi||ri^B
fedL
[ J ifl
Hr : _ ■"• j j
■ -r " - - 1
mk k ‘~ - J
m ■
■l .B|r
£
*a g
. “% V ■riS 1
vii
^ / r * - ^
L.Jfltf
/ /
* i* Jt k >
W z XmL* JtM
pos
*C
JiO
csm
Figure L At the heart ct the circuit we r/no' ine trusty PiC i 6F34 microcontroller.
There are a large number of model rail-
way builders using proprietary track
and points to realise their layouts.
When adding remote controls for
points (turnouts) there is often disap-
pointment with the unrealistic and
noisy movement of the mechanism.
There are commercially available
motorised units but these are expen-
sive as well as difficult to install. A fur-
ther disadvantage of commercial units
is that the force they use is often detri-
mental to one scale turnouts in that it
can easily cause damage if not pre-
cisely adjusted and maintained.
On a different fr&ek
The proposed design uses standard
radio -control (E/C) servos to drive the
turnouts. A PIC microcontroller is used
to generate the necessary PWM pulses
under the control of a simple on/off
switch. The circuit includes a facility to
switch the *frog polarity depending on
the position of the turnout In railway
terminology, a frog is J a grooved piece
of iron at place in railways where
tracks cross 5 . There is also a signal
returned to the operator to indicate
correct operation of the unit for display
on a track diagram, for example. The
turnout will move slowly and smoothly
from one position to the other with no
excess travel or brute force that will
damage the turnout. If you are inter-
ested in making your own pair of
points (also known as a turnout ) then
visit the webpage listed at the end of
this article — it also shows a 'frog'.
Since control is by a single on/off
switch using standard TTL levels, it is
also simple to interface the unit to an
automatic or computer-controlled sys-
tem (like the one described elsewhere
in this issue).
So why use a PIC when the design
could be accommodated with some
simple hardware? The present design
uses very few components, is easy to
set up and the speed of movement can
be adjusted by changing parameters in
the code.
deses^spfmn
Figure 1 shows the circuit diagram of
the smooth control for model railway
turnouts. Basically a PIC microcon-
troller sits between input and output
connectors. Toe inputs include the
turnout change 1 control signal supplied
by the master control unit or a simple
switch on your control panel. This sig-
nal arrives at PIC input RA2 via con-
nector K4 The two oilier Input devices
are pushbuttons SI and S2 which are
read via PIC port lines RA1 and RAO
respectively They are used to set the
servo action required to make the
turnout reach its two extreme positions.
Looking at output connectivity we find
the servo control pulses being supplied
by PIC port line RA3 and fed to the
servo by way of connector El and /or
K2. Port line RA4 is read to detect the
presence or absence of jumper JP1
which selects between two memory
settings (more about this further on).
Port line RB4 supplies control informa-
tion about the turnouts status, for use
6/2001 -dd.tar cfEdicmki
39
Free Downloads
PIC microcontroller software.
File number: 030209-11.zip
PCB layout in PDF format.
File number: 030209-1, zip
www,elektor-
electronics.eQ.uk/dl/dl.Mm,
select month of publication.
K&tfi
Web pointer
Figure 2. Component overlay of the PCB designed for the turnouts control. The
hoard is available ready-made through The PCB Shop.
How to build a pair of points
(turnouts) & pictures of a
model 'frog': www.worldrail-
fans.org/GardenRaiEway/SLRP
ointBuilding.shtml
COMPONENTS
LIST
Resistors:
R1-R6 = lOkft
Capacitors:
Cl = lOOpF 25V radial
C2 = 10 /jF 16 V radial
C3 = IGQnF
C4,C5 = 22pF
Semiconductors:
D1 = 1N4001
D2.D3 = 1W4148
Ti = BC547
IC1 = PIC16F84-1QR pro gramme d,
order code 030209-41
IC2 = 7805
Miscellaneous:
JP1 - 2-way pmheader with, jumper
K! = 3 -way piriheader
K2 = 3-way PCB ter min al block, lead
pitch 5mm
K3-K6 = 2-way PCB terminal block,
lead pitch 5mm
SI, $2 = pushbutton with 1 make con-
tact, eg., type D6-R
Xi = 8 MHz quartz crystal
RE1 = relay, PCB-mount, 12V SFDT,
e.g., Siemens V23057
PCB, available through The PCB Shop
Disk. Proton PIC Basic Plus source
code, order code 030209-11 or Free
Download
as a feedback signal to the master con-
trol system. RB5 effectively controls a
relay for use with a ‘frog'. Depending on
its mechanical structure, the 'hog'
employs the normally open (no.), nor-
mally closed (n.c.) contact, or both.
The circuit has an on-board 5-V supply
regulator, IC2. The input voltage range
should not exceed about 12 VDC,
The PIC has a standard quartz com-
plement in its oscillator circuit consist-
ing of an inexpensive 8-MHz quartz
crystal XI and the two usual small
loading capacitors, here C4 and C5,
Ppm fed eirsmf hoard
The printed circuit board (PCB) for the
turnouts control has been spaciously
laid out. What's more, it contains stan-
dard size components only. The com-
ponent overlay is given in Figure 2.
Easy to use PCB terminal blocks with.
5 mm pin spacing are used for the con-
nectors, except K1 which is a 3-pin pin-
header for use with ready-made servo
cables. However, in all cases where
you are not certain about the servo
connections, use terminal block K2
instead. The completed and tested
board should be mounted out of sight,
which in nearly all cases will mean
securing it to the underside of the
model railway tabletop. If you do not
need ‘frog’ control, then components
R6, Tl, D2, K6 and Rel maybe omitted.
Setting ssp
There are two calibration pushbuttons,
SI and S2. Press them simultaneously
and the servo will adopt a central posi-
tion. The turnout is held in its central
position and attached to the servo's
operating arm. Make the control input
(RA2) logic High and press SI and S2
individually to adjust the servo s
extreme CCW (counter clockwise)
position. Next, make RA2 logic Low
and again press SI and S2 individually
until the desired extreme CW (clock-
wise) position is reached.
If necessary, repeat the adjustments
for each level of the control signal, until
the servo drives accurately and
smoothly from one position to the
other. The settings axe automatically
stored in the P!C : s internal E EPROM.
Jumper JP1 directs the PIG to use an
alternative memory location permitting
two settings to be used. Its use is
optional.
Software
The source file (.BAS) was written in
Proton PIC Basic Plus and should not
be too difficult to convert to other PIG
compilers. The Proton environment
also generates an assembler file
which, together with the Basic listing
should provide enough clues to adapt
the program and assemble it with your
favourite assembler for the PIC16F84,
The circuit could also be used to oper-
ate semaphore signals. By adjusting
the parameters for operating speed
and/or modifying the program code It
should even be possible to mimic the
'bounce 1 of the semaphore arm as it
rises and falls.
-
Location photograph courtesy South
Limburg Steam Railway Foundation
(vn^Ar?!sm.ni)
40
Erodes deleter - 6/2AQ4
FRUSTRATED !
Looking for ICs TRANSISTORS?
A phone call to us could get a result. We
oiler an extensive range and with a world-
wide database at our fingertips, we are
able to source even more. We specialise in
devices with the following prefix (to name
but a few ).
2N 2SA 2SB 2SC 2SD 2P 2SJ 2SK 3N 3SK 4N 6N 1 7 40 AD
ADC AN AM AY BA BC BD BDT BDY BDW BDX BF
BFR BFS BFi BEX BFY ELY B1 .X BS BR BRX BRY BS
BSS BSY BSW BSX B i BTA BIB BRW BU BUR BUT BUY
BUW BUX BLN BUZ CA CD CX CXA DAC DG DM DS
DTA DTC GL GM FLA HCF HD HFF ICU ICM IRF J KA
HA L LA LB LC LD I_F LM M M5M NLA MAB MAX MB
MC MD.AI MJE MJF MM MX MPS A IPSA MPSH MPSU
MRF NJM NE O.M OP PA PAL PIC P.N RC S SAA SAB
SAD SAJ SAS SDA SO SI SL SN SO STA STK STR STRD
STRM STBS SV] TTATAA TAG 1BA TCTCA TDA TDB
TEA TIC TIP TIPL 1 EA TL TLC IMP TMS TPL U LA
UAA LC LT)N UL.N UM UFA UPC LTD VN X XR Z ZN
ZTS + many others
We can also offer equivalents fat customers' risk)
Me also stock a full range of other electronic components
Mail, phone. Fax Credit Card orders and callers welcome
Cricklewood Electronics Ltd
40-42 Cricklewood Broadway London WY2 3ET
Tel: 020 8452 0161 Fax: 020 8208 1441
AVR Modular [Development System
Based on the Atmd AVR controller
Flexible end powerful ^ ^
Simple to configure v’
Very compact .
* C compiler supplied
* Compatible wtth moat development toots
* In-system programmable
* Free Atmal debug simulator available
* Peripheral drivers: end libraries supplied
I Increasing range of expansion modules
II Full web shte support
Check out Flexlt at www.ennovi.co.uk
engeyjjtd
0 ,44 {Q}t425 47BSS4
Sa l a sg a nnovi .co. tlk
PtecLstgn measure mo rst
Embedded control
Intrinsic safely
Internet embedded systems
USB interface
£97
f?
**
High perform once Windows based PCB Design Capture,
Simulation and Layout software at prices you'd expect
from your local computer store!
NEW! in Easy-PC 7
p
mr&nei*XP
7ZQQ ME ii
Windt. s NT*
O
Library Databook
Step and repeat plotting
Swap Connection Mode
Dimensioning
Copy to Metafile
plus much more
K«
£ I* B a 4
- i-*'
3 B
a
—4
E
9 If oTf fin zt no n n
' 1 I
!| I S *J Jff 7I I v ill f
% 1 L \v-
Stop press... by customer demand/ now
with Tsien Soardmaker 2 design import...
Number One Systems delivers true 32 bit Windows software
applications including features that a few short years ago would
only have been available in software tools priced in the thousonds!
Test drive Eosy-PC and Easy-Spice for yourself and be prepared to
be amazed at the super value...
Call for a brochure, price list and demo CD
on +44 (0)1684 773662 or email sales@numberone.com
^I o1 Number One Systems
Number One Systems
Oak Lane, fi redan
Tewkesbury, Glos GL20 7LR
WWW.
fiy 'CO-S-tl: kter ridicules
41
(without obligation)
Try out the new
elektor electronics
and get the next 3 Issues
{with the July/August
double issue 2004)
delivered at your doorstep.
Your saving:
more than 41 %!
for just £ 7.50!
Fill out the reply card
with this issue.
The trial subscription
expires automatically.
Ten years after
Operational Services
Pre-Qperational Services
Preparations for the market introduction of DAB digital radio
have been underway in Europe for more than ten years.
Although setting up the transmitter network proceeded
rapidly in most countries of western and central Europe,
sales figures in the receiver market were initially modest,
n the UK, sales came up to speed starting in late 2002,
and recently there are increasing signs that an upturn could
also occur on the Continent.
dekfoei&tranks- 6/21HM
Actually, the strategists and technical specialists in the Euro-
pean radio broadcasting industry all agree that the analogue
systems used forFM broadcasting inot to mention medium-
wave broadcasting) are technically outdated. Reception qual-
ity is not ideal, and the available frequencies are insufficient
to meet the demand. They argue that within 15 yeur>, radio
broadcasting should be completely convened from analogue
to digital. Nevertheless, Digital Audio Broadcasting i DAB i
initially remained stuck in the starting blocks. Until recently,
Germany (of all countries) provided a splendid example of an
unsuccessful strategy.
Please wait ...
With wonderful regularity, the ’breakthrough' of DAB was
forecast ever} two years at the Berlin Broadcasting Exhibi-
tion. Tli ere plans for constructing the transmitter network
were presented, public and commercial programme providers
declared their willingness to quickly enter into the era of digi-
tal radio broadcasting, and several manufacturers presented
prototypes and t later oni equipment read) for mass produc-
tion. although at prices beyond the pale of commercial reality.
Nationwide coord I mu ion and frequency assignments were
discussed in the committees of the federally organised radio
broadcasting admi lustration. Broadcasting expert > disputed
the question of whether listeners should be provided with
their accustomed programmes in both digital form and ana-
logue form 1 1 simulcast f L or whether new programmes were
needed to attract new customers. Was traditional radio
broadcasting sufficient as an application, or w ould the
breakthrough only come with additional data sendees? On
top of this came the great ‘religious war": was it to be DAB.
DVB-T, or possibly even DRM?
The decision was announced only last year: the«ghal suc-
cessor to VHP (FM) radio could only be DAB. A DVB-T
transmitter netw ork providing truly national coverage could
not be expected in the near future, since it was not clear who
would pay for it. Furthermore, an independent DVB-T mul-
would mean that radio programmes would only originate as
companions' to TV programmes and would take second
placed to the them. And in its present form, the third sort of
terrestrial digital radio, DRM. is not suitable for sen icing
regional customers, lei alone local customers. The conclu-
sion of a long dispute w as thus that DAB, DVB-T and DRM
were conceived for three different application areas, and
although they can coexist and complement each other, they
cannot replace each other. ^ Jj
All of the involved parties agreed on at least one thing: estab-
lishing DAB could only succeed with generous staL assis-
tance. In the technical area, there w as already a substantial
stream of state funding. The infrastructure for convening to
DAB is now largely in place in Germany. More than SO per-
cent of German citizens are presently considered to already
enjoy coverage, and nearly complete coverage should be
achieved by late 2005. J
There are also a sufficient number of programmes available
now, although the question of which strategy is correct has
still not received a unanimous answer. Bavaria in particular
has embraced the strategy of providing new programmes
that cannot be received via VHF. The simulcast philosophy
still prevails in many other German states, primarily for
Figure l.Yy
International DAB
broadcasting
tiplex for radio broadcasting alone w ould not be economi-
cally viable, except perhaps in large urban areas, which
cost reasons.
.v ■ . - (*■ =1 . i C:-i ?crjr
U2IKM -ehktQTrkdrnmo
45
Figure 2. DAB
coverage in the UK.
£ t. y
operas*
Erslng
tOFJige
*3?**-^ end 2X>r
VwaeM mtttj*
tr*s ?yu
5ET&1
end ! L < Lsrei C* r ?jCS
Key:
c^AbterT£er2£j03
■Ei^aakretei Eo' ;
sw.':.>t . ft
idTi-g z-x*
Figure 3. The Resfek
EDAB high-end
DAB tuner
fv/ww. restek.de).
Figure 4. Compact
DAB receivers f or
the 'German £
band ore available
at less than 200
euro s
[ www. thiecom. de).
The receiver an ihe
right can o/so
receive VHF
broadcasts.
Consumers have apparently not gained very much from all of
this: the number of receivers sold up to now is estimated to be
around 100.000, That is presumably because there is not yet
sufficient awareness of the product. Most Germans regard
DAB as a brand of heer, and the trademark currently being
used. ‘Digital Radio', does not provide adequate differentia-
tion from other types of digital radio broadcasting. As the
marketing organisations to be found in almost all of the Ger-
man states explain. 'First we invested a lot of money in the
technology, and now we have to invest even more in promo-
tion'. Success will sLtl! take a w hile.
The 99-quid radio
The situation in Great Britain is quite different. Here the mar-
ket started to move in late 2002. It was recognised that the
only way to achieve w idespread market penetration of DAB
receivers was via the price. The magic boundary' was consid-
ered to be a receiver under the 100-poimd level. Die initiative
for producing a '99-quid kitchen radio' did not come from the
manufacturers or a similar group, but instead front the pro-
gramme providers. The BBC and commercial broadcasters, in
particular Digital One. provides Rinding for developing an 1C
named 'Chorus', The manufacturing cost of this 1C was so
low that die receiver price could be brought below the magic
boundary; although at first this w as only possible w ith addi-
tional subsidies. Shortly before Christmas 2002. the Pure Dig-
ital Ev oke- 1 w ent on sale in selected shops following an
extensive advertising campaign, and it was sold out after only
a few hours. This 'initial spark' encouraged other manufactur-
ers to join the competition w ith attractively priced offerings.
Not only did this drive down prices (presently, the cheapest
receiver costs around 70 pounds, equivalent to 105 euros}, it
also increased awareness and attracted other customers who
w ere willing to pay somew hat higher prices.
The number of DAB receivers sold In the UK has risen from
approximately 50.000 in mid-2002 to the present figure of
more than half a million — and that with a decree of coverage
i_ %jr'
originally comparable to that in Germany, and now even
somewhat lower.
Of course, the initial situation in Great Britain w as also differ-
ent, Medium-wave broadcasting is much more common here
than elsew here, so die difference in reception quality is. more
evident than with F.M broadcasting. In addition, greater
i_
emphasis was placed on 'new ’ programmes i w hich cannot be
received using analogue receivers I. and they u ere promoted
in the media.
.Another advantage relativ e to Germans is that in the L"K.
- M5 pounds. Computer-based DAB
radios, by contrast, are scarce. The only model available in all
countries is the TenraTec DR Box J (300 euros or about 210
pounds}.
Summaries of available equipment and prices can easily be
found on the Internet, such as at w iv w. d i g 1 ral rad i o. de for Ger-
man) and ww vad i g hal rad ion ov. .com for the UK.
What dbouf fhe future?
In Germany. DAB has been pronounced dead once already.
Presently, the situation can be regarded as bein 2 more posi-
tive. It appears that prices could again drop in the near future:
the Anglo- Israeli company Sonarics is offering their CSM
DAB module for USS 25, and the Analog Devices Blackfin
DSP. which allows DAB functionality to he implemented in
software, is available at 5 dollars in large quantities. At last,
the large manufacturers (in particular Sony) are indicating
their willingness to enter the market. In parallel with this, pro-
motional efforts are being increased and coordinated under
the direction of Initiative Marketing Digital Radio (TMDRl.
In an\ case, in Germany hopes are now being pinned on a
'soft transit ion’ instead of a ‘breakthrough'. The demand that
VHP radio broadcasting simply be stopped by 2015 tor even
earlier} has now been dropped .
References:
'Digital Audio Broadcasting (DAB)', Part 1 / Part
2, Elektor Electronics, March / April 1998.
Web pointers:
www* world da b, org
www.d ipital ra dro.de
www.rqdtonumerique.be
www.pure-djqital.com
www.drdb.org
www.diqitalrgdjonow.com
www.restek.de
www.sonartcs.com
www.thiecom.de
wwWitechnjsot.de
www.radioscape.cQm
www.frontier-silicon.com
48
elekltir elediaria - &/2D04
Quasar Electronics Limited
PQ Box 6935, Bishops Stortford,
CM 23 4WP
Tel: 0B7C 246 1326
Fax; 0870 460 1D45
E-mati: sales@quasarelectronics.com
Add £3.00 PSP to all UK orders or 1st Class Recorded -E5,
Next Day [insured £250) -£8, Europe - £6, Rest of World - £10 (order
online for reduced price UK Postage).
We accept all major crediL'debit cards. Mafte chequeslP0 + 5 payable
to Quasar Electronics. Prices include 17.5% VAT
Call now for our FREE CATALOGUE v/flh details of over 3Q0 kits
projects, modules and publications.
MAIL ORDER ONLY.
Ekrtrea
QUASAR
electronics
H&frig p/n*(f» oatTXKttrt j
Motor Drivers/Controllers
Here are just a few of our controller and
driver modules for AC, DC T unipoiaribipolar
stepper motors and servo motors. See
website for full details.
DC Motor Speed Controller [5AHO0V)
Control the speed of almost any common DC
motor rated up to 1 00V/5A. Pulse width
modulation output for maximum motor torque
at all speeds. Supply: 5-15VDC, Box sup-
plied. Dimensions (mm): 6QWx1 OObcGGH,
Kit Order Code: 30S7KT - £12.95
Assembled Order Code: AS3067 - £19.95
NEW! PC / Standalone Unipolar
Stepper Motor Driver
Drives any 5, 6 or 6-lead
unipolar stepper motor
rated up to 6 Amps max.
Provides speed and direc-
tion control Operates in stand-alone or PC-
controlled mode. Up to six 3179 driver boards
cen be connected to a single parallel port
Supply: SV DC. PCB: 80x50mm,
Kit Order Code: 31 79KT - £9,95
Assembled Order Code: AS31 79 - £16,95
PC Controlled Dual Stepper Motor Driver
independently control
two unipolar stepper
motors (each rated up to
3 Amps max.) using PC
parallel port and soft-
ware interface provided. Four digital inputs
available for monitoring external switches and
other inputs. Software provides three run
modes and will half-step, single-step or man-
ual-step motors. Complete unit neatly housed
in an extended D-shell case. Ail components,
case, documentation and software are sup-
plied (stepper motors are NCI provided).
Dimensions (mm); 55Wx7QLx1 SH
Kit Order Code: 31 13KX- £16.95
Assembled Order Code: AS31 13 - £24,95
NEW! Bi-Polar Stepper Motor Driver
Drive any bi-pofar stepper ^, g Jfa ...
motor using externally sup- —
piled 5V levels for stepping
and direction control Tnese
usually come from software
running on a computer* __
Supply: 8-3 0V DC. PCB: 75x55mm
Kit Order Code: 3158KT - £12.95
Assembled Order Code: AS31 58 - £26.95
Most items are available in kit form (KT suffix)
or assembled and ready for use (AS prefix).
CREDIT CARD
SALES
Controllers & Loggers
Here are just a few of the controller and
data acquisition and control units we have
See website for full details. Suitable PSU
for all units: Order Code PSU345£9.95
Roiling Code 4-Channel UHF Remote
State-of-the-ArL High security.
4 channels. Momentary or
latching relay output. Range
up to 40m. Up to 15 Tx’s can
be learnt by one Rx (kit in-
cludes one Tx but more avail-
able separately). 4 indicator LED 's. Rx: PCB
77x85mm. 12VDC/6mA (standby). Two and
Ten channel versions also available,
Kit Order Code; 31S0KT - £41.95
Assembled Order Code: AS3180 - £49.95
Computer Temperature Data Logger
4-channef temperature log-
ger for serial port. 3 C or S F.
Continuously logs up to 4
separate sensors located
200m + from board. Wide
range of free software appli-
cations for storing/using data. PCB just
38x38mm. Pcwered by PC. Includes one
DS1 820 sensor and four header cables.
Kit Order Code: 3145KT - £19.95
Assembled Order Code: AS3145 - £26,95
Additional DS1820 Sensors - £3,95 each
NEW! DTMF Telephone Relay Switcher
Calf your phone number
using a DTMF phone from
anywhere m the world and
remotely turn on/off any of
the 4 relays as desired.
User settabie Security Pass-word, Anti-
lamper. Rings to Answer, Auto Hang-up and
Lockout. Includes plastic case.
130x1 10x3Gmm. Power: 12VDC.
Kit Order Code: 3140KT - £39.95
Assembled Order Code: AS3140 - £49,95
Serial Isolated I/O Module
PC controlled 8-Relay
Board, 1 1 5:250V relay
outputs and 4 isolated
digital inputs. Useful in
e variety of control and
sensing applications.
Uses PC serial port for programming (using
our new Windows interface or batch files).
Once programmed unit can operate without
PC. Includes plastic case 130x1 00x30mm
Power Supply: 12VDC/500mA,
Kit Order Code: 31Q8KT - £54.95
Assembled Order Code: AS31 08 - £64.95
Infrared RC Relay Board
Individually control 12 on-
board relays with included
infrared remote control unit.
Toggle or momentary, 15m+
range, 112x122mm. Supply: 12VDC 0.5A
Kit Order Code: 3142KT - £41.95
Assembled Order Code: AS3T42 - £51.95
PIC & ATM EL Programmers
We have a wide range of low cost PIC and
ATMEL Programmers, Complete range and
documentation available from our web site.
Programmer Accessories/
40-pin Wide ZIP socket (ZIF40W) £15.00
18 V DO Power supply (PSU01Q) £19.95
Leads: Parallel (LEAD10B) £4*95 / Serial
(LEAD76) £4.95 / USB (LEADUAA) £2.95
NEW! USB All-Flash' PfC Programmer
USB PIC programmer for all
Flash' devices. No external
power supply making it truly
portable. Supplied with box and
Windows Software. ZiF Socket
and USB Plug A*A lead not incl
Kit Order Code: 31 28KT - £39.95
Assembled Order Code: AS3128 - £49.95
Enhanced^PICALL" ISP PIC Programmer
Will program virtually ALL 8
to 40 pin PICs plus a range
ofATMELAVR, SCENIX
SX and EEPROM 24C de-
vices. Also supports in Sys-
tem Programming (ISP) for PIC and ATM EL
AVRs, Free software. Blank chip auto detect
tor super East bulk programming. Requires a
40-pin wide ZIP socket (not included).
Available in assembled format only.
Assembled Order Code: AS3144 - £69.95
ATMEL 89xxxx Programmer
Uses serial port and any
standard terminal comms
program, 4 LED s display
the status, ZIF sockets __
not included. Supply; 16-18VDC*
Kit Order Code; 31 23KT - £29.95
Assembled Order Code: AS3123 - £34.95
MEW! USB & Serial Port PIC Programmer
USB'Seria! connection. Header
cable for ICSP. Free Windows
software. See website for PICs
i supported ZIP Socket'USB Plug
"n A-A lead extra. Supply: 18VDC.
Kit Order Code: 31 49KT - £39.95
Assembled Order Code: AS31 49 - £54,95
www.quasarelactronics.com
Secure Online Ordering Facilities Full Product Listing, Descriptions & Photos Kit Documentation
& Software Downloads
6/2004 - cfckkr riedfBrki
49
«4
ftJ
ft!
m
m
m
m
®*
H4
n
m
W
•Of
a primeval game cast in modern hardware
Andy Morell
Provided they manage to recognise them in the first place, young-
sters will label classics like Pacman and Pong as video games
although historically they are 'video games', the concept behind
them dating back to the 1950's. In this article you'll find a modern
(computer) version of such a prehistoric game that — as far as we
are concerned — has not lost any of its compulsive character.
50
ddth:i ! r-£ 2004
UCLAVFP
RA j A.'ii
pjn uitt
ici
RJL£JLVLVRET-
RAtKCKJ
RA£ A'lrJC^aflJiTHK
Rti^CrA'Lb
fL=i.vTRAV-:
RE2. CS AST
rT.HT.TGO
RpLiP-^C
FTaVFOJi
P&4
RiitCtfZ
HEiTJiTI
RBtTlfTt
*t5GUiT3
23
33
57
_f
U
U
l
54
33
[tick TTFlt
+ 5V
Ins
cr
6
*aV
r7\
oy
.R7
3C5A73
,ts + Yk’
I"'.
I tv
m
R077PSF7
£H
EDirS r5
P3C16F452
HCOTresaTicxi RDAPSJi
RCTrTlOSiCCRJ RC7*WDT
RC1.CCP1 RCfeTXCX
POSCRSCI- ftCSSdO
RGiFSPS PC«SK!EOA
SOUPS*! ED4?tP2
Cl
7
1
Li *
15 =
12
It
?iHC43l4
7Z\
12
f
1
15
7
H
3
13
4
T*
5
15
£
7
5
-•
,V5
n
Ol
a
>
02
[i
IC4
02
Oi
i
c-:
13
IT
07
Si
Cl
TEE
^1= c v:- /
p- ; , i/
^1E Co
3
S
\CS
7
SK
5
\Ci3
11
\CIZ
T3
\C1i 15
G Q
o o
■G O
I
It is easily forgotten that the first elec-
tronic games were played on a TV set.
In fact, technology at the time nearly
did not make it to TV altogether. In
1951, TV technician Ralph Baer
thought it would be nice to use the
telly as a screen for an electronic
game. His boss however did not see
the promise and the idea was quickly
abandoned. Years later, however, it
started to surface again and in 1966
Baer started to build one of his early
prototypes. The video game was bom.
The game covered by this article is
Atari's Tong T which is actually a
derivate of one of Baer's original con-
cepts, The first versions for use at
home were designed around 1974 As
opposed to other manufacturers, Atari
found the pot of gold: an ASIC (appli-
cation specific integrated circuit) was
designed for Pong. The chip ahov/ed
the production costs to be kept low
while the game functionality (includ-
ing a digital on-screen scoreboard and
sound effects) was excellent compared
to competitive products. Tne home ver-
sion of Pong was launched in 1976.
Today, 28 years later, we have another
go at casting Pong in electronics. This
time, we will not be using a TV sat for
the 'screen' but a LED matrix,
Tfie circuit
Just like Atari did many years ago, we
will be designing a chip tailored to the
game only Fortunately, that no longer
means you have to design a com-
pletely new circuit and bum it into a
chip. Today we simply use a micro con-
trailer running software that tells it
exactly what to do. We chose the
PIC18F452, a 40-pin MCU containing,
among others, 32 kBytes of program
memory and a 10-bit A-D converter As
you can see from Figure l r the PIC is
not the only IC in the circuit. IC2, a 4-
to-16 hne decoder, together with 103
and IC4 arranges the display control
The display actually consists of two
parts: the 7- segment displays LD1 and
LD2 showing the ‘score’ and a LED
matrix (D1-D88) that mimics the play-
ing field. Virtual rackets or bats move
at the left and right side of the court,
allowing the ball to be bounced back
and forth.
Buzzer Bzl provides the sound effects.
You are looking at a dc (or 'active )
piezo buzzer that's driven by transis-
tor TL C5 and R7 afford sufficient
decoupling of the supply voltage.
Toe power supply around IC5 is dead
standard. Diode D39 affords a degree
of protection against an accidentally
4/20D4 ■
51
ma
H
T
n 1-4 I o It- la |a la |W |*» (r |r |ee Iv h |cr l» (0 |-«- M In l-w |e L
c, [2 j;s Ei la 15 [a |o {ajn |c [a |p |o [aja |a]o [ dJdEdIi
c-5;q.!c_^ E ±.
HU
\
-» — I H-t — I 1-
t ii H i
k
-t — 4 — M — » — *-
1 I T
I i Ml
f T T I T f
£1
£1
v
VE^L
5 - ^ s ^ «± a 1^-1= I a- "ii
= -a |a ;c :n :a |= - - =1 -i = a ;= =
— _
■-U:
£CSti n
kg
# • e
■ cs- /
:--: /
lc-; /
12 d:‘i y
< ^r.y
f f f f T f
■=■ =• = '■
HT 1 C C. ■ ® 1
= - = - ■
. 4 44
-» — *-
t i it T t
2
c?.-
-Z.
LD1
LT5-J331 fc
LDI
LTS430TE
-•i Z Z ly T- 1
RDC
t:
'pm
t
7
t
l
2
1
i
--
o
o„
■ 2 : K
#53:
=
f -Di
T
E
it
2
l
r
•:-i cc
■
.3 i
— 1 —
EdTZ
□K3
.X_
Figure 1. In this game the ' screen ' as formed by a huge number of LEDs.
reverse polarized mains adapter (with
9-12 TOC output). With the PIC draw-
ing just a few milliamps, it is fair to say
that the current consumption of our
electronic game goes on account on
the LEDs. However, thanks to the mul-
tiplexed drive scheme used here, the
average current consumption remains
limited to a modest 35 mA or so.
Display
Both the LEDs in the 7-segmenf dis-
plays and the LEDs in the matrix have
their cathodes connected via ULN2803
driver ICs (IC3 and !C4). The anodes
are connect to the MCU port lines via
transistors T2-T9. It would appear that
the transistors are not strictly neces-
sary as the PIC port lines 2 re specified
at 25 mA each. Tills may well he suffi-
cient for high -efficiency LEDs, but it
isn't with regular LEDs which at such
a low current light dimly, reducing the
‘playability’ of the game.
Using the indicated component values
(i.e. with transistors and B8-RI5 =
56 ohm) a LED current or about 27 mA
is obtained. By the way, the value of
R8-R15 may be changed without prob-
lems using Ohm’s law. Assume a sup-
ply voltage of 5 V, then subtract the fol-
lowing: collector-emitter drop (0.7 V):
LED fori voltage (approx. 1.8 V for red
LEDs); voltage drop across Darlington
drivers in the ULN2803 (approx, 1 V).
That leaves about 1.5 V across the
resistor If the desired current is 10 mA.
V = IxRteUsyouthat .1,5 = 0,01 xR, or
1.5/ 0.01 = 150 ohms.
Operation
The game is played using two poten-
tiometers and two switches, SI serves
to serve a ball, S3 is the speed selector.
When it is dosed, the ball moves faster
making the game more difficult to play.
COMPONENTS LIST
Resistors:
R1 R2 = 1 kG
R3R6 = I Okll
R7 = 10O
RO-R 15 - 56D
P1R2 = IDOkO preset
Capacitors:
Cl C2 = IGOnF
C3,C4 - 22pF
C5 = 1 OOii F 10V radial
There is a connection for a third switch
(S2) but this is not used in the Pong
game. P3 and P4 may be ordinary
rotary potentiometers but slide pots
will of course give a more realistic con-
trol of the bats on the field, A real joy-
stick is of coursed the ultimate.
Analogue’ PC joysticks in general con-
tain two potentiometers, one for each
direction (horizontal and vertical). In
most cases 470-kohm pots are used of
which the 0-120 kohm resistance range
is actually used. For our circuit, a
resistance range of 0-4.7 kohm is
required, so if a joystick is connected,
a resistor has to be connected in paral-
lel with the input (between - 5 V and
pin 2 3 of the PIC) to make sure a
much lower resistance is obtained. Toe
equivalent resistance of the parallel
network is calculated from
1/R^ = 1/R1 + 1/R2
So, if we want 4.7 kohms and the joy-
stick R1 = 120 kohms then
1/R2 — 1/1 20k - 1/4. 7k
R2 = 4.39 k
In practice no problems will occur if
you use a resistor of 4,7 kohms.
Pins 1 and 3 on the 15- way joystick
connector (a sub-D type) are for the
horizontal direction and pins 1 and 6
for the vertical direction.
Finally, Rl/Gl and R2/C2 suppress
noise generated by the potentiometers
as they are operated.
Construction
The printed circuit board (Figure 2)
consists of two parts interconnected
with a piece of flat cable. Building the
LED matrix is sure to take some time.
Although the job itself is straightfor-
ward, we should emphasize the impor-
tance of checking the LED polarity
because it is hard to think of anything
52
dektu-jr - 6 /2 Q04
C6.C7.C8 - 100 nF
C9 = IOjjF 63V radial
CIO - 470uF 25V radial
Semiconductors:
D1-D68 - LED red. high-efficiency, 5mm,
e g., HP HLMF-D1G1 (FarnelJ # 323-
044]
DB9 = 1N4QG1
LD1 ,ID2 = LT54301 E LiteOn
1 1 -T9 = BC547B
IC1 = PIC18F452-I/P
IC2 - 74HC4514 [74HCT4514 cr45l4)
IC3JC4 - ULN2803
1C5 - 4805
Miscellaneous:
K] = P3 = 4ka7(5kO) linear
pofeniiomefer, and a 3 -way SSL
pinheadsr
K2 = P4 = 4k7 linear potentiometer,
mono, - 3-way 5IL pinheader
K3 .K4 = 16-way boxheader
K5/<6 = 16-way flotcabte connector for
PCB mounting
51 = pushbutton, 1 make contact
52 = not fitted
53 = switch, on/ off
XI = 4 MHz quartz crystal
SZ 1 = 5\ (DC) piezo buzzer
more annoying than 88 LEDs fitted the
wrong way around. Usually, the cath-
ode is the largest surface inside the
LED as well as me shorter pin. Usu-
ally^. not always, so make sure of the
polarity and in case of doubt use a con-
ductance tester.
The orientation of the 7- segment dis-
plays may appear to be wrong but if
you follow the indications on the com-
ponent overlay shown in Figure 2 the
circuit will work as expected.
The polarity of the electrolytic capaci-
tors and transistors in the circuit also
deserve your attention. Also, run a
double check on the orientation of the
PIC micro before inserting it into its
socket — after all, the PIC is the most
expensive component.
The circuit board is best mounted into
a case that will also accommodate the
switches, mains adapter socket, pots
and LEDs. A red bezel on top of the
matrix clearance and the score dis-
plays will provide the finishing touch
to the game.
It necessary the game may be pow-
ered by four AA batteries. In that case
the current through the LEDs has to be
reduced, however, by increasing the
value of R3-R15. This is necessary to
save battery power.
Seffware
That leaves us with the software burned
into the PIC micro, here, a PIC18F452.
Since we are looking at a game that
should not cost too much, we looked for
an ultra-simple programmer that allows
anyone to program the chip using
his/her PC. The article Tree PlCProg’
elsewhere in this issue comes up with
the goods. As usual, the PIC software
for his project may be obtained free of
charge from our website as file number
030320-11 (see Free Downloads, month
of publication) The PIC assembly code
file is well commented.
Figure 2, the PCB consists at hva ports to be connected with ftatcable.
53
fi/2004 - filetaf
review copy
FreePICProg
cheap 'n easy PIC programming
David Daamen
The PocketPong game found
elsewhere in this issue was
designed around a PIC18F452
for which, we have to admit,
no suitable progr amm er was
ever published in this maga-
zine- Sure, investing in a com-
mercially produced program-
mer is an option, but making
one yourself is cheaper and
much more him too!
We reckon that's what Steven
Simon must have thought
when he needed a program-
mer for one of the newer PIC
micros. On Iris website. Steven
describes the software he pro-
duced for the purpose — both
the executable and the source
code files may be downloaded
free of charge. The program
can work with various hard-
ware variants which are also
described on the site. The cir-
cuit shown in Figure 1 is a
related item, albeit a very rudi-
mentary one. No LEDs or other
frills — just connect & pro-
gram!
Construction and
operation
The circuit consists mainly of
passive parts, the majority of
them serving to shape and
tidy up various switching sig-
nals- Or the active parts, the
transistors ensure that the
edge steepness of the signal
found at the BUSY line (pin 11)
is improved. That leaves us
with voltage regulator IC1 T
which we take it is so familiar
as to defy further description.
The circuit should be easy to
build on a small piece of Ver-
oboard. For K1 it is wise to use
an angled connector and sol-
der it directly on to the hoard.
The programmer may be
plugged directly into the
printer port on the PC.
Tne power supply is uncritical
and may be realised using a
simple mains adaptor with an
output voltage of 7-12 VDG.
Software
The little program called
‘fpp .exe : allows a HEX hie to
be burned into the PIC micro.
Tne software is comp at Or le
with all versions of Windows.
However, because the printer
port is accessed, Windows NT.
2000 and XP do require an
extra driver to be installed —
in this case, l DLPortIO' from
Scientific Software Tools, Inci-
dentally, only LPT! (0x378n) is
supported.
The hardware may be tested
by typing this command line:
fpp Ivp — t
where the Ivp' option speci-
fies the programmer type. You
may also choose 'Ivp fast'
which speeds up the program-
ming sequence. It may not
work in all cases, though, so
first give it a try.
Once the hardware has been
recognised, the PIC may be
installed with the programmer
supply switched off. The
actual progiaimning operation
is launched with
fpp Ivp
There are also options for read-
ing a PIC device ID. blank:
checking, erasing, etc. Type
b fpp' only for an overview of all
available parameters.
PICs supported
FPP VI, 00 supports the fol-
lowing PIC types:
- 12F629
- 1BF876. 16F877, IGF628 {-A
suffix versions are not sup-
ported!)
- 13F252 : 18F4S2
Although the 12FG75 is in prin-
ciple also supported by the
software, the hardware shown
here is unsuitable for this par-
ticular PIC device. For more
information, have a look at the
web pages covering FPP
:4:ri: :
FPP website:
y rww.ae o c It i e s . c om ■
S i 1 icon Vah e v .■'Hills/ 1924
fre epi cpro c. html
FPP download from Elektor
Electronics:
hie # 040131-11,
yjww.glekLOi-
el ectrooic s . c o . uk /d 1 /d Lhtm .
select month of publication.
DLPortlO
www. driver! i nx. c om /
D o v m L o ad D LPo rtIQ. h t in
54
slsVtc? fkdrorfrK - 4/2034
Rf jLvtf TV fcf ir.itjDrer^
££ Fi.-
Tejie: Esja
VlVMS&lki; - = ii r . t -J. «,= i Z - =_!' “ £
Cvait ~Au * ,:-:r >- It»— - it-ir-.*
cs-5;:3Kf*3 He t* :*et !
tmvH
rtJu
T-— ?■
T s ;ic . h i _ 5"! = .41 Tns r=~ & a - ei"E zZiT 4r ■ _ ■ "
V£-rH=jU ir = Wia - 3 u ; n: =ij
G-s (ft i. i*j ri, Asf-ffC TtoKKifag^r J
Cc- 5 p:a«rai bn 4 ~ : e _ c KTrcs'cr^ss =rd ^_ezt: " ^
H«efa
I)4ff
Ej:lE Jf Tm
Tjflc wi:!:^-<-f -".-s . ?Li-$-cn“j
Y EOT H : 5 TtJ 7 z-ZZ- -BZl= -=■- ~zZrl, 5 iJ Z±~Z~ e
C-tit D* :L*j£Sr3«f- ^:--t7F 1
Cs-Sp: = s:rai b r - , .zr^zr^zc' =:* 37 sr.. 3 -
Td4ov
Ctrl
TsjJe ►■hts— ran
Ycur H 3 rts: =cp Fa ass , f sJ -it z -=:- ~ r z - e
Gee Ft ‘Eli ■ rr~:E , i~jp ?.iia?r«
bn 4 ~: ■- . -i-ir E ■ ^r. ,
arc -.f *4 etecraf>3
Analog University
attend National Semiconductor lectures
David Daamen
Sure, the Internet contains
thousands of electronic cir-
cuits covering equally vast
minibers of applications.
That's all very well, but King
Shallow & Sgt Superficial
often rule and it may take a
lot of searching if you really
want to know all the ins and
outs of a certain design
aspect. Of course, enough
theory may be found in
datasheets and application
notes published but various
renowned manufacturers,
but somehow the method
does not appear very effi-
cient.
In this month's instalment of
He view Copy wed like to
draw your attention to
National Semiconductor's
Analog University', a virtual
academy that's existed for
about a year now and has
grown into a sizeable collec-
tion of mini courses covering
a wide range of subjects
The curriculum (11 is divided
into the following categories:
- Power Management, about
linear and switch-mode
power supplies and con-
verters;
- LVDS t about low voltage
differential signalling and
bus configurations, as well
as transmission lines for
these technologies:
Data Conversion, about ana-
logue- to -digital converters;
- Audio , about thermal prop-
erties and cost cutting;
- Displays, about the princi-
ples behind the design of
TFT and CRT screens;
- V\ r ireless f basics of RF tech-
nology and information on
various PLL techniques;
- Thermal Management,
about thermal control sys-
tems, analogue and digital
temperature sensors;
- Amplifiers, about (high-
speed } op a mps , low-power
and low-voltage amplifiers;
The courseware comprises,
among others, articles,
application notes and point-
ers to relevant contributions
in the Knowledge Base.
Moreover quite a few sub-
jects are supported by On-
line Seminars. Using a Java
presentation — complete
with sheets and sound —
your lecturer will explain the
subject matter in great
detail. Eventually, the
knowledge acquired in this
way may be verified with
the aid of a short research
assignment or a quiz.
The lectures are also acces-
sible via a separate
overview [2J.
National’s website offers a
lot more, including a mas-
sive Knowledge Base [3]
with a search engine.
There's also a section called
Design Tools [4] comprising
WEBENCH, an on-line
design, simulation and con-
struction assistant!
Finally, we should not forget
to mention The Bob Pease
Show 11 aptly called Reality
TV for Analog Designers by
National Semiconductor
themselves.
Tif'ri .
Web references
11] analpouni . nat io n al . c om
12] www. nar lonal .c om
online Eremin a r
[3] kno wle doeb ase . na tion-
al.com
[4] vn. vw n atl o n al.com/
desion
[5] urww. n at ion ai. c om / rao
All links are also accessible
from the National Semicon-
ductor homepage:
WV7V7. n a t i on al . c o m
6/2004 - drktoi eladronits
55
STMT HERE
Precision
function
Generator
MAX038
goes SMD
Klous-Jurgen Thiesler
Although surface-mount
parts are not the easiest to
handle, the reward in lest
and measurement equip-
ment is increased accuracy-
integrated precision function
generator type MAX038 is now
on old faithful with o history of
ten years. In the June ! 995 issue
we described a Fu I Ms I own func-
tion generator built from standard
size parts and using what is now
considered a targe PCB. The pro-
ject was hugely successful and
PCB sales reached several thou-
sands. In 1 995, the use of SMDs
in Elektor circuits was more or
less prohibited because the
advantages of a smaller board
did nor outweigh the disadvanta-
ges at problematic supply and
mounting methods.
Today there's no way you can
avoid SMDs anymore, however
we generally do not use ihem
unless they serve a good pur-
pose, or if the component we
wish to use is simply not or no
longer available in leaded farm.
Other compelling reasons to use
SMS are the ongoing miniaturi-
sation of circuits and near elimi-
nation of stray capacitance and
inductance (particularly in com-
pact RF gear).
In some case, however, SMDs
simply serve advancing lechno-
lagy — if you build the function
generator from SMD instead of
leaded parts and ensure low*
inductance [Le. ; shon\ PCB tracks
then the instruments technical
’ - n
Figure L Suggested circuit diagram hr a precision function generator based on the /AAX038 (now
in on SMD case.
specifications as well as its fre-
quency range can be improved
dramatically.
A digital frequency range switch
in combination with multilayer
ceramic capacitors (MLCC) in
SMD technology not only
improve the general performance
of the MAXG38 chip but also
extend its Frequency downwards
to below 0. ] Hz and upwards to
over 20 MHz. Such improve-
ments we feel are svorth just (hai
extra effort in building up the cir-
cuit.
Two easily realised design
aspects wit! help to unlock the full
potential of the MAX038:
-an optimised PCB layout with
the shortest possible copper
tracks to keep stray inductance
and capacitance to a minimum;
- SMD parts are marked by lower
temperature coefficients and clo-
ser tolerances.
The circuit and PCB layout pres-
ented here do not represent a
complete construction project. Rat-
her, the publication aims at pro-
viding a few useful tips when you
really want to juice the MAX038
for maximum performance.
Hence Mr. Thiesler's contribution
fills this month s 5 tori Here pages.
Range switch
Instead of the mechanical range-
switch we propose an electronic
CMOS analogue switch type
MAX4638E5E, an 8 1 multiple-
xer that, depending on its control,
connects the various Frequency-
determining capacitors to the
internal oscillator. In the highest
frequent)" range (20 MHz), it is
essential for capacitor C8 to be
connected directly to the
MAX038 — and not by way of
the multiplexer. Using the SMD
stuffing in SO 16 and 0815
enclosure; this can be realised
without problems. The ground
side of C8 has to be connected
directly to pin 6 (GND) — the
other ground pins are unsuitable
for that purpose.
The switching currents through the
frequency determining capacitors
are really low and the osd llatar
voltage [COSC] is just -1 V (at o
supply of ±5 V] . This makes the
selection of the CMOS switch rat-
her easy. Much more critical
however is the PCB layout; 1 cm
of 1-mm wide copper track repre-
sentina on inductance of 7 nH.
Long wires cause large stray
capacitances and that is where
SMDs are dearly superior to their
leaded counterparts. As a bonus,
SMDs are manufactured to closer
tolerance specifications.
MIC capacitors
Solid leaded, capacitors En the
microfarads range are every
expensive, inaccurate and bulky
components and it is not surpri-
sing to see they are rarely used
these days. SMD multilayer cera-
mic chip capacitors (MLCCs) are
much more accurate, tiny and
cheap mainly because they are
manufactured by the millions for
use in mobile phones. Mind you..
MLCCs are not a new develop-
ment — in fact they hove been
around for at least ten years. The
codes stated in the parts list indi-
cate the dielectric [X5R--.] and
She case shape (121 0).
For ihe low end of the frequency
range a 1 00-pF MLCC with a
working voltage or 6.3 V is used
with excellent results. Its ESR
(equivalent series resistance] is
stunningly low at less than 10
mQ. A 100-pF, 68-pF and 22-pF
MLCC stacked to make a neat
pile was measured and found to
hove an equivalent capacitance
of 2 1 6 pF.
Large value ceramic capacitors in
X5R technology have a typical
tolerance of ±20%, as opoosed
to +60/-20% for Y5V types. RF
ceramic capacitors like the 22-pF
MLCC with COG structure and a
maximum deviation of 0,5 pF are
manufactured by r among others.
56
ebktcr ektror.its - 6.1004
Figure 2. Proposed PCB layout featuring ultra-short tracks and on Figure 3 . Capacitor stacking — no problem with MLCCs.
3- way all-electronic frequency range switch*
Toiyo Yuden. Although the tem-
perature coefficient of just ±30
ppm [Class 1 j is □ bit over the top
for our application, it does
demonstrate the technological
advances made by passive com-
ponent designers. The author
found that Reichelt (www.rei-
chefl.de) supplies an assortment
of 0805 style COG ceramic chips
at □ reasonable price.
Adjustment requires o capaci-
tance meter to be able to select
the frequency determining capa-
citors tor desired value, or com-
bine a nmet cf them to arrive at
the desired values. These chip
capacitors may be stacked onto
each other and occupying just
one pair of PCB solder pads. As
you can see from Figure 3 r the
Tower block method helps to
keep copper tracks as short as
possible. For a change, you'll find
that she trust)' solder iron has the
edge over industrial mounting
methods like flaw soldering or hoi
air! Although SMD components
in 0805 and 1210 cases are
really small they can still be sol-
dered manually if you have o ste-
ady hand.
Components
lishs
Capacitors:
Cio,C 1 b = 1 COjjF ceramic MLCC
Y5V
1210
C lc.C2 = 22pF ceramic MLCC
X5R
1210
C3 = 2jjF 2 ceramic MLCC
X7R
T210
C4 = 220nF ceramic MLCC
X5R
0805
C5 = 22rtF ceramic MLCC
X7R
0805
C6 = 2nF2 ceramic MLCC
COG
0805
C7a = 1 50pF ceramic MLCC
COG
0805
C7b = 47Fp ceramic MLCC
COG
0805
C8 - 22pF ceramic MLCC
COG
0805
Semiconductors:
[Cl - MAX038CWP ($t>20)
IC2 = MAX4638ESE [5016)
IC3 = 40193 (SMD)
n
Frequency ranges
e 2.2 X 10 n pF
@ 4.7 x 10 n pF
@ 1.0 x 10 n pF
8
0.1 - 1 Hz
0.04 - 0.4 Hz
0.2 - 2 Hz
r ^
i
1 ■ 10 Hz
0.4 - 4 Hz
2 - 20 Hz
6
10- 100 Hz
4 * 40 Hz
20 - 200 Hz
5
100 Hz - 1 kHz
40 - 400 Hz
200 Hz - 2 kHz
4
1 - iOkHz
400 Hz - 4 kHz
2 - 20 kHz
3
10- 100 kHz
4-40 kHz
20 - 200 kHz
2
100 kHz - 1 MHz
40 - 400 kHz
200 kHz - 2 MHz
)
1 MHz - 10 MHz
400 kHz - 4 MHz
2 - 20 MHz
6 2004 - dftfrcnTn
57
kitchen table
— ---- - *£-
Burkhard Kainka
enjoying dance music in me
privacy of your home, study or student
digs. However, the true disco feeling is not obtained without a
matching sound to light unit, so here's a really small version.
Disco nights
are great fun
from time to
time but you
don't want to
overdo it in
regard of the
sound volumes
you're exposed to
for a couple of
hours. Arguably there's
no less pleasure in
th
58
efeklcr electron its ■ 6/2004
2x1 U414S
1N414S
030019 ■ 11
Figure 1. The circuit of the sound to light unit consists of a controlled gain amplifier followed by o 3-way frequency splitter.
A sound to light unit converts music
signals into light pulses. In most cases,
three channels are used to cover diffe-
rent frequency ranges. The bass chan-
nel will then indicate the ‘bead of the
music by a more or less rhythmical
flash, while the two other channels
represent the higher frequency ranges
of the music ch ann el.
The ‘private' version of a sound to light
unit discussed in this article employs
three coloured LEDs instead of power-
ful Sashing lights or floodlights as used
in most discos. For the rest, it has prac-
tically the same functionality as the
heal thing’ experienced on Saturday
nights. However, a direct connection to
the music amplifier is not necessary as
the unit we’ve in mind has been desi-
gned to pick up the sound information
through a microphone. Another peculi-
arity of the circuit is the automatic sen-
sitivity adaptation to the music volume
detected. In this v/ay the circuit can
work without any controls .
The circuit draws an average current of
just 20 mA and works happily off a 9-
volt PP3 block battery. However, the low
current requires super bright LEDs to be
used to ensure sufficient brightness.
Amplify if
High amplification is required to ena-
ble the tiny signals produced by an
electret microphone to be turned into
bright flashes from LEDs. The circuit
diagram in Figure ! shows that we
employ two operational amplifiers with
a total gain of about 1000 times. The
input of the first opamp (IC1.A) is con-
nected to the electret microphone cap-
sule via coupling capacitor C2. The
microphone is given a certain DC bias
level obtained from the 9-V supply rail
by resistors R1 and R2. R1 together
with electrolytic capacitor Cl decouple
the supply voltage for the sensitive
microphone while R2 equals the micro-
phone impedance. Capacitor C2, then,
ensures that the microphone bias level
does not appear at the opamp input. In
other words, it will only pass the alter-
nating component, which is caused by
sound picked up by the microphone.
The F input of the opamp has its own
bias voltage supplied by potential divi-
der R3-R4. Because the two resistors
have the same value, the supply vol-
tage is effectively halved, i.e. t 4.5 V
exists at the junction of R3 and R4
(assuming a nominal 9 V supply). This
bias voltage will also exist at the out-
put of the first opamp and, because of
R7, at the input of the second one
(IC1.B) whose output will also copy
this dc level. In this way R3 and R4
keep both opamps biased at half the
supply voltage. Both opamps are used
in the non-inverting configuration
hence protide unity {_!) dc gain.
For alternating signals, however, the
gain is much greater. In the case of the
first opamp, the gain is determined by
the ratio between resistors R6 and R5,
or R11/R10 for the second opamp. Just
look at the relevant resistor values and
you 1 !] discover that IC1 A. is configured
for a gain of 100 and IC1.B for a gain of
10.
The signal level at the output of IC1.B is
rectified by D1 and D2, smoothed by
C6 and then used to drive n-p-n tran-
sistor TL To the signal voltage at the
output of ICLA, the combination of R7
and T1 looks like a voltage divider.
With rising signal levels, the rectified
voltage on C6 also rises and the tran-
sistor is driven harder because of the
larger base current supplied by R9.
The result is a lower resistance in the
transistor and consequently a lower
AF signal behind R7.
You may wonder why we did not use
an n-p-n transistor without direct cur-
rent in the collector circuit. Alternati-
vely you might have expected to see a
FET at this position, its drain-source
junction acting as a controlled resi-
stance, It is less known that virtually
the same function may be obtained
from a regular switching/AF transistor
like the ubiquitous BC548C. An n-p-n
transistor, too, represents a variable
resistance that can be controlled wit-
4/7QD4 - debar eUctrcnks
59
Resistors:
R 1 , R2,R7-R 1 0, R 1 2, R 1 4,R 1 6 - 10ko
R3,R4,R6,R1 U lOOkD
R5 - ikn
ft13,R15,R17 = 3900
C4 = 2\}f2 16V radial
C5,C10 = 22nF
C6 = 4p?7 16V radial
C8 - 1 uF 1 6V radial
Cl 1 - lOnf
C 1 2 =4nF7
C13 = 22^jF 16V radial
Capacitors:
Cl ,C3 - lOpf 16V radial
C2,C7,C9 = lOOnF
Semiconductors:
D1,D2,D3,D5,D7= 1N4148
D4 - LED, green [see text)
D6 = LED., yslb'.v (see text)
D8 = LED, red [see Eexi)
EC 1 = LM385N (with socket}
T1-T4 = BC548C
Miscellaneous:
BT1 = 9V PP3 (6F22) battery with dip-on
lead
MIC 1 - eEedret microphone
PCB, available from The PC B Shop
bin a certain range. However, for a
low-distortion volume control, only a
tiny signal level (of the order of milli-
volts) may be applied to the collector.
This condition is not satisfied here as
the output voltage is regulated to
about 1 V D g r If the second stage has a
gain of 10, about 100 mV DC can be
found at the collector. At such a level,
distortion occurs that will not be
acceptable in other applications. No
problem for the sound to light unit,
however, because the output signal is
used to control LEDs than drive an
audio amplifier. If you do want to use
such a Volume control 1 for audio appli-
cations, you should make sure a much
smaller signal level is handled, which
is probably easiest realised by moron g
the automatic volume control towards
the circuit input.
Filter
The output signal supplied by the
second op amp drives the LED controls
by way of simple filters. Each LED dri-
ver stage consists of a transistor (T2 t
T3 and T4). To prevent the transistor
bases from being charged with nega-
tive levels, anti ^parallel diodes (D3, D5 r
D7) are used on each base terminal.
Each transistor is only actuated on the
positive half cycle of the drive voltage.
Overall, however, the higher frequen-
cies do cause an impression of average
brightness.
The filters consist of simple RC net-
works broadly dim ensioned for a cut-
off frequency using the formula
4 = I / (2 K R C) |Hz|
For example, the low-pass section
R12/C9 is dimensioned for about 160
Hz using 10 kQ (R12) and 100 nF (09).
All lower frequencies in the music sig-
nal will therefore pass through this
'channel 1 . The mid -tone channels con-
tains a combined high-pass / low-pass
filter H14/C10 tC 11. The treble channel
is driven by a simple high-pass
R16 C12. If necessary the cut-off fre-
quencies may be changed to suit indl-
vidual requirements and thafs easiest
done by making small changes to the
capacitor values.
Printed circuit heard
If the circuit of a relatively simple
design, the actual construction of the
sound to light unit is made even sim-
pler by a printed circuit hoard (Figure
2). The two opamps we've discussed
are contained in a single IC type
LM385. which is best fitted in an IC
socket (look at the notch in the IC
body). The single-sided PGB has no
wire links No problems are expected
to arise if you watch the polarity of the
diodes, electrolytic capacitors and
LEDs and work carefully all the way.
The elect ret (or 'condenser ) micro-
phone insert can be almost any availa-
ble type as long as it has two termi-
nals.
The maximum LED current amounts to
about 18 m A so the circuit is suitable
for LEDs described as 'standard',
bright 1 and superbrighL. Using the
latter the effect of the 3- way filtering is
more pronounced, while for a relatively
small room with not too much light
ordinary LEDs will be found to he per-
fectly suitable. If you decide to use-
low- current LEDs, the value of series
resistors Ri3, R15 and R17 should be
increased to 3.3 k or even 3.9 k. The
resulting reduction in current con-
sumption will enable your 9-V batter/
to last much longer.
60
debtor dectrcjiics- 6/2004
rron
LLIUI
fJswfedr tc r
mil r □ (E n+f p|| CfJ
or contact us for a full colour brochure
email; sales^roatiiuiitiLUnted ja.co.uk
tel; 0870 700 tSjt fat 0870 700 1833
UJILU
matrix
multimedia
Allows users with no
programming skills
to design complex
electronic systems
* Requires no programming experience
* Full on screen simulation
* Produces PICmicro hex code for a range
of i 8 r 28 * and 40 pin devices
* Full suite of demonstration tutorials
* Allows comp lex P I C m i c ro d e s i g n 5
to be produced in minutes
Tor Tull specification see;
www. m atr ixm u ttimedia.co.uk
FlBwtfHJe is a program irnriig system,
for PICmicro mkHKonlroiStr s bas e-d
On iiBAtharts, ? L-: code in dudes
nacros to facilitate (he control of
tom ptex devices Uke y-se^ment
and LCO displays. Flowtode allows
complete novices to design control
systems without getting bogged
down in the programming sitvoSv
C 4 " " *
«#*##«#*
■ Allows you to program Pitimeras and test your programs
■ Designed for education, hobbyists and industry
• Supports low cost Flash programmable PICmicro devices
• Fully featured displays including 2 line LCD
and quad 7 -segment LED
• Programs most 8, 18, 28, 40 pin devices - including
those with ADC capabilities
■ Free down load softwa re p rovid es seam less send
and verify function
• 3 CD ROM courses in C, assembly code, and flowchart
programming are available
for full specification see;
www.matrixmuttimedia.co.uk
or contact us for a full colour brochure
email; sfiles^malrixrnu It imod ia.co.uk matrix
(el: 087a 700 1831 fax; 0870 700 $832 mutli m ed : a
TJigh Q mf&i KiC-I
- A
KbXTBaJi TiUElfR Vi
Portab
Special Offers ::
H
TEKTRONIX
2445A
Cursors e tc. S-upz ez ■■■ 4. " i-ziia prob es.
Tsi;::-- 1 '~il? 7 - *i E :i;r E:::f I.i : _ _:i 'll 1 .'"
10 tMS am probrs, ft-iy -:m
H.p. &ISntl0iiSfij5^Os£. 1 EMuSOi E* 2 S
ORRIS CRLiSC 1 : . :■ L^tE Lfito afoq£*
E-7-ttfiC3 LES £35
Just In ...
H.P. SHMSgral EsftrzSf SfBKKt^lWHz £?5D
xfPi'iVQEtD &S45Z5 = e : csT&ze Zjz Ince 17 Vs .. H25
US523 " ; v _ -t:s i:*. 1 -: £140
GOULD 0S3SQ Efezaattra Dili lias £OSSb ESS
tUUDHAL ?AMASQJ{SCV?77BMifetec6«iX- 1 2 : . r £1 25
HBW e DO vn ?6 ,U- :n " ‘ w *Zr.r - £cO
KEHW0OD FL140 Wmr & FeSfer Wrfa £50
3CBIWOOD m B 8 A V tom & B tatter AtetfrUtti £75 Kte £50
EinS 43 'to* ASgor £75
ESffTUSSs fci St S25
SEtAMAJl FiQllG ■’l-C.’.i'r. .- : : &U.V . -
7 ■ - ", 4 "x' — 7 tL? III “
WAThE KERREY.': .
fl-ACAL Tr_= FlIE Vrito^r ^ t *
c-liVfeU ' E5S
R4.EAL 538£3 ^ no.* OS
vlls luN i sasc 4J Pczti u#j4 s^ad Usstxxsast
£3D I ttsuSSl tflf ifcej EH
I !!|Ja^l5tlTnj5 fUaVtgfe^.J MBtf 9 ii Ba5^-
SVrz £135
H.P.Ml2AF_7 6tf 1 “-- -? r -v : '■ 7.:’^
& Srs riflifpp. VtfeE £151
FAS kill AMM355 - - , r - v*--- ■ =V-7?-2lG“
linyssd
FA&HEI1DS81 Lc S. E:^-
7 r : - — _ Sc .:■£ : . :i 1 _c_c =-c
FLL.il ?£3SA ;-i l‘ iC - 1 1 ; ZW :T
is B« El SSL Uiii £35
H P. J3lflA fm feJJ _ Ct 7;
7 -E S: "■ r . Ir
FA= K Lll U M* £ : 1 ; 1 : : ■ : J >“T- ' l, 1 ^* ^1 2 5
: . r-.-.-p — _ 7-_- : ._- -£(•:
K P.St zA 5 1 ' -
■ ;47~ I __ :-:rr
f LUM Ti V_]~ --ps SSCi- ;
FU/CE 77 ^ £70
1 Css^fSl
z ■ ,i ^KL 1 U iW uc.i.- ■
fTi-Ti Oa - El K
1-3 : 1 '
fii
THlfniS E PSil
60ltlIN33 5c4.Sc 7s: "7-4 - fDI* -i_c :. r:- cn
m-£l25
A'.'l-; n.LS E r- - : : . 7 -c.Cr i c tc
C" i'Ai Q : - . ; "
GUQO WIL GVU27 7.1 I" -7 U mr 0,^-7 " , 1
I 12 -1 - D:'-; rTr^-lT.F--
SOCJUmt D?i 71 SD D V w S ScqITr J _
"£333
"
fiscal
Dalron 1
High Duality 6 5 Digit Servch llultim&ter
True HMSf4 mraTurT^ftl Convenler
fa^ieu -r " ' ?: '
rAiLlilil _r 0-i 1 . .-IrA
PvTRr £ 15.7 ij T+PSSrjl C- 1-77 7- ' 7 *
FARKELL DceI FSU XA 35 - 2 F ChSSV l!- 1 A Til'« QUAD. LCD
naa
FARNELL L30-2 >33 . . J>£4 £M
FARKELL LS>1 3rS' ; . r 0-lA EH
H 3Cj i'C = - FCni: ei 4 f= it ! = .
fee^Tg u^fenaa- ferfM 500V A
W1OTP1M
tto WYKEHAM ROAD, READING, BERKS, ROB 1 PL
Teteftee: (01181 92683-1 Fax: (01181 9351695
www. stewart-of -read Ing, c o.uk L .
Faroe If OIV 12*14 Oscilloscope
Oual Trac^ 1Z IlIHz TV Coupling Only
Et 7
SDLAPJtiCIi ilaS - .
-i 1
: . _ ■ i^=v. . _ _
Li . . J
?acr -- : r :-
El
ZA.j
lU 3
»a
r:-::c
FarneH LFI Sine/Sq Oscilloscope
IDHz-1 WtE Only
OSCILLOSCOPES
ISKISOME T^TSt- 7' 1 Try* : ::*? -. w:
THTH04TI :::: t- j; - r yjj- .tv: 1 - -
T3TE0ISX “ E3 = : 7tie£ M 1 r -j "
iHflbl' .-:7 :a LTii _ -^£ iri'A-j i: .
,Z£iI-i Z^e ”-e:e J-jV-j l^Z'J
F,-.u?s =U 3 4 Z z-::- : :■: -4 z« . V
T:OF5A-J^.^Lt CP'-: 7-i
TI3TF.I !."■:
: e:-:
:-hi
:C. [ Til: Z' 4 E- ~ "I : E 1 ZlZ'l
■ : 'E 137 ’ Ie-.Ei £ h:
Z‘..j ' ' l Zlv 1 . 1 - . Ir:L-
tic=U. i= E- 1ZQL
rrlilrS
rv:u^
VB- -~ Z-Ei - 5 T' . "
Z, 7 , ,7 Z'' r -1 I ■ ■ ; "fr" : .
ier Qsciltoscopes Available
W'4Ta&J» : v '.r ■■■■■:- - E :-rs? t±i:z
. - 7: lr K!
WAfrttm : :::e £..—=^4=: =c z^- zsis - oes
' ' - - ~ - r.’.jr*Z - IZ Z^7’i; L 7 1
nr : -.E'E : - ■ .'*-7-' in; G*r «M2
n f Km s.-f t»-\E - Ee:.i r ■: e l >tt. cijse
HjP. iaoiA. £wrS6 1 [iISHZ * SKBIHI £g £5-3
HAS Sjq Uttastfe S ^3 See, . £425
El 4 r\EC. - 4 =. jnES;: : ,f-_r ■" - ; : _T.
Pf?JEFS Fieni 5 C =1 - ;. J i'M"! - T i£!iv '5i53
7 -: v ... .'. - 77 -
facal ®ai e,tv w?u s-i; fjsa
H_P_ H 2 M Sj-ufi hsehSTeie SanKlEii £S*t
WiSUMB EB AdfM fearjMf E13»
H.r. tTz'Z r A -^Tirs AteVebt QM
HJ’. 47 JaA t £3 Mfttw JEK-y -1 GUT 4
H_P. ^OiA OsStSfeiE
wmi Kffift L' 4 tj|-r:"i
H_P. mu PJ= SareKnr Sjafe _
HLAF-ttBU 7411 ftfq: CWD&r JCEzH?
HP. 53 SE Rk fc^-SEir SoELe
HP. 53QA tCHe - iSGHiffiii CctiPter .
HP. 1 EH L4»7 c A'i'iSir S3! UancuS
tUBOW 2HS Uoct t/W aQOtr - Hte
ZZ 7; 7
£i::t
£::::
eiim
flEI-3
:::::
■ i£l
113 77
llll
Spectrum Analysers
r- P 7 :Z“ E :7 - 4 E 1 - 7 - :
HP- SHr - 3 SSMe 5^
HP. ££= 4 E gOfe^PU?
HP. K5lE 1 UH^KS£ 2 tr 75 spU
1 EHP 3
i x = : :
HP. 55 S 4 iH TZOOif-JT ^4
HP. tllia Wso fnm pTCEHr-iMQilHr
H.F. 2 iS!A
up. EizTA &fe — saea
S.Z . X-^TE 3 “ : : -4 E 11 :
£!":•* -. i : ::■ z:: :
■ : .:
IUACCU £33 aettr UCJUHi
H-P- IS? * 3 fe ST lEBKE-SaJHr —
N != Till ilP’ilTil
Mf *-:-•■ . ,J -
:T1-
J::: tZ-V-^JC-
TBCTa
■I' 1
- rzi'Z
£ 1:7
£2 7 s
7 pZ 5
n ■?-■-
£17i.
£iliZ
£71.1
HRS
r_- r :
£Z :3
Til
Tii
£17:7
t;77
• 03
^ 1 ' 7 I
*1:17
i.-
“■ fl3i2A : ■ ri.#v r 5 I n eansd
L SZ>H TikararH 4VHM.EQUP.2-
Z:""- . : > - z •::■ ::-4-IjCtV^tE_
HP. 522 3 ZA Ifcd-iiE^ OSTiE rt A^lef
OHO UHil 'ZJFhZC FET ZtaJmr
HP. osai ji 1A PE: 1 fr JS? r !>2A
E+E 3
H f fKii 3 Kj ?-[ W i 7 L 7
£ 4£1
HPjssmn 3 T 32 SV rundhon feffi'tfQ _
J E'Z ~ >:::, . " i 1 r -4
EZVrTDzriviT ;■ :- :- z z - . ... j:--
HP. E 32 U EHj^pjKttcr -3+n EC - DH«¥ 1 ZM
= -j£* sn.= ; jpjTEsa : .- : ehj zi-: : ■ ei s s
— Z ^r:-J~-C. 7 rijrrzi -
ftft tiltSA Pitt IrffT-SCUtir £1Sil
Hr r 7 : 7 7 . ' -Zi ' ; f
fiHl .11 Srt-TvH ■ 57 — Z
ia
= 7 ^ ■; - . -
Cli
I Radio Comjnunications Test
Sets
nmon^ :-zr T
i-raEsaa
?: -zi i ;=: . " . ■
£iyu
rr^E
II .
Used Equip me n l - GUARANTEED. Manuals supplied.
Tn '& is a VBl¥ SJilAHSAMFlE OF STOCK. £A£ ec Teie^scra % Irsfe P4ase ctedi tefore
(Hdam CARRIAGE all tu3s £16 VAT Id te Toy oi and Zataegs.
4/2004 - alakt^r tledronics
61
NSIDE OUT
l
J
d central
i- — -
2 ms
**
t
Figure ?. Spindle (actuator) position as a Function of pulsev/tdm.
Digital Motors
intelligent drive for servos
Giel Dols
Analogue servos are really ingenious bits of hardware.
But there's an even better alternative: the digital servo!
Based on the operation of the 'normal' servo we tell you
what's so much better about the latest digital ones.
A servo is a combination of a
dp ac or brushless motor with
a position detection circuit. In
modelling and robotics, we
usually find three-wire dc ser-
vos. Such a servo then con-
sists of dc motor, a reduction
gearbox and two mechanical
stops preventing the spindle
from turning beyond extreme
positions. Usually, the servo
also contains a potentiometer
that enables the position of the
spindle to be communicated to
a small piece of electronics.
The circuit, then, is the link
between the motor, the mea-
sured position and the real
world.
The three wires carry the sup-
ply voltage, ground and the
drive signal to the servo. The
drive signal — in RC model-
ling usually supplied by a
receiver — determines the tar-
get position of the servo
spindle. If external forces (like
air pressure on a model plane
rudder) try to change the
spindle position, the feedback
in the control circuitry will
counteract the movement and
ensure the rudder remains in
the desired position. As long
as its drive signal remains
unchanged, a servo will main-
tain the current spindle posi-
tion, collecting it if necessary.
Only if there's a change in the
drive signal will the spindle
move to a different position.
Operation
The drive signal consists of
rectangular pulses with a
swing of 5 V The pulse period
time is constant and the width
of individual pulses determi-
62
EfekEtt etKlrwiifs - 6-/2004
analogue
digital
Umnlor
tl]
fi-
_ *" t 1
20 ms
Figure 2. Motor volfoge when o certain spindle position is maintained [left: analogue — rig/if: digital).
nes the spindle position. Tlie
zero or home position of a
servo corresponds t a pulse
width or about 1.5 ms. Depen-
ding on the desired amount of
spindle rotation, the control
pulses are shortened or leng-
thened. However, the period of
20 ms is maintained al the
time.
The servo actuator spindle is
coupled to a potentiometer.
Consequently* the potentiome-
ter s wiper position not only
indicates the spindle position
but also equates to a certain
pulse width. The internal elec-
tronics looks after this fixed
relationship* maintaining the
spindle position until a change
in the drive signal pulse width
occurs.
The digital way
In recent years, servos have
seen great improvements —
size, responses time and actu-
ator force have been subject to
constant improvements. The
latest development called
‘digital servo T is an important
step forward.
in principle, the digital servo is
equal to its analogue ancestor
The only difference exists in
the activities of a microcon-
troller constantly analysing the
drive signal and if necessary
driving the motor. The mecha-
nical construction is the same
as that of the analogue coun-
terpart.
The use of a microcontroller
offers significant advantages.
As already mentioned, an ana-
logue servo is capable of cor-
recting its spindle position to
counteract external forces. Not
much will happen if the exter-
nal 'disruption' is small, as
small changes equate to nar-
row pulses. In many cases, the
effective power fed to the
motor under these conditions
is too low to get the motor to
turn so a certain amount of
hysteresis is created: below a
certain limit, the servo will
respond in a non-linear fashion
to disturbances in the spindle
position. With digital servos,
the microcontroller has been
programmed to ‘know’ the
motor’s specific response and
account for it in the way it is
driven. For example, the width
of the pulses sent to the motor
in response to a relatively
small spindle movement will
be larger than with an analo-
gue servo. Because the soft-
ware allows the processor to
calculate the optimum amount
and length of the drive pulses
for a certain disturbance or
desired position, a digital
servo will show much faster
accurate responses.
it’s not just the intelligence’
that makes the servo behave
the way we want. A further
difference with analogue ser-
vos is the use of much higher
switching frequencies of the
motor drive pulses. This not
only benefits the accuracy, but
also allows more power to be
delivered as the motor can be
tori more often. Extra power is
not only practical in maintai-
ning the existing spindle posi-
tion, but also when moving to a
new one because the sensor
can accelerate much faster
and reach the target position
well before its analogue coun-
terpart.
Disadvantage?
Increased energy consumption
is a direct consequence of hig-
her motor pulse speeds. This
disadvantage should be duly
considered when applying the
new digital servos in any bat-
tery-powered equipment like
model craft. Fortunately the
problem is far from insurmoun-
table thanks to recent advan-
ces in battery technology.
6/2004 - ckklor
63
s issue employs
model train routing with a PC
The Rail Rooter hardware conies in
two flavours: a master router board
capable of directly controlling op to 15
devices and a slave board connected
up via a ribbon cable and adding a fur-
ther IS turnout controls. The general
layout of the system is illustrated in
Figure 1. The master and slave circuits
use the same printed circuit board
stuffed to reflect the desired function.
Slave routers are optional — if you are
satisfied with 'just 1 15 turnouts and/or
semaphores then youTe fine with just
the masier router.
A dual-purpose
circuit...
The circuit diagram shown in Figure 2
is unusual in that it shows the master
as well as the slave circuit. Dashed
outlines and connections are used to
indicate the difference between the
two circuits, which can be built on one
and the same board. Electrically the
difference between the two circuits
exists in the presence or absence of
jumpers and circuit parts. The MAX232
two-way RS232/TTL level converter,
for example, is only required for the
master function, which (as you may
have guessed already) requires a con-
nection with a PC running the speci-
ally written Rail Router control soft-
ware (more about this further on). Toe
RS232 port on the PC is connected up
to the Rail Router master board via
sub-D socket K17. Only Tx Ex traffic is
used, without handshaking
A PIC16F877 microcontroller is found at
the heart of the master as well as the
slave circuit. Although the micro is loa-
ded with the one that the same software
for the master or slave function, it actu-
ally selects between two different code
chunks by looking at the logic level you-
've defined at port line RC5 by means of
jumper JFL The 16F877 ticks at S MHz
as determined by quartz crystal XI and
its loading capacitors Cl and C2.
Tire master and slave router boards
require a power supply of 8 V to 15 V
DC which can be provided by a small
mains adaptor or from a DC outlet on
one of the railway speed governors.
Master operation
The PIC micro continuously monitors
the incoming serial information, deter-
mining whether the device specified in
the command is comprised in the Erst
15 turnouts. If so, it changes the state or
the turnout control (via K2-K16). If not,
it passes the information over to buffer
IC3 and from there to connector K18 for
slave units to test. Each output con-
nector (E1-K16) on the router board
comprises an unregulated supply (V-r)
ground and the control lead as requi-
red by the 'Smooth Operator’ servo
control circuits. Note that Output #1
(Kl) is not used by the master configu-
ration. It is planned to employ it at a
later stage for enhanced facilities.
Slave operation
The operation of the slave board is similar
to that of the master but simpler bec ause
of the absence of the RX TX serial inter-
face with the PC, The unique address of
each slave board is determined by the
settings of DIP switch SI. Setting the
address to 001 1 for example, allows the
slave board to operate turnouts 16
through 31, where code 001 is RE 2 = 0;
RE1 = 0 and RE0 = 1 on the PIC.
... earn! m dual-
purpose circuit board
As already suggested by the circuit
diagram, the circuit board designed for
the Rail Router system can act as a
master or a slave, depending on how it
is populated. The two different compo-
nent stuffing plans are given in Figu-
res 3a (Master) and 3b (Slave), Care-
fully study the parts list and the com-
ponent overlays to avoid hard to find
problems. If necessary, refer back to the
circuit diagram, All components on the
two boards are regular-size devices
and construction is therefore not expec-
ted to cause any difficulty if you take
your time and pay attention to polari-
sed components in particular (IDs. tran-
sistors, electrolytic caps). We recom-
mend using a good quality socket for
the PIC device(s) as it (they) will the
most expensive part(s) in the circuit.
The PIC software
We can be very brief about the soft-
ware run by the PTC micro(s) used in
this project. Do-it-yourself program-
mers among you will be pleased to
know that the complete annotated
source code files supplied by Ray King
are available free of charge from our
website under ref. 030403-11. Simply
download them, compile and then pro-
gram your own 16FB77 chip. Alternati-
vely use the hex code directly.
Those of you without the means or
wherewithal to burn your own PIC
chip may resort to our Readers Serv-
ices who supply ready- prog rammed
PIC chips for tins project under order
code 030403-41,
t 2G04 - rkllpr eJ=tfrcv:e
65
Q3ftitJ3 - 1 1
to disk. The baud rate to the master
router is 9800 bits/s. The PC software
was written. in Visual Basic 6 (VB6).
The source code (.VBP and compo-
nents) as well as the executable ver-
sion are included in the 'software pac-
kage' for the project, ref. 030403-11.
Simply run the railrout.exe hie and the
program will be installed on your com-
puter.
The latest updates and hardware
additions may be found at Ray King's
website.
Figure 1 . A complete system would be set up like this , The boxes marked turnout '
represent o J Smooth Operator' unit .
felf Routes 1
#@p th® PC
A screenshot of the Rail Router soft-
ware ru nnin g on a PC is shown in
Figure 4. Any number of track layout
designs may be stored on the PC and
loaded when the Rail Router program
is launched, or at any time during a
session. The software written by Ray
offers the facility to design and alter
the railway layouts before saving them
©esjgfs
a track layout,,.
Click on the “Change Layout Design 5
button and the design screen will
appear. Click on any square in the lay-
out area, then click on the required
symbol to be put in this square. Conti-
nue adding symbols until your layout is
complete. Make sure all sidings as well
as roads in and out of the layout end
COMPONENTS LISTS
Master Router
Resistors:
R1 = 41:07
R2,R3,R4 - lOkQ
R5 = 47kQ
Capacitors:
a,C2 = 22pF
C3-C7.C9 = iOfjF 25V radial
C8 f eil,C12= 100nF
CIO - 1 H F IdVfodiol
Semiconductors:
1C 1 = PIC 1 6F 8 77-20/P, programmed,
order code 030403-41
IC2 = MAX2 3 2
IC3" - 74HC7241
IC4 = 7805
Miscellaneous:
JP 1 JP2 - jumper
i<2-K16 = 3 way 5IL p inheader
K 1 7 = 9-way sub*D socket [female)
angled pins, PCB mount
K1 8" = 10-woy boxheader
K19 = 2 -way PCB terminal block, lead
pitch 5 mm
XI “ 8MHz quartz crystal
PCB, order cade 030403-1 (sea
Readers Services page)
Disk, all project software (PIC & PC),
order code 030403- 1 1 or Free
Download
* only required when a Slave Reuter is
connected
Slave Router
Resistors:
R2,R3 = 1 Okfl
R5-R8 - 47kO
Capacitors:
C1,C2 = 22pF
C9 = IGuF 25V radial
C l 2 - 1 OOnF
CIO- 1 pF 16V radial
Semiconductors;
T1 = 8C550
[Cl = PIC1 6F877-20/P, programmed,
order code 030403-41
[C4 = 7805
Miscellaneous:
K14C1 6 = 3-way Sll pinhead er
K 3 8 = 1 0-way boxheader
K1 9 = 2-way PCB terminal blc^k, lead
pitch 5mm
SI = 3- or 4-way DSP switch
XI = 8 MHz quartz crystal
PCB, order code 030403-1 (see
Readers Services page]
66
dclctor dcdniEEks- 6/2004
Figure 2. Combined circuit diagram for the Master and Slave Router con figurations.
Figure 3. Master board component (left) and slave
board component (right) stuffing plans „
6/31KI4 * ckiclof ekcfronss
67
CJProgran FSo^outicjgtr^rs^a e«n
PC and microcontroller software.
File number: 030403-1 l.zip
PCB layout in PDF Format* File
number: 030403-1.zip
www.elektor-
electron tcs.co.uk/ dl / dl , him.
select month of publication.
* 1 2 1 * £ I 7 I 3 M 11 tj tj H 15 S Tf n II S 3 ZZ ZJ 2* ^ 2 27 3
Figure 4. The Rail Router PC software in action.
with an ‘end 1 symbol. When done, click
on 'Save Design and Exit 5 and give the
layout a name when prompted.
When the layout is saved, the program
records details of all turnouts ana allo-
cates a hard ware ‘port’ to each one. To
check the assignments, click on 'Check
Port Assignment’ to produce a list of
the turnout number from the diagram
and its associated hardware port. Tins
hardware port (l.e. t K2-K16 on a master
board, or K1-K1S on a slave board)
should be wired to the ‘Smooth Opera-
tor 1 control for that particular turnout.
On installation it is possible that the
turnout mechanism works in the oppo-
site sense to the software, that is, if
‘ahead’ is selected the turnout moves
to the turn. This can be resolved by
using the 'Change Turnout Sense 5 but-
ton. This option will ask for a port
number and will invert the sense (digi-
tal polarity) of the port. This Informa-
tion is displayed on the port assign-
ment screen.
...
' 4
r
1
* 5 *
i
♦ &
4 rt-^tSS
i
v' FCMTUattinig
AutoText
Control Toolbox
Database
Drawing
Forms
Frames
Ma?l fderge
Outgoing
Picture
Reviewng
Tables and Borders
Task Pans
r_, r
I D-
1
! Visual Basic
▼ X
. J 1
► $ Security...
.
>3©
Click on the
Control Box 1 icon.
Activate
Design Mode’
C ommandButtonl
Control Toolbox v x
4
Properties - Command B utt orfTT
|CommandButl Command Butte ^ |
r
[(Name)
CommandButtorll
[Accelerator j
AutoSize
False yj
BackColor
□ &H80Q0Q0DF
Becks tyle
f - fmBackStyfeC
Caption
CommandButtori
Enebled
True
Font
Times New Rom*
ForeCdor
■ &H800000i2i
Height
23,3 > !
Name of the button you're
about to create.
Choose an unambiguous and
clear name stating its function.
For example: "Lights witch 1 .
Text appearing on the button.
Do no confuse it with
its functional name.
Ferrrvait Debug Rm Teds Add-Ins Wfdow H&Sp
#4 o y ^ 9 C?| inz. Coil
6
Control
W ISi
CommandButtonl
P r ivat e Sub C orimiandB uc t on 1_C I ic k ( )
HsgBox ( f, you have clicked here")
■ End Sub
7a
70
eEsklor ttetfrcnla - 1 2 D D 4
Step 7
Reium to Word, using Alt-Tab for example, and return to
Run-mode by deselecting the two icons on the Visual Basic
toolbar (figure 7b ).
You can also minimise the 1 him! Basic toolbar if you want to
have a dear desktop, but you will have to enable it again if
you want to continue programming.
Step 8
Save the file in Word format and test how it runs.
Summary
A small program can be written in seconds using MS Word.
You should now have an idea of all the possibilities it offers.
The same method can also be used in MS Excel to program in
Visual Basic: create window s with buttons, input fields for
text or data, pictures, etc. Show ihe information in graphs,
personalise the Word menu with user-defined commands, run
other programs. It is also possible (although ihd really needs
a separate article ! to use API's under Windows, to program
the parallel pon for example. Complex programs that hide the
standard menus can be w ritten this w av. The users will think
that ihev re running a dedicated program, whereas the reality
is that it runs under W ord or Excel.
Help, my program
doesn't work!
Three possible solutions and some advice.
1 .Security level.
IF a bulforv doesn't work you should first check that the
security level has been set to 'Medium". The setting of this
level determines how Word deals with macros ana Visual
Basic code that are embedded in documents. Word
always asks this question when a document is opened. A
high security level gives you no choice and programs
written in Visual Basic cannot be opened.
The security level in Word can be changed os follows:
- From ihe Tools menu dick on Macro and then on
Security.
- Select the Med turn security level
- Now save your work and dose Word.
- Re-open the document.
When the document is opened. Word gives a warning
that if contains macros. In this instance, we click on
Enable Macros.
2. Problems when running a program.
Your program could contain a bug, which has to be
tracked down.
The debugger is a utility lhaf stops your program at the
point where the error occurs! The screendump below
shows a typical window that you could see.
Ihe Visual Sasic editor then opens automatically.
3. ft still doesn't work,
ft's possible fhaf the cause oF the problem lies elsewhere.
Try the fallowing: Save the program and close Word,
Open the document again. Amazingly, this trick is often
enough to get a program fo work.
If none of these help, there is a large amount oF informa
lion on various Internet sites and in discussion forums.
Internet links:
Further information an Visual Bask
http://msdn.inicrosoft.com/vbasic/
Visual Studio
http:/ / msdn.microsoft.com/v3ludio/
Source codes in VB
blip:/ /www. vbcode.com/
Security
±=£vr .tv l- : ; c! u cited Sauces
* Ngh. Only skped macros from trusted soirees w3 be slowed
to run, Un^jgnfid maaos a/e automatics ,:y disabled,
(* fjetftjrrh You can choose whether or not to mn potentially ]
junsafe macros, [
f* Low (not recommended^, Vou ere not protected from
potentialy unsafe macros, Use this setting only f you have
vims scanning software instated, or you are su/e a3
( documents you open are safe.
Here you can select
the desired security level
No virus scanner hstaled.
tifUsk n^Jnnfir.l J flhffcf'M.
Microsoft Visual Basic
P-iTrtre cfTCr o":
rteELm wEhxt Ssfp-Jb
C >** on 'D^fcrjg 1
i n# pregram wtfhatt where
\fan error s encountered.
I ■ . ..
i
D-rOjg
.
M
jc ; B 7oa have aliened Xere";i
_ The program is halted al this pewm
) ns cursor is al ihe o fle niing statement
(h''gh 1 5ghlsd in yeSo* )
?LT _705 Vj-.il'.,
i *_n &±/lKerfTstH
11 Sggfe
CScfc on ‘BeseC to haft Ete program
and fidr Wies lo correct the error.
ftocL yo-j ca.rj refaurjch
program scscMtion
fit r vnam jjvs*
6/2004 - dsltfor eSsdrcflks
71
mailbox
New Layout (!) I have
been an Elektor reader since
19 77, Yaur magazine has
always kepi up with rimes
and ihis new Forma! is no
exception. Graphics/icon
based format is the way for-
ward and you could not have
done better. One picture tells
a ihousond words. Elektor is
simply the best,
tenia! Ozturk
New Layout (2) Hi, you
have asked for feedback on
the restyled Elektor magazine.
1 like the new style, it is remi-
niscent of the style used In the
French and Italian electronics
mags which I often buy when
on holiday abroad. I would
like to moke one adverse
comment, I do not like white
characters on black back-
ground. The readability is
very poor. If one must have a
black background then yellow
or magenta is quite good. I
know this applies to the moni-
tor and may well apply to the
printed page. Perhaps you
could do an experiment in a
future issue and invite read-
ers" comments. 1 have been a
reader far very long time and
have some of the earliest
issues.
Mike Baker
New Layout (3) Em
afraid the 'new look" is a bit
of o disappointment. The use
of a full page image preced-
ing major articles is clear
attempt to fill the magazine
without having to create con-
tent. The April 2004 Issue
has at least seven pages
wasted in this manner (nearly
1 0% of the issue! «
Magazine subscribers such as
me will have to think long and
hard when it comes to renew-
al time if ihis practice is maim
talned. I would rather see
reprints of manufacturers
datasheets or even adverts
than this. The new logo also
instantly made me think of
other ill-conceived re-branding
exercises, such as BP's daft
Rower thing and the "Royal
Mail madness during their
brier "Consignia phase. Your
old logo was instantly recog-
nisable and yet no! dated,
why any company would wish
to abandon years of branding
is beyond me. 1 can only
assume that there are people
in the company spending too
much time J in meetings'.
If all this seems negative, it is
due in no small port to the
high regard I hove had for
your magazine in the past. I
would not wish to see Elektor
Electronics go down the
same path that others have,
such as Wireless World ,
Change for the soke of
change is madness.
Owen Grantham.
New Layout (4) As we
say on our side of the pond,
it's OK. Though sometimes,
as in the car industry much of
the time, one prefers evolu-
tion to revolution. Still, that's
a matter of taste.
However, there is a physical-
ly large Raw with the cover
— none other than that great
big V. Maybe you hod your
reasons, but really, it's too
clever by half, no, by more
than half. It's over the top,
no, beneath the bottom, l
can't even begin to imagine
what you were thinking.
Could therapeutic quantities
of Guinness Stout have been
involved somehow? Rather
than connoting sophistication,
it calls to mind every oh-so-
revoiutionary but lame and
hackneyed e-this, e-that, and
e-the-otherihing that has ever
wended its way into on e-
business e-advert e-cliche dur-
ing the entire course of e-his-
tory. And — e-eek — it also
reminds one of Microsoft's
Internet 6-xplorer, which ...
let's not go there.
It would be a considerable
kindness for you to lose it just
as soon as the e- novelty
wears off.
Paul Schick
New Layout (5) I was
very surprised to receive a
copy of your restyled Elektor
Electronics magazine. I am
54 years old and wear glass-
es, which were barely ade-
quate to resolve the printed
words on pages 5 onwards.
When it come to reading the
circuit diagram, I had to
resort to using a magnifying
glass to read the component
values! I consider my eyesight
to be average for my age
and therefore assume thot
your team are much younger
than me and therefore have
belter eyesight? My advice to
you is to not proceed with this
mini version if you wish to
retain your older readers and
indeed younger readers with
less than perfect eyesight.
C. Sinclair
New Layout (6) I think
it's great. Keep the good arti-
cles coming. Anything af edu-
cational basics for amateurs
like me would be welcome.
Brian Mao re
New Layout [ 7 ] The
magazine appears to hove
grown up. Please keep it in
your new format.
Edward Williams
Project c+(l) Dear Jon,
referring to the "time inver-
sion" article, The oscillograms
in the article fail to use a
time reference in order to
locate ourselves in time .
At the time of pressing the
trigger (to initiate the approx-
imate 1 -second pulse to drive
the pulse shaper) we should
establish the reference on the
oscilloscope 1 and 2 (chan-
nels B).
At the moment it seems that
the very long transmission
line is a momentary short cir-
cuit to the poor overloaded
opamp... the wave travels to
the receiver shows itself on
scope 2 and LED, then travels
hock to the source and at last
makes the led light up.
Of course there is a delay as
the signal has travelled twice
the distance. Nice fry —
As 1 was looking For your
email address I suddenly
thought of the month... I
hope some people did not
trim too much. I like the touch
with the high precision ports.
Thank you for a fantastic
magazlne.
G. Brennet (by email]
Project c+ (2} Dear
Editor, I am going to buy
shares in Project c+. You are
on a winner!
Dan Phelps (by email)
Project c+ (3) Hi Jan, you
seem to have overlooked an
important port when
analysing your circuit. The
connection between the send-
ing and receiving end is a
distributed network. If you
include this In your transfer-
function, you will find that a!
o given time f, the solution
for the total network is
040104, and the solution for
72
debar derireriG - 6/2004
the sending port alone is
040204. It is quire obvious
that 0401 04 is just one time
unit ahead of 040204. 1
hope this has clarified the
obvious.
Knuf Bakke (by email)
Your projects, my proj-
ects Dear Sirs, I have been
a long time reader of Elektar,
and would like to thank all
Elector (sic) staff for their
superb circuits.
Your April 2004 magazine is
o success and with each new
issue you prove that electron-
ics can be conveyed in infer-
e sting ways.
My favourite pastimes are
audio and music and IVe
actually built many of your
circuits. Some of these may
be seen on the photographs
on the enclosed CD-ROM.
Equipment cases, screen
prints and loudspeaker cases
are all home made.
As I enjoy every good circuit
you provide and build lots of
them, I though! I'd show you
a few examples of finished
equipments.
D. Bozanic
The phctc graphs on the CD-RQ.M
Mr. Bozanic kindly sent us cer-
tainly prove his skills at building
high-end audio equipment The
photograph reproduced here
shows his version of the Preface
stereo preamp a classic v -e pub-
lished decades ago.
Stealing current Dear
Editor, I am constructing the
project Burglar Alarm" pub-
lished in the January 2004
issue of Elekior. I have a few
doubts about the power sup-
ply section. Apparently you
have not provided over-
charge protection for the 1 2-
V SLA battery. Will this not
reduce battery life or destroy
St due to over charging?
Also, the battery charge cur-
rent limiting resistor used is
1 k (Rl) and the series diode
(D6) adds around 500 ohms
to it. Will this combination
provide enough current for
efficient charging? I would
like to use a 1 2 V/7 Ah SLA
battery.
Kinjaf (by email)
With lead- acid batteries (which
includes sealed SLAs) charging
with a certain maximum voltage
such os 13.2 V or even 1 3.8 V
also serves as or, effective over-
charge projection. Regarding the
charge current, this is intended
for continuous charging . There's
nothing wrong with the current of
about 0.3 mA used in this case
(cattery capacity 1 .2 Ah) as the
circuit is continuously connected
to the mains. In your case, you
intend to use a much larger bat-
tery and the current may be
increased by changing the 1 -kO
resistor into 630 Q. Do not use
lower values os that may cause
R ! to bum out.
Contact those CPLDs
Dear Jan, your Hands-On
CPlDs' project is supported
by a beautiful double-sided
board. Unfortunately, the
length of the PLCC socket
pins and DIP switch pins is
such that they can not be sol-
dered at both sides of the
board although it is clear that
signals have to be routed to
a number of these pins. Do
you have a solution to this
problem or am l barking up
the wrong tree?
Philip Hyams
Double-Sided boards supplied
through our Readers Services are
through-contacted unless other-
wise stated. Ycv need to solder at
the underside of the board only.
The through contact will then
establish an electrical connection
to any tracks that may run of the
component side.
Exotic opamp Dear
Editor, Pd like to build the
Audio Level Check for Line
Input project published in the
November 2002 issue as I
find that signals from my
stereo system are causing
overdriven recordings.
Unfortunately the TS924IN is
unavailable locally, can I use
a TL074 instead?
Bernard Hook (by email)
Because ot the minimum supply
voltage if is net possible to use a
‘regular opanio a the type you
suggest. If you need to find an
alternative go for a rail to rail’
opamp.
Corrections &
Updates
MIDI Lights & Slide
Control
March 200 t p. 26-33,
0001794.
A rev/ readers hove reported
lamp flicker when the control
is operated. No problems
are observed with constant
brightness. Flicker may be
suppressed by lengthening
the synchronisation pulse.
This is easiest done by
increasing the value of Cl
and C2 to 3.3 nF.
Mai I Box Terms
Put lest on of reader's correspon-
ded :e -s s: :b~ c screiiori of ire
Editor.
- V i =W D {Jj HiS e:vp res see 0 v C Of re S’
pendents are not necessarily
-J
those of tee Editor cr Pub -she?.
- Correspondence may he translated
cr edited for an gin. clarity end
style-
- V ; nan rep y*ng to Maiicc - corre-
spondence please quote issue
number
- Please send your MaitBox corre-
spon dense to:
ezi;:- 3r ~ e akter-a ~e.c g r
Bektor Sectranics, The Editor. PO
Box 190.
Tunbridge Wells TN 5 7 WX England.
6/2004 - fckkla eL dr ends
73
ET
To book your website space contact Bernard Hubbard
Tel
(0)1242 510760
Fax: 0044 (0)1 242 226626
ALLGOOD TECHNOLOGY
www,2l[g(K}cfteehnoli^y,com
Low-medium volume sub-contract assembly.
SMT specialist since 1990. Customers include
military, aerospace etc. 0402 to 8GA capabilities,
automatic assembly and hand built prototypes.
■ « — ■ ■■ ■ «
a
— -
PClMrfU}L ;
li^M
BETA LAYOUT
w w \\\ pcb - p c ,: o ! . cd m
Beta layout Ltd Award-
winning site in both
English and German
offers prototype
PCBs at a fraction of the cost of the usual
manufacturers 7 prices.
BURN TECHNOLOGY LTD
him: / Vayw. bu mtec.com
■
Distributors of a ’.vide range of device
programmers, package adaptors, test and
soldering equipment. Order online and get free
delivery on all orders over £30.00.
COMPUCUT
hhp:/AwAv.compucutters.com
Computer Numerical Control from your home PC.
Great for tricky jobs, and accurate repetitive
work. We supply: - Software - Interface - Manual
- Support
Price £250 plus postage.
CONFORD ELECTRONICS
htt p : t . w w w. conic rd eiec.co.u k
Lightweight portable battery/mains audio units
offering the highest technical performance.
Microphone ; Phantom Po wer and Headphone
Amplifiers. Balanced 'unbalanced signal lines with
extensive RFI protection.
DANBURY ELECTRONICS
http://www. mc-rfdem orLcG.uk/fra nsf onriers him I
Here you will find our mains and output
transformers in Mike Holme's range of valve/tube
amplifiers (PP & SE). Also circuits, parts lists,
chassis, advice.
DEBUG INNOVATIONS UK
http:/, 'wwwj debt] g in n ovati o ns ,eo m
Introducing hassle free proto byping
* RF/ Analogue
* High speed digital
* Surface mount
* 0.1 " grid
* Power planes
■ Unique patch
architecture
Forget custom PCBs. start your project nowl
EASYSYNC
h up : A wnweasy s y nc .c o*uk
EasySync Ltd sells a wide
range of single and multi-
port USB to RS232/RS422
and RS485 converters at
competitive prices.
ELEXOL PTY LTD
http: * va vw.e! excil.com
Developer and
manufacturer of
* USB Development Modules.
* USBMOD Series.
* USBI024 Digital Input/Output Module.
■ MP3 Solutions.
* MP3M0D4 Module.
Distributor inquiries welcome,
ELNEC ^
w ww.dne-c.com
* device programmer
manufacturer
* selling through
contracted distributors all over the world
* universal and dedicated device programmers
excellent support and after sale support
free SW updates
once a months new SW release
* reliable HW
* three years warranty for most programmers
ERVAN INTERNATIONAL CO.
http : ww w.e rv an-! nl com
Power Electronics and Solar Energy Design and
Consultants. Also offers;
Discount prices of:
* Ultra Bright LEDs
* PCB LED Cluster Kits
* Laser Pointers
■ Solar Modules
* Batteries
FOREST ELECTRONIC
DEVELOPMENT
http: ww.^v.f ored.co.uk
FED supply PiC programmers. Basic modules,
and development software including a PiC C
Compiler, Prog ‘n Drop Visual Development and a
well featured debugging environment.
FUTURLEC
http:T vAwwfuturiec.com
Save up to 60% on
• Electronic Components
• Microcontrollers, PJC, Atmel
• D e ve I op m e n t Bo ards T Prog ra m m e rs
Huge range of products available on-line for
immediate delivery, at very competitive prices.
FUTURE TECHNOLOGY DEVICES
http :wwww. ftdichip.com
FTDl designs and sells
USB-UART and USB-FIFO
interface i.c/s.
Complete with PC drivers,
these devices simplify the task of designing or
upgrading peripherals to USB
HAMMOND ELECTRONICS
http;. -■ www .hammondm fc ,c om ,
sates© hammcnd-el ectr o n ics .c'o . u k
tel: 01256 812812.
Small die-cast f plastic and
metal enclosures for the
hobbyist and professional.
Widely available from
major distributors.
LONDON ELECTRONICS COLLEGE
http://vAVW,tecorg.uk
Vocational training and education for national
qualifications in Electronics Engineering and
information Technology tBTEC First National,
Higher National NVQs, GCSEs and Advanced
Qualifications), Also Technical Management and
Languages.
MQP ELECTRONICS
http://wvAV.rn qp el ecfcron ics mu k
Leaders in Device
Programming Solutions.
• Online shop
■ Low Cost Adapters for all
Programmers
• Single Site and Gang Programmers
• Support for virtually any Programmable Device
NEW WAVE CONCEPTS
http : www. n s w - wave-co n ce p is . com
Software for hobbyists:
• Uvewire circuit simulation
software, only £29.36
• PCB Wizard circuit design
software, only £29,36
Available from all Maplin Electronics stores and
www.roaplin.co.iifc
PEAK ELECTRONIC
DESIGN LIMITED
wvAv.peakelec.co.uk
Cool component test gear for your passives and
semis. Instant identification, measurement and
validation. Connect anyway round. The Peak Atlas
family starts from £59.
74
elekter etedionks - 6/2004
NET
UKS
QUASAR ELECTRONICS
w.m Q y asa rB e e!ro nics. c c m
Over 3GQ electronic kits,
projects and ready built
units for hobby, education
and industrial applications
inducting PIC/ATMEL
programming solutions.
Online ordering facilities.
Tel: -r44 (0) 870 246 1826
Fax: -5-44 (0) 870 460 1045
Email: sales@QuasarElectronics.com
ROBOT ELECTRONICS
hlte://wvm robot- elec iron ics.co. u t
• Ultrasonic rangefinders
• Motor H-Bridge
control lers
• Magnetic Compasses
aLsmEjffsi
* RC servos and controllers
* PIC programmers and components
* Electronic Design 'Development and
Manufacturer to industry
TECHNOBOTS
lit Lp:/ wv, w. tec n n obots .co.u k
Welcome to Technobots -
the one stop shop
specially for the remote
operated robot builder
radio control and engineering hobbyist.
TELNET
rsttpij 'Away, teinet.uk. com
The site shows graphically
Telnets wide range of
quality second-user test
and measurement
equipment, including
oscilloscopes and
spectrum analysers.
ULTRALEDS
http : ■ . ^ v,- •/;. u \ im 'eds.co.uk
tel: 0871 7110413
Large range of low cost Uftra bright leds and
Led related lighting products. Major credit
cards taken online with same day depatch.
USB INSTRUMENTS
http: Tv, *vw.u5b-
rnsiryments.com
USB Instruments specialises f
in PC based Instrumentation *
products and software such
as Oscilloscopes. Data Loggers, Logic
Anaiaysers which interlace to your PC via USB.
VIEWCOM
littp : www.Vi ewe cm T9.co. u k
tei: 020 8471 9338 fax: 020 8552 0946
■ Mai! Order supplier of:
■ Integrated Circuits and Components.
• Kit and parts for Elekior projects.
• Transistors, FETs, Capaciiors, Resistors,
Crystals, etc and hard to find devices.
Vrewcom Electronics, 77 Upperton Road West,
Pfaistow. London El 3 9LT
WTECK
w7Av.component-technology:co.uk
Kits^modules for
students /hoppylsts. PIC
microcontroller 18F45X,
1 6F87X Proto Boards tor ease
and fast development CC TV
infrared Illuminators.
5% discount code eenflnk2QQ4 : for Elektor Readers.
NAME: ..
JOB TITLE:...
ADDRESS:
.ORGANISATION:
TEL’
■••■■■■ib ■■ wm ■ ■■■■■■<■ mm m X i — — » ■*■ ■ + # + ¥*#■*
PLEASE COMPLETE COUPON 7 BELOW AND F.AX BACK TO 00-44-(0)1242 226626
COMPANY NAME
WEB ADDRESS
25-WORD DESCRIPTION,
■ ■ ■ - a *+ + -««i
- •mr-
■a-a -a--aammaa
- - - - - - f p - - - r a a -a a -r ■ r ■ ■
■ 4 «>*» 4 M 4 4 >Tlv 4 rir«rBirir**i
* ■ + + - 9 --B a -am a a a a a
ELECTRON
BRmflysa s‘d 3 :
Only one magazine tests its projects and circuits in its own lab before publication
r,i . - . .j ■ ........
THE ELECTRONICS & COMPUTER MAGAZINE
Contact: Worldwide Subscription Service Ltd,
Unit 4 Gibbs Reed Farm, Pashley Road, Ticehurst
TN5 7HE Telephone: (+44) (O) 1580 200657
Fax: (+44) (0) 1580 200616 Or visit our Website:
www.elektor-electronics.co.uk
PROMOTE YOUR
WEBSITE HERE
Elekior Electronics have a feature to help customers to promote their w ebsites* Net [.inks - a
permanent feature of the magazine where you will be able lo highlight your site on a regular
basis.
* For just £120 + VAT (£10.90 per issue for eleven issues) Elekior will publish your company
name, a 25 -word description and your website address.
■ For £300 4- VAT for the year (£27.27 per issue for eleven issues) we will publish the above
plus run a 3cm deep full colour screen shot from \ our site.
Places are limited and spaces will go on a strictly first come, first served basis, please fax back
your order today!
I wish to promote my company, please book my space:
* Text insertion only for £ 1 20 + VAT - Text and photo for £300 4- VAT
6/ZD 04 - eltkfer eleftiOEtio
75
f — \
Danbury [Electronics
U.K> Manufacturers & designers of quality
Transformers for over 20 years.
• 1VA-750VA size range, medium quantities
• Mains, Audio, Loudspeaker & ferrite types
• Specialise in Valve/Tube mains and output
transformers.
• Rewind/Replacement of rare/special
transformers
• A standard range of Valve/Tube Amp mains
& Output Tx's (P/P, SE etc) is avaiiable
through Mike Holme’s web site:
www.mc-h.demon.co.uk/transformers.html
(Also, Valve circuits, Parts lists, Chassis & Advice)
• Established supplier to Maplin Electronics
(www.maplin.co.uk) for over 15 years.
Contact David Brooks i.Eng miie (Proprietor)
Phone : 01245 328174
Fax: (24Hr) 01245 328963
Email: DanburyElecTX@aol.com
20 Cutlers Rd, Saltcoats ind. Estate,
South Woodham Ferrers, Essex. CM3 5XJ (UK)
I
©
Item Tracer
1985 - 2003
EtT contains the digital
contents list of all articles
published in the magazine
over the period 1985-2003.
The Eli is supplied on a
3.5-inch diskette, runs under
Windows and offers an
attractive graphics interface.
The program allows sear-
ching for various keywords
or combinations.
elektor
electronics
RHP £16.25
(US$2B.75)
CD elektor 2003
Volume 2003 on CD-ROM
The Elektor 2003 CD-ROM contains all articles, with the
exception of news columns, published in volume 2003.
Using the supplied Acrobat Reader program, ariicles are
presented in the same page layout as the magazine originals.
Additional features;
* print pcb layouts with up to 600 dpi resolution;
* adapt pcb layouts with a drawing program;
* quickly find articles, components, subjects, and so on. from monthly
contents lists, the year index (on subject basis), or on the basis of
titles, words, and components;
* transfer diagrams, illustrations, pcb layouts and text to other programs.
* HTML overview for MacOS and Linux users
NEW! DiskMirror to run multiple
year volumes from hard disk HIM
Order now using the Order Form
in the Readers Services section in
this issue.
Elektor Electronics (Publishing) PO. Box 190
Tunbridge Wells TN5 7WY England
Telephone +44 (0) 1580 200 657
Fax +44 (0) 1580 200 6t6
See also
www.eiektor-electrontcs.co.uk
76
tlAtoi ektfrer.ki - h 20G4
readers se vices
Please Note
5&:A3se Gens inL^ksd @*r si **■:■'? tiEfn "r :r -~ Dv I 1 - :5 page
: l L"f F9: :-sfe!5 a=ss':j r : _ _
Diketss are suppsed for the £•:•-.£-• ?-.:g of rsilr's wtSeyi ir.;#nei 2 :-:? .».
EVERGREENS
ElektDf ElcdrOiiics Help Disk
£
US
&55I322-I P's* ’jVHtoA-s Yifai&n
ElEklor Ei&elranfcs Item Tracer 19S5-20D3
015
14.45
I-iOjj-H -;sr.f- f s ii* jii=5 ic 5- ‘A^OGivS .E-: ”
Universal Prololyping Boards
815
14.3.5
{fBS-1 FC3
245
4.20
2FCSs
An
7M
UPSB-4 4 PCSs
no. 333 JUNE 2004
Multi Programmer
5-55
11.55
3 02G335-1 FC3
a-eo
15 tO
3 D2D5Z5-- 1 Efe* rTrTTrtfzfc i otiits lajcfe
Pocket Pong
Am
5.E5
3 rwt320-1 1 t)f5S P.C SGtTAEjrS
Rait Rmjler
4’50
6.55
3 B3«e-3*1 PC3
10-BO
19.15
:3 03'453-1 1 D'-ik; F.-C & PC softA^
4-&0
3.6=
ffl-M t&41 F.C 1 ? F0 77' -20 ? pnjgrsr rued
Smooth Operator
2145
37.95
■3 030209-1 : D .5 iL F C soTta re
4-K}
S.65
035ZC r 4-4 ■ FI C 1 1 C P pregranmaf
no. 332 MAT 2004
Design Your Own 1C
14-70
25 00
S 0103S54 PC S
High-End Preamp
15-S5
27.70
•3 u 20046-1 PC 3 — mai -n fHEfd
345
1455
@ 020046-2 PCS — FFfayhjgftf
750
13.30
2 02Cil^ 5-3 F33 — FSLJ bc-:d
5-70
11 J5
3 02D046-11 C-.EX
4-SQ
3.C5
D2G045-4 ’ F'rSlE Lr45Z4 L :-tz e f
Y/ind Speed * Oirection Meter
23-20
49.9Q
3 L-i: £"*-'• Kik- P-T ;=n SETA-3J5
4-90
aes
Q: 33 7f-i1 F . C 1 EFE-7 1 ^'Gg’sT-.ci
17-55
31.05
no. 331 APRIL 2004
[Imp-in Microronlrolter Board
.3 023HB-* PCS
S-60
1525
3 IIC'UF- - ’ DiS> 5irTT:..5 ":,=:: Lf
493
5.55
Pandora's Snund d Musk Soi
? mni-7 pcb
10-60
18.75
1- IKAj2-'~ Ce- i.:._f!iz -f i es
490
5©
07 4 0241 -■: 1 5-FZ - ' P p.-DylaTimad
2655
35.40
VHP- Low Explorer
3 PCS
ESQ
15.50
No. 330 MARCH 2004
Build Ydlk Own DRM Receiver
@ LjAZt>: pcs
610
16.10
.3 32-5355’ 1 1 CfiJt. DRV .ere prc-z^m
4^90
5.65
Code Lock
@ U29434-1 Fs:a
660
16.95
® 020434-11 K£^ soj^e& tei code Gfes
4-90
5 65
L2C434-4 1 Pci 6-r£4A-4R fso&Envr^z
14-7Q
26.®
Hands-on CPLDs 12)
3 G3^D5Z-1 FC-S
5-5
15-20
259]
i Access
® " 2 V D 1 6 S-1 1 C e *: set, s err? w:? acd- c o scIta- z*
7-50
1350
02D16641 AT6SS6252-12PG puGramnaad
1390
24.60
Simple 1 2-lo-23DV Power inverter
3 02&435-1 F€d
a-50
15G5
Tnuch-controliEd Switch
3 0 : M ' 4-1 1 E/i‘_ FIG 1' „. r c ? f-T-l :-
490
£65
:z-:z '4^1 PIC 1 2C 505 4 D7 .2 Gb pmgsarsfisri
615
10.90
No. 328 JANUARY 2004
6T-K 80C552 Flash Board
GENERAL H PAST ISSUES
PtaewifBJi caar-is (FCBa). rcr: Fas sro. : ;* Klt-:: friT
:e'e i -rv.5 EZ-C'-'i r -_i F-*e - ::::- WaijfwMt jifrmipE-:' 5 fry;; iij, L |J ] 4. Ci^r
FC ; E'E- "i £s*2«a£ tor pTj«Ti w-;- v r=,» Res) Farm, Ptitlsy Roil T1CEHURST THS 7HL
a -jgessK -n £#lx £3ed&z :s ri t ;•? c>9?ic uslrg EfigLiad, |+ 44) 1 5: 3 20Q551. fai (+44 )
C-rs=r Fccn p-r '.= d Ofpc^s Tr^ farrr sy i'so 1ES0 2lOS1E e.t. 23 ifiTiSvMi -:!“C2.ce.Lt
1,5^ a afe teats (pr7d=is casc-T^fa cf^i Fr-zes eT ;•«» ,«.h igisiS rz
Decsr^ rct-irg pss;-; T:r jz-p'ss, i-=
: r-E -i"rs c for - iorg a PC E - ‘.= r-st c ii-- £4.75 i if K id £-v £5 30 i &jr msS F_;;i i£ t ;•
•i:'e fH-fj-frade rrtcc- f-= =73;=^ £-: : e.e itit&l cU3afis £=*:>*' Fr-ces past :ui i-> ;
nzy :€to.*d n re rc&tv*r$ kj fJasrte? j$jv 55 , rcLorg ;c-rs-:s fy =
capes. L“ ££.65 iii< r: lir?*: £7 35 •Efr&ii
= EPR a '7.= . flAii ?4_-: £ f=tDs VAC -e P5 " z ”d E_ dd? ; 1= 9 1* “i :..e : : E_'::e
G’.-.” “iJKSctr»^3 S.-5 r^i'j-pre-
PAST ARTICLES
r’ZEo r : fern Ef^vders sud^n te __ e Pd: uSofmsStyi cn ;; r, six ■ s :;Lf! cfcSKi
rsene *e QQtt to pices vfiud EfStoifef &ti AAnHestefiz OfBces, ti^jhana
Emrinaa^m. Frias sad dmi^BBishnm ( 01 5 C^ 200657 : fei 2905 lo, eet^ j^es@stekfcf-
ts re sepereKteeseifiiaEhtmkitjf ittwei- : iQ£ ^r.tr.-is :$._•.
£
DSS
@ §3«HM PCS
935
9 55
@ 030042-1 ' Disk, rrasc. pu.z-ii
4 90
£.65
030042-21 29F01D, pragrarrinea
1093
1770
030042-31 Gil IcYEDtSa? pr^fsir,^
6-10
1D.B0
Climate Logger
m O3D076-1 PCS
7-75
13.70
S OSCO’E-H CfeK 'iVindffft's safiApre
493
8.65
FMS Flighl Simulator Encoder
© 039D66- J PCB
1D20
16 05
03096941 57LFC767ES prc^'inmed
1795
3015
LED Roulette
@ 030168-1 PG3
17®
31. EO
03G T 63-1 J D®t, sou Ts sr.ifi f ? ■. lies
493
6.E5
0301 6841 E 9C205 T - 1 2FG, pfOJ^med
8-05
14,25
Mulli-evenl Alarm Clock
@ §20304-11 Cvsc c I'scurcEj ns lies
4-90
5.6;
§263044 1 ATE 5C2Q51 -12?€, oro^tsmmed
5-10
10.80
Stepper Motors Uncovered
02012741 RCt6FS782§tF
1910
33.60
No* 327 DECEMBER 2003
FM Remote Control Transmitter £ Receiver
@ D34044-1 PC 3
1020
13.05
LED Chrislmas Decoration
@ 030157-1 PCS
7-55
1395
PB7LPC76x Programmer
@ 03031811 {Hsk. pfi^sct software
490
3.65
Projecl TImfikeeper
@ §20350-11 Dbk. £ ot^ECt cafefes
490
8 £5
0103 50-4 1 PiC 1 6 F;4* 1 C ?. ptDgrsmkd
13-15
2325
Stepper Motors Uncovered (2)
@ G 201 27-1 1 D-'-si esi_™z cccs r’s
4-99
6©
Universal Clock Generator
@ §£ O 3 95*1 1 D: e ' . s srm= c - kSs tTz
493
5.65
Y/ireless RS232 Link
@ 030204*1 FCB
070
15.49
No, 326 NOVEMBER 2003
Precisian Measurement Centra!
@ 0300604 PCS
3-70
15.49
No. 326 NOVEMBER 2003
Rev Counter lor H. C Models
@ 024111-1 FC-3
1759
31.00
§24 111-11 Disk = ird tex cede
4-93
8.65
02411 -41 89£ 2051-1 2PC. progeawned
6-55
15.65
Running Teit Display
@ 0T0iJ)7'11 C r 4> SStZCS SJKJ tev Cilife
490
3.65
USB Analogue Converter
@ 0203744 PCS
795
13.59
W 02037441 § ?■ tei cade end YiTdows soBwsre
4-50
8.65
02 0-37441 Pi Cl SC765. pjDgrcinrR^J
13 25
2345
No. 325 OCTOBER 2003
DDS FLF Signal Generator
@ §20299-1 FCB. ge^^EO?
1190
20 55
@ 020299-2 PCS. contTfA'supphV
12-10
21 .45
D2S2994 i AT93S35 1 5 SPG. progrannKtf
39-55
54.05
Minimalist Induclion- Belsnce Metal Detector
@ 0202971 PCS
895
T5.S5
Xilint PROM Programmer
@ Or 01 09-11 SefrAfiTE
490
565
No, 324 SEPTEMBER 2003
ATV Picture Generalar
W 020'295-11 U.sk. s^:z== £ f ,=x Cff? faes
499
8J5
0202954 1 AT90SS 5 1 88 PC, FQ&mni&l
15 20
25-90
6/2054 - flehci elecfronica
77
£ USS
020235-42 AT9051 280-1 2PC. prograrmed 13-30 24.50
DTMF Remole Telephone Switch
@ 020294-1 P£3 11-65 20.60
© 020294-11 De^ project sotforae 4-90 3.65
020234-51 RC1 ff 34 A-2G P programmed 14-70 26.G0
LG Display with i?C Bus
m Q30060-2 FOB 7-35 13.00
PICProg 2003
© 010202-1 FCB 9-05 1600
@ 010202-11 Dfek. VAhJqas Stiflvsro 4-SO S-65
01020241 FeC 16F074-2GP pfCKjanmed 23-55 41.65
Polyphonic Doorbell
@ 020354-1 1 Disk. pf Oj^cl software 4*90 B.65
02035441 BC!6f84A-1(VR programmed 14-45 25.55
Precision Measurement Genlral
03006041 Heatfy’a&ortiil&d £ .tBs&i txranj 69D0 112.50
Valve Preamplifier (1)
@ 010333*1 PCS. £Tiplf£r board tl-55 20-40
@ 020153-2 ptrwsr sap^y bead 11-43 20-20
@ 020533-3 PCB r [ 0 board 10-10 17.60
No, 323 JULY/AUGUST 2003
Add a Sparkle
@026293-11 to arid source fife* 4-90 8.65
020293-41 ftCI2CSQ3A-(U/SLL programmed 7-40 13.10
AI90S2313 Programmer
© 034636-1 PCfl 94>5 16.60
Hard Disk Selector
@ 634050-1 peg g-45 16,75
Mini Running Text Display
@020365*11 IKsk, sowce totteife 4-90 S65
Mini Tesl Chart Generator
© 020463-tl Dssk. PIC source cote 4-90 8.65
Programming Tool for ATlinylS
@ D3OO30-1 PCS J S3 13.35
@ 030030-1 1 Elsie. project software 4-SD B.65
Quad Bridge Car Amp
@ 034033-1 FC3 3-70 15.35
REmole LEghl Conlroi with Dimmer
© 020337-1 T D^ HDCsntfsotSTCffes 4-90 S.65
020337*41 AT89C2051-12, programmed 6-25 11.05
No* 322 JUNE 2003
AVH TV Tennis
© 030026*1 fcfcai PCS 8-70 15.40
© 030025-2 Fu^j-SsnPCB fr60 15.25
@030026-11 Bisk, AVR source code 4-90 B .65
03932641 AT9QB515. program med 15-20 26.90
Sedronic Knotted Handkerchief
@ 020308-11 ffisk PC and rartrofersoftware 4 -SO 5.65
020303*41 AT&9S2313-ie?C, pfDC^r^d 1260 22.30
Low- Co si LCD Control ter (2)
© 020114-1 PCS 8-70 15.35
© 030114-11 Ifek project software 4-93 3,65
High! Light Conlroi
@020115-11 0^ he* and source code 4-9Q 8.65
029115*41 AT90S23t3*10PC T programmed 12-85 22.75
Universal XA Development Board
@ 010103-1 PCS 13-20 23J5
@ 010103-1 1 Disk GAL cafe, EPflCM t>=x fifes, XADEY 4-93 8.65
010103-21 EPROM ICS, 271C256-90, programmed TO-OO 17.70
01O103-22 EPPOLt ICS. 27C255-90, pr^.riT¥Tcd 10-DQ 17.7Q
O1Q103-31 GAL 16VS, programmed 4-EO 3.50
78
£ US$
No, 321 MAY 2003
Countdown Timer
© 02 0235-11 D4v sourc e L~ d be* tofe
49J
B65
0217296-41 A793S12O0. pucriTiTcd
13^50
24
USB Audio Recorder
© 012013-11 C~- EPSOM ha- crate
4*90
8 65
Ot 201 3r2 1 IF Rl V. 27C-5 1 Z pjEgfsmred
1255
223b
Valve Final Amp (2)
@ 02 CO 7 1-1 AmpSET bo in: (ers chsrin^ (
15-10
26.75
@ D20071-2 ftjAEf sup#y boird
10-05
17.75
No* 320 APRIL 2003
8-Channal Disco Light Controller
© Q10131-1 PCS
1310
2315
010131*41 87G 750 e-r 67C7T r pnKsamnssif
23^
40.70
Pico PLC
© 010059*1 PCS
1870
33,10
© Q 1 0059*1 1 DisJc, ieh program
4 93
8.65
Single* Chip Tone Control
© 020054-4 PCS
10-90
19.30
Switched-Gullet Power Bar with RS232 Control
© 020233*1 PCS
ID-BO
19.10
& 020233*11 C's* project stfcwerc
4-6Q
965
Temperature Indicator for toe PC
© 020393-11 D:*>: somite rerrpfed cwfe
4-99
S.65
62 030 0*4 1 47 89C 2051 . prop janmsdi
1925
13,15
No, 319 MARCH 2003
17 V .10 A Swllch-Mode Power Supply
© 020054-3 FOB
945
1965
Add-on Swfteh unit for fl. C Models
© 020126-1 PCS
895
15.85
© D20 1 254 1 O'; ■: bs* SOd SOU it f f i =
4-99
3.63
020 1 20-4 1 F:C i 5C7 1 2-04 1 ■ SB. pro^Eim j
15-20
25-96
AVRee Development System
© Q2035M FOB
13-20
2135
© 020351*11 DfeL BtEr^ife pfograms
4-90
8.65
Guilar Effecls Switchbox
@ 020151-1 PCS
13-15
23.301
Intelligent Fan Timer
© 020170*11 pre SOffAcre
4^0
3.65
020170-41 Jfl5P430Fi J 21. p-c-i , ^ -■ . i fed
1 1-341
20,C*O
SAA3049 Replacement
@ 020555-1 P73
13115
23.10
© 02955c- 1 1 Ds-i soL'rte arat h=x cafe
4-90
6.65
029235*41 6 7LPC7&4 5 >f . im^mned
900
17,55
Two-Colour Running Light
© 01013 4-1 FC3 . corlmfe r boar!
3-25
1460
@010134-2 F£B. L£D fcGL r r!
1045
16 80
© 010134-n d;=v preset stfrtf&s
4-90
3.65
010134-41 AT63C2051-12FC. pragraisred
7-15
12.65
No, 318 FEBRUARY 2003
20 40 MH! Logic Analyser
<© 020032*7 PCS
15 20
26 85
© 020052-11 D'rsZ cfesrto piT-; r i^.
4-SQ
8.65
02005 2-4 r AI9G585 1 5-5PG r pxt n mmed
15 ID
2670
Active Loudspeaker System (2)
@ 020054*2 PC 3
7-95
14.D5
Autoranging Capacitance Meter
<© 020144-1 F6S
7-35
13.00
© G2-0144-11 Ds< ssaca £?rf hsx les
4-9D
855
029144-41 R016F54A 2LI P pre^ramnsed
15-20
2690
Dimmer with 0-10 V Ccnlrcl Input
@ 010125-1 rr.-r-J PC 3
9-60
17 .00
@ 01 01 25-2 E:Tin;' PCS
S-§5
15.85
Electronic Hourglass
© D2B056-1 PCS
1855
31 B5
@ 025055-1* WsK p*c>4i sfifftfare
4-99
3.65
0 20*35 541 R-.Cl Gf 84-04 P p rarer^d
15-20
26 90
Optimise your PC Soundcard
© 920184*1: Ehsfc ExdeI spreadsheet
Am
a.65
No, 317 JANUARY 2003
Aclive Loudspeaker Syslem (1)
© 02(3054-1 FGB
6-20
1Z2Q
Electronic RPG Dice Roller
© 02O0Q5-1 F£3
1995
17.75
© 020065*11 □ -EV SOLEfT^ cocfe f te
4-9C
3 65
02®O5*41 AT9334433n8?C. pregjsmsed
30-86
54^0
Rodent Deterrent
© 028116*1 PCB
124i5
21.30
SMS- Control led Mains Sockets
© 020157-1 PCB
129G
2Z35
Products for older projects (if available) may be found on our web site
http;llwww. eiekior-electronics. co. uk
debtor elsdrcnics - 6/2004
Please supply the fallowing. For PCBs. front panel foils, EPROMs. PALs. GALs. microcontrollers and diskettes, state the part number
and description; for books, state the full title; for photocopies of articles, state full name of article and month and year of publication.
PLEASE USE BLOCK CAPITALS.
Description
Flash Microcontroller Starter Kit
Item Tracer 1985-2003
cd-rom Elektor 2003
- :£s and item descriptions subject to danga.
Tr» publish* m serve the right 10 change prices
without prior notificaLon Press anc item descriptions
shown bcia supersede tiies* in previous issues. EL i O.E.
SWITCH, only: issue number
Price each Oty. mfai Order Code
I
£ 69.00
£ 8,15
£ 16*25
Sub-total
P&P
Total paid
METHOD OF PAYMENT
(see reverse before ticking as appropriate)
Note: cheques not made out
in sterling must be increased
by the equivalent of £15.00
□ Bank draft
D Cheque
(payabfe to Bektar Electronics PuffTrsfiing)
ED Giro transfer
four account no. 24 152 330 - 1 )
EH Postal/money order
□
MasterCard
=i . .yji.yi
Name
Please send this order form to *
/see reverse for conditions,
Elektor Electronics (Publishing)
P.a Box 1 90
Tunbridge Wells TN5 7WY
ENGLAND
Address
IGl
Fax
Posi Code
Fma3
Oats - - 2004 Signature
TeL: i+ 44 ) (0 1550 200 657
Fax: (+ 44 $ ( 0)1500 200 673
merneL www.elektof-ejecirtm ts co.uk
'LE-. :?n: Qzr.zzz res=!ients
<>-ji are r.iiS ob ged &
use S pries. ar-S s~.d the cruet iz^ to
0 3 Cc. 1 l S ound Uts
40. Box S7E. Peterborough
■NH 024534476 TL “E4-637: 524-6526
1503 : 524 -Q -47
Email ejce-es-- sau-Fatfcress com
□ Yes, I'd like to try out
the restyled
elektor electronics
Tam taking out a trial subscription now,
i will receive 3 issues (Juiy/August s September
and October) for just £ 7.50 (without obligation).
The trial subscription expires automatically.
YOUR SAVING:
MORE THAN 40%!
Trite {Dr/Mr. Mrs ‘Ms 1 }
Initials
Surname
Name
Address
Pest coda
Email
Date
- 2004
Signature
METHOD OF PAYMENT
see reverse before ticking as appropr a:e.
Note: cheques not made out
in sterling must be Increased
by the equivalent of £1 5.00
□
□
□
□
□
Bank draft
Cheque
(payable to Elektor Etedmucs Publishing)
Giro transfer
EOUfS-iCOUri HO. 34 152 3EC: •
Postal/money order
Expiry date; .......
P ease send this order form to
Worldwide Subscription Service Ltd.
Unit 4. Gibbs Reed Farm
Pash ley Ro ad
Ticehurst, nr. Wadhurst
East Sussex
ENGLAND TO5 7HE
■ cross -'it what is no: applied -.'a
Tel. (+44) (0)1580 200557
Fax M4) (0 j 1 580 200616
Email ;vtfss@ ftwsa.der7tGn.cauk
i
ORDERING INSTRUCTIONS, P&P CHARGES
Except in the USA and Canada, all orders, except tor subscriptions (for which see below); most be sent BY POST or FAX to our Tunbridge Wells
address using the Order Form overleaf. On-tine ordering: http: . v, Vimv-eteldor-elsdronics co.uk
Readers in the USA and Canada may (but are notobtigsd to) sene orders, except for subscriptions Tor which see below).
tc the USA ajjrsss given or the order form. P:eass sop., to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for deliver.
Orders placed on our Tunbridge Wells office must include P&P charges (Priority or Standard 1 as follows:
UK: £3.50 Europe: £5.00 (Standard) or £7.00 (Priority) Outside Europe: £8.00 (Standard) or £12.00 (Priority)
HOWTO PAY
Unless you have an approved credit account with us, all orders must be accompanied by the full payment including postage and packing charges as
staled above. Payment may De made by cheque drawn on a London clearing bank • but see para. 4 below . postal order, VISA. Access.
MasterCard or Euro Card : w hen paying by credit care the order must go the cardholder's aebress), Do nc: send cash through the mail. Cheques are
posts orders should ae messed sue made payable to Elektor Electronics Publishing A Payment may also be maee by direct transfer from a private
or business Giro account to cur Giro account No. 34 152 3801 by completing and seeding to the National Giro Centre, in a National Giro
postage paid envelope, a National Giro transfer 'deposit farm. Do no! send G^o transfers direct io us, as this will delay your order. If you live outside
the UK. payment may also be made by Bankers' sir' mg draft drawn on a London clearing, bank. Eurocheque made cut in pounds sterling
[with holders guarantee cars number written or the back), or LS or Canadian dollar cheque drawn on a US or Canadian bank - 1 you pay by Bankers'
sterling draft, make dear to the issuing bank that your full name and address .MUST be communicated io the London Clearing bank. Our bankers are
NAT WEST PLC. 1 St James's Square, Wadhurst, East Sussex TN5 6E3H, England. Our account number is 3512 5225.
Sorting Code 60-22-15. [BAN code: GB40 NWB K6 022 15 3512 5225 BEC code: NWS KGB 2L
COMPONENTS
Components for projects appearing in Elektor Electronics are usually available from certain advertisers in this magazine. If difficulties in the supply
of components are envisaged, a source will normally be advised In the .article. Note, however, that the sources) given is (are) not exclusive.
TERMS OF BUSINESS
Delivery Although ever: effort wjjll oe made to dispatch your order within 2-3 weeks from receipt of y our instructions, we can not guarantee this
time scale for eh orders. Returns -aufr, goods or goods sent in error may be returned for replacement or refund, but not before obtaining cor
consent All goods returnee should he packed securely in a padded cag or box. enclosing a corering letter stating the dispatch note number, !■ me
Goods are returnee because of a mistake on our pan we will refund the return postage, Damaged goods Claims for damaged goods must ::e
received at our Tunbridge Wells office within 10 day's (UK); 14 days (Europe) or 21 days (all other countries). Cancelled orders All cancelled
orders wfif be subject to a 10% handling charge vtitti a minimum charge of £5 00. Patents Patent protection may exist in respect of circuits,
devices, components, and so an described in our books and magazines. Elektor Electronics (Publishing} rices no: accept responsibility or liability
for failing to Identify such patent of other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated
Circuits, diskettes and software carriers published in our books and magazines Tiber than in third-party ativeriisemerilS) are copyright 3rd may
not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part without the prior permis-
sior «r Elektor Electronics i Publishing) in writing. Such written permission must also he obtained before any part of these publications is stored in
a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior per-
mission. Limitation of liability Elektor Electronics (Publishing) sna : no! be liable contract, tort or otherwise, for ary 'ass or damage suffers a by
the purchaser whatsoever or howsoever arising out of T or in connexion with, the supply of goods or services by Elektor Electronics (Publishing) other
than to supply goods as described or. at the or. on oi Bektor Electronics Publishing), to refund the purchaser any mcne.. zm in respect of the goods
Law Any question relating to the supply of goods and sen/ices by Bektor Electronics {Publishing) shall be determined in all respects by the laws of
England. January 2004
SUBSCRIPTION RATES
FROM JANUARY 2004 ISSUE
United Kingdom
Standard
£39.50
Plus
£45.50
Economy Mail
Rest of the World (excluding Europe)
£51.30
£57.30
Priority Airmail
Europe & Eire
£52.50
£58.50
Mi d d fe E ast . A fri ca .Sou th wes \ Asia,
Central & South America
£64.00
£70,00
Australia. Hew Zealand.
Far Fast 3. Pacific Territories
£66.00
£72.00
Airfreight
USA 3 Canada only
US$88.00
USS9B.50
Payment should be made by:
* Cheque or bankers' draft in sterling drawn on a London clearing bank
except in the USA and Canada — see below j:
* U5S cheques drawn on a US or Canadian bank — only to, subscribers
in the USA or Canada.
* Di fee 1 1 ran ster i c a ur ban k ' , AT V ESI PLC. 1 St James's S q ua re ,
Wadhurst, East Sussex TN5 69H, England).
Our account number s 3512 5225. Sorting Code 60-22-15.
I BAM cade: GB40 NWB K6 022 15 3512 5225 BIG code: NV/B KG3 2L
* Postal order.
* Credit card: VISA, ACCESS, Eura/MasterCard. JOB Electron or Switch.
* Transfer to our Giro Account number 34 152 3801. Giro transfers
should be made by completing and sending the appropriate transfer/
deposit form io the National Giro Centra ; UK or to your national
Giro Centre.
SUBSCRIPTION CONDITIONS
Ins standard subscr prion order caric: is twelve months.
If a permanent change of address during the subscription period
means that copies nave to be despatched by a more expensive service,
no extra charge will be made. Conversely, no refund will be made,
nor expiry date extended, if a change of address allows the use of a
cheaper service.
Student applications, which qualify for a 20% (twenty per cent) reduc-
ton if: current rates, must be supported by evidence of studentship
signed by the head of the college, school or university faculty. A stan-
dard Student Subscription costs £31.60, a Student Subscription-Plus
costs £37.60 (UK only).
Please note Ida! new subscriptions take about four weeks from receipt
of order to became effective.
Cancelled subscriptions will be subject to a charge of 25%
(twemy-fwe oer cent) of the full 1 subscription price or £7 50
whichever is the higher, pins the cost of any issues already : s-
pat cried. Subsciptions cannot be cancelled after they have run for six
months or more. January 2004
Cheques and postal orders should be made payable to Elektor
Electronics Publishing). Do not send cash through the mail.
pcb layouts
Multi Programmer 020336- 1 (solder side)
A 1 ulti Pr eg ra mm sr 0203 3 6 - : ( componen is s id ej
Personal Sound to Light Unit 0300 1 9- !
Smooth Operator 030209 - 1
Rail Router 030^03- 1
All PCB layouts shown reflected and at f rue she ( 100%)
unless otherwise stated.
6/2004 - ekklur ektiroiiits
SI
sneak preview
Mini Webserver for Internet and Intranet
A newly developed add-on interface for cur incredibly
popular MSO210 microcontroller board (afeo known as
Precision Measurement Centra I') provides network and
Internet connectivity, allowing the processor to publish Its
own data pages onto the web.
As a practical example, the article describes a temperature
logger allowing the user to enter, via the Internet, tempera-
ture limits and an email alarm address to which a prede-
fined message is senl likewise, the Mini Web Server
mokes it possible far network ports to be switched or inter-
nl| from an Internet- connected PC, literally any-
on the globe.
Do not miss the best selling issue of the year.
Reserve your copy MOW.
Summer Circuits 2004
The combined July/ August 2004 issue will contain a collection of more than 50
short ankles covering
- small circuits
- design ideas
- !C presentations
- application nates
- hardware & software tips
- free downloads
- PC8 layouts
- junkbox projects
... and that's more than some of our competitors manege to print in four
months.
Other regular-size articles
Besides the small circuit collection and our bumper 'Mini Webserver 1 ' project we
intend to run the following full-size articles:
- TV Commercials Killer
- Working with Active X
- Room Thermometer
- Wireless Control for Canon EOS Cameras
RESERVE YOUR COPY NOW! The Ju 1 y%su>l 2004 issce goes e sale on Friday 18 Juno 2034 (UK disTfibti:n Kilyl,
UK subscribers will receive the magazine e is* days before this dale. Article titles and magazine can ten si subjetl to change.
NEWSAGENTS ORDER FORM
SHOP SAVE / HOME DELIVERY
Please save / deliver one copy of Elektor Electronics magazine for me each month
Name:
Address:
Post code:
Telephone:
Date:
Signature:
+ # * #
- s ■ ■ ■ ■
elektor
electronics
Please cut out or photocopy this form, com-
plete details and hand to your newsagent,
Elektor Electronics is published on the third
Friday of each month, except in July
Distribution S.O.R, by Seymour (NS).
Index of Advertisers
ASgooti Technology, Net links ........ jmm aIJQtmdtechnok3gy.com . „ „ 74
Beta Layout. Met Unto .............. .wmKpcb-poofxom 9, 74
8 tan Technology LTD, Met links ...... v. wbi -ntsc com .............. .... .74
GM3 ................... . . .iv/rtfc/ns. art-tom ............ 9
Comp Li cut Met Links ....... nV'W-GDfflpo .74
Contort! Bectm&s, Net Links ........ ymwcoiflmdetec.cit.uk v .74
CricHcivood .41
Danbury, Met links jvav. mc-fi. tistmn.CQMk ... . .74, 76
Debug [nnovafions, Met Links wAwtiebugmtK'alions.com .74
Display Efedronics ww.disfe .corj*; .......................
Easysync, Met Links ...... ,vw,. ess.s, ~c.co.uk 74
SocoL Met links ........... jaav e&xp tram ......... .74
Elnec, Met links ................ rWrip.o. free, com .74
Ennovi ...... ............ jtmetmovj.CD.ok .41
Enran international. Net Links jwa Kvin-tiLoy-- .74
Eunjcircuits JCJWBpctshop.com . . .78
Forest Net Links wav fc red-tv. .................... .17, 74
Future Technology Devices. Met Links . . .iWAvJtcicrp.corn .74
Futurfsc. Net links ... m\w> frfurfcc-cc.m 74
Hammond Electronics, Net Links ...... ....... . 74
ITP . .mw.itpW1.com 9
Lab center mw. rtcmercoMk .84
London Electronics Collets* Net links . . jAAvJtc.ars.uk .... .74
Matrix Multimedia Lid . wvs.Trmlnxmyltimtd^coMk .61
V T'C yVuJ-m ■ :r- ;- ■ . >3
MOP Electronics,, Net Links uwA.nxiprlECliDnfcs.caM*; .74
Net Links ................... ... .74. 75
New Wave Concepts, Net links . . jaav. fl 5 com ..... .74
Number One Systems .............. .yaw/. flu Tbewnemn ........ .41
PAGM vim vpsgnt.co.uk ...... 2
Pmk Electronic, Net Lints ........... mmpe3kBteCLCOJ& 74
Pico ........ ... .vAAvMfdsQCOfn .83
Quasar Electronics, Net links ........ . # I a y. gtasafefec l/o nfcs. com ........... .49, 75
Robot Etectmnics, Net Links ......... mmrotot-ekckDnks-rQ.uk . ... 75
Stewart of Reading ......... ... jYAv.sts\varbof-resdihg- oo . uA . . .61
T&chnobflts. fM Lmks ... a sj\techiiQtiats r ca.uk . _ .75
Telnet fiat links vjtfwfetoLf/* coy 75
Uitoleds. Net Links ................. jwmuitzJstfs com. .............. 75
USB Instruments, list Links jAwaJskmtrhm^mxBtu 75
Vero Technology . . . * jvAvjemtl.cGm . ...................... ,17
Vfewcom, Net links vavk. mvfcafn.f9-Cif.uk 75
Wteck, Net Links . . jwiv.CQmpQfmMecfmtiGgy.CQMk ... ..75
ADVERTISING SPACE for ire issue ol 17 Atgd £004 may be reserved
nonaaerthanZt July 2004 with Bektor Eeciranfcs (PubSslang) Adver&erreri Office -
3 Crescent Terrace - Cheltenham GL50 3PE r — England - Telephone 01242 510 760 -
Fax 01 242 226 626 - e-mail: Bernard n utoant@ukonbns.eo- ok to whom aU correspondence,
copy instructors end artwork should be addressed.
82
dtktor detircnlts - 6/2604
DrAQ
Temperature
External sensors: Humidity
Temperatun
02 In Air
Reed Switcl
• Low costw„under £60
• Built in senscSrs.for light, temperature and sound
(level and waverorms)
• Use DrDAQ to capture fast signals
• Outputs for control experiments
• Supplied with both PicoScope (oscilloscope) and
PicoLog (data logging) software
For more information on DrDAQ, please visit:
www.picotech.com/drdaq94
Scope and spectrum analyser functions
A fraction of the cost.of benchtop scope
Save multiple setup/, for ease of use
Save, print and e-mail your traces
FREE technical support for life i
FREE software and upgrades f
Automated measurements l
Ave-zrs
Virtual /nstrument
For more information on our scopes, please visit:
www.picotech.com/scope165
Tel: 01480 396395 Fax: 01480 396296
E-mail: sales@picotech.com
I-p .
* . , ,
a ■
wu
r-alEk
j A *
Tii; ivh T
i
w
Models
'Ullitri t » ygf j i.
Schematic &
PCS Layout
Mixed Mode SPICE Circuit Simulation
Complete Electronics Design System
Simulation
i * { t !_*_§ ft: i ft it
Virtual System
tt ;t> mi tu 1 1 in
i ? i » i
in
• Drag and drop toolbars.
• Visual PCB packaging tool.
• Improved route editing.
• Point and click DRC report.
• Multiple design rules (per net)
• Multiple undo/redo.
Call Now for Upgrade Pricing
• Supports PiC, AVR, 8051, HC11 and ARM micro-controllers.
• Co-simulate target firmware with your hardware design.
• Includes interactive peripheral models for LED and LCD displays,
switches, keypads, virtual terminal and much, much more.
• Provides source level debugging for popular compilers and
assemblers from Crownhill, IAR, Keil, and others,
I 1
Powerful & flexible schematic capture.
Auto-component placement and rip-up/retry PCB routing.
Polygonal gridless ground planes.
Libraries of over 8000 schematic and 1000 PCB parts.
Biil of materials, DRC reports and much more.
www. labcenter. co. uh
info@labcenter. co. u/c
Berkeley SPICE3F5 simulator with custom extensions for
true mixed mode and interactive simulation.
6 virtual instruments and 14 graph based analysis types.
6000 models including TTL, CMOS and PLD digital parts.
Fully compatible with manufacturers' SPICE models.
Proteus VSM - Co-simulation and debugging for popular Micro-controllers
hill J 11 iii iJHUiMlM