This is only a preview of the December 2000 issue of Silicon Chip. You can view 33 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Build A Bright-White LED Torch":
Items relevant to "2-Channel Guitar Preamplifier, Pt.2: Digital Reverb":
Items relevant to "Driving An LCD From The Parallel Port":
Items relevant to "A Morse Clock - Look Mum, No Hands!":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
Look Mum, no hands (or digits!)…
dahdah dahdahdah di’dahdit di’di’dit
dahdi’dahdit di’dahdi’dit dahdahdah
Here is a novel clock that doesn’t have a readout.
It’s a talking clock, but instead of telling you the
time in words it sounds the time in Morse code.
A
maze your friends by being
able to tell the time just by
listening to some dots and
dashes. If you are an amateur radio
operator, it is sure to make a great
addition to your shack.
There have been hundreds of clock
projects over the years but to my
knowledge there has never been one
like this. The clock features hourly
chime, one second internal resolution
with an announcement resolution
of one minute, and you can also
select 12 or 24 hour time and
set the speed of the Morse!
As with a lot of
projects that have
appeared in SIL
ICON CHIP this
clock uses a mi
crocontroller –
in this case a PIC
chip – to do all
the work. There
are very good rea
sons for this; PICs
are amazingly ver
satile and they
turn what would
have once been a
complex project into a very
simple one. Of course, the fact that
we are not worrying about driving a
LED or LCD display makes it even
easier, with the output device being
a small piezo buzzer.
Using Morse code also makes the
project simpler, just like a Morse code
radio transmitter is a lot less compli
cated than a voice transmitter. With
Morse code we just have two states
to worry about; either the tone is on
and we can hear it, or it is off and
we can’t hear it. Now if you haven’t
68 Silicon Chip
learnt Morse code yet either through
your work or as a hobby, don’t worry.
To be able to tell the time with this
clock only requires a rudimentary
knowledge of the code. Indeed to
get you started there is a slow Morse
setting so that you can get in some
practice before you move onto the
fast Morse setting.
The project is constructed on a
small PC board and housed in a plas
tic box. Power is normally supplied
from a 9V DC plugpack, however the
box incorporates a battery backup in
case of power failure.
The Morse clock has only two
buttons, TIME and SET. The TIME
button is used to announce the time
and also step through the functions
in program mode. The SET button
is only activated in program mode
and is used to select the options for
by Leon Williams
VK2DOB
each of the functions. How to set the
time and program the functions is
described later on.
Circuit description
The full circuit is shown in Fig.1.
As you can see there is not a lot to it,
with the PIC chip (IC1) doing almost
all the work. The PIC chip used here
is a 16F84 and is very commonly
used. Its major advantage is that it
can be programmed with a cheap
and simple programmer and can be
re-programmed over and over. So if
you make a mistake with the pro
gram (it’s an unwritten
rule that
programs
n e v e r
work first
time), you
can simply
rewrite the
chip with
out having
to throw
it away
or erase
it with UV
light.
Packed inside
the PIC (amongst
other things) is a
general purpose timer,
13 I/O pins that can be
individually configured as outputs
or inputs and 1K of flash ROM and
68 bytes of RAM.
Pins 15 and 16 of IC1 are the oscil
lator pins, connected to a 3.2768MHz
crystal and two 22pF capacitors. The
crystal frequency is divided by four
inside the PIC to give an instruction
clock of 819.2kHz. This is further di
dit
dahdi’dahdit dahdi’dah*
*(MORSE CLOCK)
vided by 64 in a pre-scaler and this is
applied to the clock input of Timer 0.
Timer 0 counts from 255 down to zero,
repeating at a rate of 50Hz. The PIC is
interrupted each time Timer 0 reaches
zero and the software counts these
pulses and when 50 are counted,
one second has elapsed. The second
count is in turn used to increment the
minutes and hours counters.
Pin 4 is the reset pin and is tied
to +5V by a 10kΩ resistor. The PIC
has a built in intelligent reset circuit
and this should prove to be adequate
in this application. However, if the
power supply is disconnected, allow
enough time for the bypass capacitors
to discharge before reconnecting the
power, otherwise the reset may not
work properly.
The TIME button is connected to
Pin 7 which is configured as an input
to Port B and has an internal pull
up resistor. When the button is not
pressed the PIC reads the pin as high;
when the button is pressed it is read
as low. The SET button is connected
to pin 8 and acts in the same way.
The software performs a debounce
operation on the buttons. When a but
ton is first detected as being closed,
it waits for a short period and tests
the button again. If the button is still
closed, the program accepts this as a
valid press otherwise it treats it as a
spurious input and ignores it.
The remainder of the Port B pins
are configured as outputs and so do
not need to be tied to a rail.
The Port A pins are all configured
as outputs with pin 1 used to activate
the piezo buzzer. When the output is
high (+5V) the buzzer is on and when
the output is low (0V) the buzzer is
turned off. The timing of the dots,
dashes, character and word spacing
are all multiples of the interrupt
period (20ms). The software simply
counts the number of interrupt peri
ods and holds the output pin high or
low for the prescribed period.
The clock is powered from a nomi
nal 9V DC supply, such as a plugpack.
Diode D1 provides protection from
reverse polarity and the 100µF capaci
tor helps reduce power supply ripple.
Regulator REG1 is a 78L05 type and
its output voltage is raised to around
5.5V by D2, with the 0.1µF capacitor
guarding against instability. Diode
D3 drops this voltage back to 5V to
We think old Sam Morse
would have approved . . .
supply IC1 at pin 14 and also stops
the battery current from flowing back
into REG1.
When the power supply is re
moved, power for IC1 is supplied by
a back up battery supply comprised
of 3 AA cells. When normal power is
applied from the plug pack, diode D4
is reversed biased and so no current
is drawn from the batteries. Howev
er, when the main plugpack supply
is not available, diode D4 conducts
because its anode is more positive
than its cathode and current for IC1
is supplied by the batteries.
The PIC chip draws around 1mA
when in idle condition and about
Fig.1: the circuit diagram is just a power supply and a PIC microcontroller.
December 2000 69
Parts List: Morse Clock
1 PC board, code 06112001, 72
x 56mm
1 plastic case, 130mm x 67mm
x 44mm
1 panel mount DC connector to
suit plugpack
4 PC board stakes
1 3.2768MHz crystal (XTAL1)
1 piezo buzzer (Jaycar AB-3459)
2 PC-mount push button
switches (S1,S2)
1 18-pin IC socket
8 No. 6 x 12mm self tapping
screws
4 32mm plastic spacers (see
text)
1 3 AA cell battery holder
4 self adhesive rubber feet
Small piece of tinned copper
wire
Light duty hook-up wire
Semiconductors
1 PIC 16F84-04P (IC1)
(programmed with
MORSECLK.HEX)
1 78L05 5V positive voltage
regulator (REG1)
4 1N4004 power diode (D1-D4)
Capacitors
1 100µF 25VW PC electrolytic
1 10µF 16VW PC electrolytic
2 0.1µF MKT polyester
2 22pF ceramic
Resistors (0.5W, 1%)
1 10kΩ
10mA when the buzzer is operating.
While the circuit could be re-arranged
to operate solely from 4 AA cells, with
the regulator components removed,
the expected operating time from the
batteries alone would only be about
2-3 months. The batteries are only
included to prevent the time settings
from being lost when the unit is re
located or when there is a blackout.
If you choose not to use the backup
batteries and the plugpack power is
lost the time will need to be reset.
Disassembled view of the Morse Clock. The 3-AA-cell battery holder is a little
unusual – if you can’t find one, use a 4-cell holder with a dummy battery.
mounting the smaller, passive com
ponents (ie resistors and any links)
progressing through to the larger
ones, then the active components
(semiconductors) and any on-board
hardware (IC sockets, etc). Leave the
installation of the PIC chip until the
construction and initial testing is
complete.
Refer to the component overlay
to ensure all components go in their
correct spots and that any polarised
components are installed correctly.
Note that the two electrolytic capac
itors need to be laid on their sides to
avoid fouling the lid. The crystal is
also laid on its side and held down
with a piece of tinned wire soldered
to the pads underneath the board.
When installing the buzzer, make
sure it is mounted flat against the
PC board so that the when the lid is
in place, the pushbuttons protrude
sufficiently out of the lid. The buzzer
positive lead is the longer one and
Construction
Construction of this project is
straightforward. Start by checking
the PC board for faults, looking for
bridges across tracks and open cir
cuit tracks. While there is no “right”
or “wrong” sequence to installing
the components, we usually start by
70 Silicon Chip
Fig.2: the PC board
component overlay.
Note that the two
electroyltic capacitors
and the crystal must
be laid over to fit
under the case lid.
connects to pin 1 of the PIC.
Once the PC board is completed,
it’s time to mark and drill the holes
in the case. The PC board is mount
ed on four pillars made from 32mm
plastic spacers. These are screwed
to the bottom of the case and the PC
board screws to their top, just far
enough down from the lid to allow
the push-buttons to poke through.
Unfortunately the 32mm spacers are
just too long for this so we have to cut
them down a little.
First, place the PC board inside
the box on the right side, butting up
against the integral pillars. Align
the PC board so the buttons and the
buzzer are placed on the centre line
of the base. Mark the spots for the
mounting holes with a pencil and
drill clearance holes for the self-tap
ping screws. Drill a suitable hole for
the DC connector on the rear side.
Mount the DC connector and solder
two wires to the socket long enough
to easily reach the PC board
power pins.
Take the four 32 mm spac
ers and carefully cut each of
them to a length of 28 mm
with a fine toothed hack saw.
The plastic spacers used in
the prototype have holes in
each end that allow a No.
6 self-tapping screw to be
inserted. Screw the four pil
lars to the inside of the case
bottom and then place the PC
board on top of the spacers
and screw into place with the
four remaining self-tapping
screws.
You will also need to drill
three holes on the centre line
of the lid for the switches
This same-size view shows that all fits in quite nicely into a standard 130 x 67 x 44mm
and the buzzer. The switch
Jiffy box. The PC board mounts on 28mm spacers to place the push-button switches at
exactly the right height when the box lid is screwed on.
es have a round body and
the hole needs to be just big
the batteries and install the PIC chip
for hourly chime turned off. Pressing
enough to allow the switches
into the socket. Note the orientation the SET button toggles between the
to move freely. The hole for the buzzer
– pin 18 is closest to the crystal.
settings.
needs only to be equal to the hole in
Connect the plugpack supply and you
(3). Press the TIME button to access
the top of the buzzer body to allow the
should be greeted with the wonderful the 12/24 hour function. The number
sound of the buzzer to escape when
sound of slow Morse sounding the
1 is sounded to indicate 12 hour time
the lid is in place.
and number 2 for 24 hour time. Press
Solder the DC connector wires to letters OK. Press the TIME button
and you should hear the time being ing the SET button toggles between
the PC board supply pins and the
the settings.
battery holder wires to the battery announced. Don’t worry about what it
(4). Press the TIME button to access
pins, ensuring that the positive and says at this stage, because we haven’t
the AM/PM function. AM is sounded
negative leads go to the correct posi set the time yet.
Install the batteries again and then for AM and PM for PM setting. Press
tions. The battery holder fits neatly in
remove the plugpack. Press the TIME ing the SET button toggles between
the gap left in the lefthand side of the
button and verify that the clock is the two settings
case. You could add a small piece of
(5). Press the TIME button to ac
foam as a packer to stop the battery still working with only the backup
batteries. You will probably notice cess the fast/slow Morse function. F
holder moving if you wish.
that the output from the buzzer is
is sounded for fast Morse and S for
To prevent the mounting screws
lower in level. This is normal and as the slow Morse setting. Once again
scratching your desk and to make the
clock less likely to slip around, attach stated earlier, the back up batteries the SET button toggles between the
four self adhesive feet to the bottom are really only included to keep the two settings.
clock going if the main power is lost
(6). Press the TIME button to access
of the case.
for a short period.
the Hour function where H is soundTesting
Install the lid, reconnect the plug ed. Press the SET button and a beep
Once construction is complete, it pack and your Morse clock is now will be heard. Each beep represents an
increment of one hour, starting from
is time to apply power to the circuit. finished.
zero. In this mode the SET button
Leave out the batteries at this stage
Setting the time
automatically repeats. If you do not
and connect the plugpack to the DC
Setting the time with the Morse
press the SET button the hour setting
socket. Using your multimeter, meas
is unchanged. If the hours are set to
ure the voltage at the output of REG1. clock is very simple, because there
are only two buttons to press. Follow an illegal number, that is over 12 or
You should read about 5.5V, and also
you should read about 5V at pin 14 of the steps below to set the time and over 23, they are reset to zero and
start again.
the IC socket. If not, remove the power program the functions:
(1). Press the TIME and SET but
7. Press the TIME button to access
source and check your wiring again
the Minute function where M is
and the installation of the polarised tons together. The letters PGM are
announced in Morse code, indicating
sounded. Press the SET button and
components.
you are in program mode.
a beep will be heard. Each beep rep
Assuming this is correct, remove
(2). Press the TIME button to access resent an increment of one Minute,
the plugpack supply and install the
batteries. Measure the voltage at pin the hourly chime function. The cur starting from zero. In this mode, the
rently set option will be announced, SET button automatically repeats. If
14 of the IC socket again and this time
it should be about 4V. If so, remove either ON for hourly chime or OFF you do not press the SET button the
December 2000 71
Learning Morse Code
While Morse code is no longer used in most commercial
activities, some knowledge of Morse is required, at least for
the next year or two, to gain a full privelege amateur radio
licence. (The requirements have recently been changed
to allow those who pass the 5 words per minute (wpm)
Morse test to have access to all amateur bands. In the
past, 10 wpm was the standard).
So why learn Morse code? It’s still a viable means of
communication; it’s still used by the armed services (eg,
where ships are in line-of-sight to each other and radio
communication might be eavesdropped, “Aldus” lamps
are still used which flash Morse messages via light). But
perhaps more to the point, if you listen in to the amateur
radio bands (particularly the HF bands) you’ll hear amateur operators communicating with each other solely in
Morse – for the shear pleasure of it.
If you want to learn Morse code, listening in to the amateur bands is one of the best ways to go. Not one of the
20, 30 or 50 wpm speedhogs but slow Morse, often used
by Novice operators.
Or you could obtain one of the many tapes available
which teach Morse code. And there are even many
computer programs around which generate Morse from
either a keyboard or from ASCII text and sound it via the
computer speaker.
The point is that Morse is an aural language, not visual.
And while we’ve printed the Morse alphabet and numbers
below, you will notice we haven’t shown it below )as dots
and dashes – it is shown as dits and dahs – and should
always be spoken that way. So the letter “A” is not dot
dash, it is di’dah. “F” is di’di’dahdit, not dot dot dash dot.
Note that if a "dit" is followed by another element (either
dit or dah) we don’t pronounce the “t” in that dit – the T
and the following D become effectively the same sound.
The other main thing to remember when learning Morse
is NEVER to start trying to send letters before you have
thoroughly learnt to receive the whole alphabet. It’s very
tempting to grab a Morse key or even a push-button switch,
connect it to an oscillator and start bashing away. But your
timing will almost certainly suffer if you haven’t got a good
knowledge of Morse from reliable sources - others will find
your Morse difficult, if not impossible, to decipher.
Some letters are recognised very easily – if only because they form parts of common words or phrases. Who
doesn’t know SOS, for example? Or “V” for victory (also
known as the start of Beethoven’s fifth symphony – didididah). Other letters are easy because, well, they ARE
easy: A (didah), E (dit) H (didididit) I (didit), M (dahdah),
N (dahdit), O (dahdahdah) and T (dah). Even R (didahdit)
and K (dahdidah) aren’t too difficult.
There are other letters which are recognised because
they are part of commonly heard expressions – especially
on radio. “CQ”, or a general call to all stations, is one example. “HI” is another. And the universal radio greeting,
“73”, makes a seven and a three easier.
It’s when you start getting into some of the more obscure three-sound and four-sound combinations that
Morse gets a little tougher – and some letters, such as B
(dahdididit), C (dahdidahdit), F (dididahdit) G (dahdahdit),
J (didahdahdah), L (didahdidit), P (didahdahdit) Q (dahdahdidah) W (didahdah) X (dahdididdah), Y (dahdidahdah)
and Z (dahdahdidit) are regarded as the most difficult to
recognise quickly. So you might have to put a lot more
effort into these.
Some people find learning “opposites” helps them: eg,
R and K. Others find putting letters into similar sets works
– eg A, U, V. Others simply get stuck in and learn the lot!
Numbers are easy to remember but harder to recognise. That’s because numbers follow a pattern – one is
didahdahdahdah, two is dididahdahdah and so on, but
they have five-sound combinations. So when you start to
hear a “1”, it could be an “A”, then a “W”, then a “J” then
finally it becomes a “1”. Fortunately, most of the time when
numbers are sent you’re probably expecting to hear a
number, rather than a letter, so you’re more attuned to it.
OK, enough of the preamble. Here is the full Morse
code, including some punctuation. Gee, we hadn’t even
mentioned trying to learn punctuation, had we?
A
B
C
D
E
F
G
H
I
J
di’dah
dahdi’di’dit
dahdi’dahdit
dahdi’dit
dit
di’di’dahdit
dahdahdit
di’di’di’dit
di’dit
di’dahdahdah
N
O
P
Q
R
S
T
U
V
W
dahdit
dahdahdah
di’dahdahdit
dahdahdi’dah
di’dahdit
di’di’dit
dah
di’di’dah
di’di’di’dah
di’dahdah
K
L
M
dahdi’dah
di’dahdi’dit
dahdah
X
Y
Z
dahdi’di’dah
dahdi’dahdah
dahdahdi’dit
72 Silicon Chip
1
2
3
4
5
6
7
8
9
0
di’dahdahdahdah
di’di’dahdahdah
di’di’di’dahdah
di’di’di’di’dah
di’di’di’di’dit
dahdi’di’di’dit
dahdahdi’di’dit
dahdahdahdi’dit
dahdahdahdahdit
dahdahdahdahdah
di'dahdi'dahdi'dah
dahdahdi'di'dahdah
error di’di’di’di’di’di’di’dit
.
,
Fig.3 (left): you can
photocopy and glue the
front panel artwork to
the lid of your Morse
Clock. It also makes a
great drilling template.
Fig.5 (right) is the samesize PC board pattern.
SILICON
CHIP
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
1
2
3
4
5
6
7
8
9
0
minute setting is unchanged. If the
minutes are set to an illegal number,
that is over 59, they are reset to zero
and start again. Each time a minute
is incremented the internal seconds
counter is reset to zero. In this way
you can accurately set the time by
using a reference clock with a
second hand. Increment the min
utes up to 1 less than the amount
required, and select the desired
minute at the moment the second
hand reaches 12 on the reference
clock.
Obviously, setting the time will
be easier if you select a time just
after an hour has passed.
8. Pressing the TIME button
again will return you to the hourly
chime function. Pressing both but
tons at any stage during program
mode will store the settings, exit
from program mode, sound the
letters OK and return to normal
mode.
Software
For those who program their own
PICs, there are two files available for
downloading from the SILICON CHIP
website.
The files are MORSECLK.ASM and
MORSECLK.HEX, both zipped into a
single file, morseclk.zip. While you
do not need the ASM file to program
the PIC, it will be of interest to those
who dabble in programming. It is
always interesting to see how some
body else did it and maybe pick up
a trick or two.
The program runs in a small main
loop that monitors the buttons for a
press and also checks if the hour is
up to chime the time. Each 20ms, an
internal interrupt occurs that forces
the PIC to update the time registers
in the interrupt routine. The rest of
the code looks after the sounding of
the dots and dashes and setting the
various functions.
Have fun and hopefully your clock
will prove both as well as being a
novelty.
While Morse code may be some
what outdated in the modern tele
communications world, it still holds
a certain fascination and throughout
its history has served us well in both
SC
peace and war.
With one of these . . .
...you could
have one of
these in about
1 HOUR!
Introducing The Quick Circuit 5000
If you want fast, no-fuss PC-board prototypes, take a look at the Quick Circuit
5000. This PC-controlled milling machine reads the standard files generated by
popular PC design packages and mills away the copper on the board to produce the
tracks. It then drills the holes and cuts out the finished product. You can go from
design to finished product in about one hour – without using any messy chemicals.
Check out the November 2000 issue of SILICON CHIP for a full review
Phone SATCAM on (02) 9807
SC 7081 or email satcam<at>ozemail.com.au
December 2000 73
|