This is only a preview of the January 2016 issue of Silicon Chip. You can view 39 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 "Raspberry Pi Temperature/Humidity/Pressure Monitor Pt.1":
Items relevant to "Valve Stereo Preamplifier For HiFi Systems":
Items relevant to "High Visibility 6-Digit LED GPS Clock, Pt.2":
Items relevant to "Reduce Rear-End Collision Risk With The QuickBrake":
Items relevant to "Handy Reactance Wallchart":
Purchase a printed copy of this issue for $10.00. |
High-visibility 6-digit
LED GPS clock; Pt.2
Last month we introduced our GPS high-visibility 6-digit LED clock.
But we should emphasise its main feature: it automatically changes
time zones as you travel around the country; important if you are
cruising the world on a yacht or just touring around the country.
This second article gives all the info to build and use the clock.
W
E’RE VERY pleased with this
clock because its big, bright
display is so eye-catching and can
be viewed from quite some distance
away. It also has quite a few features
beyond just displaying the time, as will
become apparent when you read the
operating instructions below.
Last month, we mentioned that you
can use a module with RS-232 signalling but that TTL is preferred. Modules
with RS-232 signalling have a bipolar
voltage swing on their serial port pins
of between ±3V and ±15V. This allows
longer cable runs and improves noise
immunity.
But with the module only a few centimetres away from the microcontrol36 Silicon Chip
ler this is unnecessary and only complicates interfacing. As a result, many
GPS modules simply use a 0-3.3V (or
thereabouts) swing, ie, TTL levels and
the signals are inverted too.
You may get a better deal on an RS232 module and in this case you can
simply wire a resistor of say 4.7kΩ10kΩ between the GPS module’s TX
line and the clock’s RX pin. The microcontroller’s internal clamp diodes
will then limit the applied voltage to
a safe level.
This works despite the signal inversion because if the clock detects gibberish from the GPS module, it tries inverting the signal level. If that doesn’t
work, it will also try various baud rates
from 2400 bps up to 115,200 bps with
both inverted and non-inverted sense
until it detects valid NMEA data. The
most common rates of 4800 and 9600
baud are tried first.
By the way, GPS modules are now
becoming available with GLONASS
support. GLONASS is a GPS competitor built by Russia and modules which
support this will typically work better
indoors or in poor signal areas because
they have access to more satellites –
in other words, they can use both GPS
and GLONASS satellites to get a fix.
Last month we mentioned that the
u-blox Neo-6M is available for around
US$10.42 but you might also want to
consider the Neo-7M for around $20
siliconchip.com.au
Scale: 1mm on diagram = 3mm (⅓ actual size)
341mm
Top
(rear)
(bottom)
Left
Back
217mm
(rear)
(rear)
Bottom
(rear)
Front
By Nicholas Vinen
Right
(bottom)
Fig.4: this diagram shows how the single sheet of 350 x 225mm (or larger)
acrylic is cut up into the six large pieces and six smaller pieces that are then
glued together to form the case. Cutting takes about five minutes. The case
includes slots for wall-hanging and some holes to make the piezo sound louder.
for the presence of the 32kHz signal
on pin 11 of IC1. If that’s missing, it
may be that one of the leads of crystal
X1 is shorted to the case or some other
adjacent metalwork.
If a GPS module is detected, the
unit will indicate that it is waiting
for a position fix by showing “GPS”
on the display, along with a progress
display. Otherwise, the clock will flash
“12:00:00” until you set the date and
time (see below for information on
how to do this). Assuming it’s working,
you can move on to making the case.
Assembling the case
Fig.5: the front of the case with the left and right panels already in place and the
top and bottom about to be glued. The red shaded areas show where adhesive
would need to be applied for the top panel to be glued although as stated in the
text, you could apply adhesive to only the top piece as long it’s applied to all the
faces that will contact the shaded ones. Note carefully the hole positions in the
four surrounding panels so that you glue them with the correct configuration.
which is very similar to the 6M but
also has GLONASS support.
We should point out that like most
other modules, both the Neo-6M and
Neo-7M come with ceramic patch antennas but these are external antennas connected via a short cable. This
means you could in theory connect it
to a larger external antenna.
Testing
There isn’t much to testing the
clock. The simplest method is to power it up briefly. There might be a short
siliconchip.com.au
delay (of no more than a few seconds)
while the supercap charges up but it
should then immediately perform a
display test where each segment on all
the digits lights up in turn and then the
piezo buzzer will sound a 100ms beep.
If that doesn’t happen after a few
seconds, switch off and check for faults
such as incorrectly installed components or bad solder joints. You can also
check that the output voltages of REG1,
REG2 and REG3 are correct.
After the test procedure, IC1 will
fire up its 32kHz oscillator. If you get
the digit test but nothing else, check
The case is made from a single piece
of clear or tinted acrylic which starts
out at 350 x 225mm and is laser-cut
into six large pieces plus a number of
smaller pieces, which are then glued
together. The back is not glued on; it’s
held with four self-tapping screws so
that it can be removed to allow access
to the PCB module for maintenance.
The cutting pattern is shown in Fig.4.
If you have a laser cutter, or access
to one, you can download this pattern
from the SILICON CHIP website in DXF
or SVG format (free for subscribers)
and cut it yourself. With a 50W laser,
we used settings of 8mm/second at
80% power. We can also supply precut case kits from our online shop,
together with the PCBs, programmed
microcontrollers and some of the
7-segment displays.
You can use clear acrylic, as shown
January 2016 37
This view shows the completed clock PCB from the rear. The PCB is held in position by the two small centre pieces that
mount at right angles to the rear panel (see Fig.6).
on our prototype or acrylic tinted with
a colour that matches the displays (ie,
green, blue, red, etc). You will see more
of the workings of the clock with the
clear case but the tinted case may provide better contrast for the display. The
clear case is suited to any display colour whereas a tinted case will need to
match the display colour used.
The case is glued using a special
solvent-based adhesive that makes
very strong bonds between pieces of
acrylic. You could use cyanoacrylate
(super glue) in a pinch but we can’t
guarantee that the result would last.
We used SciGrip Weld-On 16, fastsetting “clear, medium-bodied solvent
cement”. It states on the label that it’s
suited for Butyrate, Polycarbonate,
Styrene and Acrylics. You are unlikely
to find this type of adhesive in a hardware store but should be able to get
it from a plastic supplier. Ours came
from Plastix [Sydney: (02) 9567 4261,
Northern Beaches: (02) 9939 0555].
This forms a strong bond quickly
so you have about a minute to apply
the adhesive to the pieces to be mated,
press them together and get them lined
up properly. Full strength is achieved
after about 24 hours however it sets
well enough to manipulate the pieces
after about 10-15 minutes.
The bond is clear but you don’t want
to get excess adhesive on the material
as it will affect the surface finish and
you definitely don’t want to drip it
on the front face. It tends to get a bit
“stringy” (sort of like melted mozzarella) after coming on contact with the
38 Silicon Chip
acrylic. Keep a clean (disposable) rag
on hand to mop up any excess adhesive. Also make sure you have a large,
clean, flat surface to lay the pieces
down on, eg, lay down some sheets of
plain paper on your workbench.
Gluing the pieces
The front section (ie, where the display will be seen) can be identified by
the four 5mm holes for the colon LEDs.
Four more sections are glued to this
to form an open box. These sections
must be fitted with a specific orientation so before gluing them, put them
together loosely to make sure you have
the right pieces and understand the required orientations.
Start the assembly by gluing the top,
bottom and side pieces to the front
panel as shown in Fig.5. Note that the
front panel does not have mirror symmetry, so be sure to orientate it so that
the LED colons will slant in the correct
direction. The other pieces can then be
laid out around the front panel in the
correct orientations before you start
gluing any pieces.
That done, start with one of the
smaller left or right end panels. When
gluing these pieces, you will need to
coat all the mating surfaces with a
decent amount of adhesive to make
sure the bonds are good. An example
is shown in Fig.5 for gluing the top
panel; the areas shaded red are where
adhesive would need to be applied, assuming the left and right panels were
already in place.
Note that you could coat just the sur-
faces of the panel being introduced to
the assembly each time – you would
need to apply adhesive to this which
would mate with the red surfaces
shown on the other pieces (which
would have been difficult to depict
from this angle).
Glue the first panel, then wait a
few minutes for the adhesive to make
a decent bond before moving on to
one of the adjoining panels. Repeat
until all four sides are in place, then
quickly drop the rear panel into place
(being careful not to get any glue on
it) to check that everything is nice
and square and nothing will foul the
rear panel once the adhesive finishes
curing.
The next step is to glue six small
pieces to the rear panel, as shown
in Fig.6. The trick is to use enough
adhesive to give a good strong bond
without the excess spreading out too
much. You also need to be careful to
make sure each piece is glued exactly
perpendicular to the rear panel. Check
that the four pieces which have holes
in them are not angled out towards
the edge of the panel as they must
slot inside the top and bottom pieces
of the case.
You can check this once the six pieces are in place and the adhesive has
started to set; gently drop the rear panel into place and then remove to set.
It’s best to leave the pieces overnight
so the bonds achieve full strength. You
can then introduce the PCB assembly
into the case. Hold it at an angle and
slide the DC socket and pushbutton
siliconchip.com.au
Fig.6: the six smaller pieces are glued into the rear panel. Be sure to use
sufficient adhesive to form strong bonds. The four upper & lower pieces with
holes are used to hold the back onto the case and by extension hold the case and
whole assembly to the wall. The two smaller pieces glued in the middle press
the PCB assembly up against the front of the case. The rear panel is symmetrical
so the parts can be glued to either side as long as they’re all on the same side.
into one side of the case, then rotate
it until the 7-segment displays rest on
the inside of the front panel.
The rear panel can then be attached
using four 4GA self-tapping screws
through the holes in the top and bottom that bite into the parts glued into
the rear panel earlier. The basic idea
is shown in Fig.7.
For desk use, fit a small rubber foot
to each corner at the bottom. For wall
mounting, two screws placed 200mm
apart will fit into the slots on the back.
The heads must be between 4mm and
9.5mm in diameter. Most small wood
screws should fit; check before screwing them into the wall. Don’t hang it
until the adhesive has achieved full
strength.
LDR calibration
Once the unit is in place and powered up, calibrating the LDR is simple. Shine a bright light on the LDR
for a few seconds (eg, a torch), then
cover the unit up for a few seconds
(eg, with a pillow case) to block out
all light – or simply place it in a dark
room and turn the lights off. The unit
will automatically record the highest
and lowest values read and adjust its
calibration to suit.
GPS time acquisition
If there is no GPS module fitted, by
default the unit will power up showing
a flashing “12:00:00” display, waiting
for the time and date to be set, as explained below. However, if a GPS unit
is detected, the display will change to
siliconchip.com.au
Fig.7: this shows the two halves of the case being put together; machine screws
are shown however we recommend you use No.4 self-tapping screws. Be gentle
when cutting the threads initially; if any of the smaller pieces break off during
this process you will have to re-glue them and wait for the adhesive to set again.
“GPS 00”. As satellites are picked up,
the number will be updated to show
how many are “seen”. If the unit has
a 1PPS output, the decimal point after
“GPS” will flash in time with it, until
a GPS lock is acquired.
Once the unit has a GPS fix (latitute/
longitude), the display will change to
“GPS FI”. It will then wait to receive
valid date/time information, at which
point the display will change to “GPS
SE” as it searches for valid time zone
data based on that information. Once
the data is found, the display will
change to show the local time.
If GPS fix is lost, the unit will fall
back on its 32.768kHz crystal for timekeeping. After several minutes, the display will start pulsating (ie, varying in
brightness over time) to indicate that
it is no longer 100% accurate. If a GPS
fix is re-acquired, the time is updated
and it stops pulsating.
Setting up the IR remote
By default, the clock is set to respond to infrared remote commands
from an Altronics/DynaLink A1012
learning remote on TV code 170. The
default mapping is shown in Fig.8.
The various functions indicated are
described below.
We’ve chosen this remote because
it’s relatively inexpensive, easy to get,
looks good and has all the buttons
needed for this project. Having said
that, just about any universal remote
control can be used, including Jaycar’s
Cat. AR1719.
Whichever remote you use, it just
January 2016 39
ESCAPE/
EXIT MENU
SHOW
DATE
ESCAPE
DATED
CNTUP
START TIMER
(COUNT UP)
START TIMER
(COUNT DOWN)
CNTDN
ENTER MENU,
SELECT ITEM
TV
SAT
CD
VCR
DVD
AUX
1
2
3
4
5
6
7
8
9
AV
0
-/--
+
−
CH SET VOL
+
−
ENTER
TIMES &
NUMBERS
NUM
NUM
NUM
NUM
NUM
0,
2,
4,
6,
8,
NUM
NUM
NUM
NUM
NUM
1,
3,
5,
7,
9
ADJUST
BRIGHTNESS
BRI UP,
BRI DN
NAVIGATE
MENU, MOVE
CURSOR
UP, DOWN,
LEFT, RIGHT
SELECT
OK
LEARN
MENU
ALA ON
TURN ALARMS
ON/OFF
TIMER
PAUSE
TIPAU
DISPON
DISPLAY
ON/OFF
EXIT
TIMER LOSE
ONE MINUTE
TISUB
TIMER
SPLIT/LAP
TILAP
TIMER ADD
ONE MINUTE
TIADD
TIMER
RESUME
TIRES
DYNALINK
LINK
Fig.8: the default button mapping on
the Altronics DynaLink A1012 remote
control set to TV code 170. Other
remotes can be used but you may have
to program the button codes into the
clock, as described in the text. If so,
use this as a guide as to which buttons
to map to which functions. The button
function names displayed on the clock
during set-up are shown in blue on
this diagram.
needs to be set up to produce Philips
RC5 or NEC-compatible infrared commands. To check this, point the remote
at the clock and press the buttons. You
may need to guess at some appropriate code settings first (eg, Philips TVs).
Check the manual supplied with the
remote.
If it’s producing commands that the
clock can receive, the last decimal
point on the display will flash. While
many different modes will produce
some valid commands, you may need
to try several different codes before
you find one where all the buttons
you need actually work. Refer to Fig.8
for guidance but note that the button
mapping for your remote doesn’t need
to match exactly (ie, your remote may
not have an identical button layout).
40 Silicon Chip
Once you have decided which remote to use and the setting to use it
on, power up the clock and put it in
IR set-up mode by holding down the
buttons on either side of the clock simultaneously for several seconds. The
display will show “IR SET”. Release
the buttons, then press the right-side
button to continue.
The display will flash “NUM 0”, indicating the button code that is to be
set. Hold down the “0” button on your
remote control for a second or two.
It will then briefly show the remote
code received and then the display
will switch to flashing “NUM 1”. Repeat this procedure for the remaining
buttons. The codes corresponding to
each button are shown in Fig.8.
If at any point you make a mistake,
you can go back and reset the previous button code by pressing the lefthand pushbutton on the clock. If you
don’t want to assign a button to an IR
code, press the righthand pushbutton
to skip that one.
Once you have set all the codes,
“IR FIN” will be shown. You can then
press the right-hand button on the
clock to go back to normal operation
or the left button if you need to change
a code first.
If necessary, buttons can be re-assigned later, using the “CHANGE” option in the “IR” menu. Menu operation
is described below.
Setting the time & date
This is only necessary if you haven’t
fitted a GPS module. Press the OK button on the remote control and then
press the down button until the display shows “SETDA”. Press OK; the
display will then show “010116” representing 1st January 2016 (assuming
your date format is set to the default
of DDMMYY). Use the keypad on the
remote control to enter the correct date
then press the select button.
You can then go back into the menu
and select “SETTI”. It will change to
show “000000” representing midnight
(HHMMSS). Check the current time,
then enter what the time will be in a
minute or two, in 24-hour notation
using the keypad – but don’t put in
the last digit yet. Do that the instant
that the reference clock matches the
time entered.
This same procedure can be used to
change the time or date at a later stage.
Note that you can also use the up/
down/left/right arrows to change the
time and date, however it’s easier to
use the numeric buttons. If necessary,
you can set the time and date without
a remote; see the “Operating without
a remote” section below.
If you want the clock to make daylight saving time (DST) changes automatically without a GPS module, you
will also need to tell it which time
zone you are in. This can be done before or after setting the time. Press the
OK button on the remote control and
then press the down button until the
display shows “SETTZ”. Press OK,
then refer to Table 1 and choose the
appropriate zone using the up/down.
Press OK to confirm.
The default is “NONE” in which
case no time zone calculations are
done. If a time zone is selected which
has no DST rules (as per Table 1), this
will not have any obvious effect, except that changing to a different time
zone will then change the time to suit
that location. If a time zone with daylight savings rules is selected, those
rules will be obeyed and the clock will
automatically change the displayed
time when appropriate.
It’s possible to override the DST
rules, should they change after this
article is published, or if an error is
found; we explain how to do that later
in this article.
Showing the date
Once set, the clock normally displays the time. The date can be shown
with a quick press of either button on
the clock itself or by pressing the show
date button (usually mute) on the remote control. It will be displayed for
five seconds with decimal points separating the day/month/year, then the
unit will switch back to time display.
Display brightness
Hold down the volume+ or volume–
buttons on the remote control to vary
the display brightness. Auto-dimming
continues to operate, if configured. For
example, if you’ve set the brightness to
50% and the auto-dim is at 50% then
the overall display brightness will be
25% of maximum.
Menu system
The time setting description above
involved entering the menu to access
the “SETDA”, “SETTI” and “SETTZ”
options. The full menu tree is shown
in Fig.9. The top level menu, shown
in the blue boxes at the left, is acsiliconchip.com.au
(Mon-Fri) (Sat,Sun)
ALARM
ALA ON
global
on/off
OPTS
MON
TUE
WED
PM
LZB
12/24 AM/PM Leading
hour decimal zero
mode
point blanking
select
on/off
DISP
CHANGE
Show
received
IR codes
NUM 0
NUM 1
DISPON
SETDA (no GPS)
FRI
SAT
WD
SUN
WD
WE
WD
ALL
on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set on/ set
off
off
off
off
off
off
off
off
off
off
24 HR
IR
THU
COL
DDMYY
XTAL
DIM
Set colon
on/off/
flash or
decimal
point
on/flash
Set
date
format
32kHz
trim
set
BRIGHT
LLIM
Set
IR code
Set
IR code
Set
IR code
ULIM
MINBR
PIEZO
Set manual
brightness %
Set LDR
upper limit %
Set LDR
lower limit %
Set dimming
mininmum
brightness %
DURA
HZ
DUTY
CADENC
Set alarm
buzzer duration
Set alarm
buzzer pulse rate
Set alarm
buzzer duty cycle
Set alarm
buzzer cadence
Use up/down buttons to cycle through menu items;
OK/Enter (SELECT) to descent into sub-menus or select current menu item;
power/standby (ESCAPE) button to return to previous menu or exit.
Set date
CURTZ
CHA TZ (GPS)
TZNAM
LATIT
LONGIT
N SAT
OFFSET
DAYDEL
DAYRUL
Show
Show
Show
Show
Show Show/set Show/set Show/set
detected detected latitude longitude number time zone
DST
DST rules
timezone timezone from GPS from GPS satellites offset in delta in (refer to
ID
name
receiver receiver detected hh:mm
minutes Table 1)
SETTI (no GPS)
Set time
STAMO STAWE STADAY STA HR ENDMO ENDWE ENDDAY END HR DSMOD
Set
time Show/set Show/set Show/set Show/set Show/set Show/set Show/set Show/set Show/set
DST
DST
DST
DST
DST
DST
DST
DST
DST
zone
start
start
start
end
end
end
end
mode
(from Table 1 start
week
day
hour
month
week
day
hour
or auto.) month
CHADST (GPS)
SETTZ
Fig.9: this shows the complete menu tree for the clock. The main menu is shown in blue on the left; two of the options
vary depending on whether a GPS module has been detected or not. Sub-menu options are shown in mauve with
their sub-menus shown in green. Pressing the OK/select button activates the function indicated for each menu item,
allowing that parameter to be viewed or set. The escape (on/off) button goes out of the current menu and back to the
parent, or in the case of the main menu, back to the regular time display.
cessed by pressing the OK button on
the remote (or via the pushbuttons, as
described later). Up and down scroll
through the list.
Each additional “level” of the menu
is shown in a different colour and is
accessed by pressing OK on its “parent” entry. Similarly, pressing the escape button (normally the power on/
off button on the remote) will take you
back up to the parent menu or back
to the time display, if viewing the top
level menu.
Below, we’ll go through the remaining menu items and explain what they
do, as well as detailing other clock
functions accessed by different buttons on the remote.
Operating without a remote
The menu system can also be accessed without a remote, using the
pushbuttons on the unit. Hold down
the right pushbutton for at least one
siliconchip.com.au
second and release it to enter the
menu. Pressing the left button is then
equivalent to the up button on the remote while pressing the right button
is equivalent to down. These then let
you scroll through the menus.
To escape from a menu, hold down
the left button for at least one second
and release. To select an item, hold
down the right pushbutton for at least
one second and release. When you
need to enter a numeric value (eg, setting the time), short presses of each
button will increment or decrement
the currently selected digit.
Holding down the right button for at
least one second will cycle to the next
digit. Holding down the left button for
at least one second will save changes
and return to the previous menu item.
Holding down both buttons together
and then releasing will abort changing that value.
In this manner, you can operate
the menus without the remote. The
buttons can also be used to show the
date. However, note that many other
functions are not available without a
remote, such as timer modes and so
on. Basically, the unit is designed to
be used with a remote and the button
functions are a fall-back, primarily intended for applications where it’s used
purely as a clock.
Setting the alarm
Normally, the right-most decimal
point on the clock shows the global
alarm status. If on, the alarm is set to
go off at least once in the coming week.
It’s dim if there is no alarm set in the
next 24 hours or bright if there is.
To set the alarm, enter the ALARM
menu. You will see either “ALA ON”
or “ALAOFF”, indicating the global
alarm on/off status. Press either OK
or the record (ALA ON) button on the
remote to toggle it. The ALA ON butJanuary 2016 41
Fig.10(a-d): this series of images shows the complete global land mass coverage of the time zone data programmed into the
clock. There are 128 separate shaded areas, mapped to 73 different time zones, each with different UTC/GMT offsets and
daylight savings rules. You can download the data from our website and map it onto Google Earth to inspect or modify it.
Note that many zones overlap which has been done to reduce the compressed size of the data set; see text for more details.
ton will also work when the clock is
showing the time, as a quick and easy
way to enable or disable the alarm.
Cycle through the next seven menu
entries to turn the alarm on or off for an
individual day, or set the time for that
day (in 24-hour format). The record
button is used to toggle that day’s on/
off status while select can be pressed
to set the alarm time, similarly to the
way the clock’s own time is set as described above.
You will also find menu entries
for “WD” (weekdays), “WE” (weekend days) and “ALL”. Changing the
on/off status or time for any of these
entries affects multiple alarms, ie,
Monday-Friday for “WD”, Saturday-Sunday for “WE” and MondaySunday for “ALL”. They can still
be individually changed after that.
When finished setting alarm times,
keep pressing on/off to exit the menus
and return to the clock display.
When the alarm goes off, briefly
press either pushbutton or the Escape
button on the remote for a 5-minute
snooze. A long (1s+) press of either
pushbutton or a second press of the
Escape button will cancel it altogether.
Using the clock as a timer
The clock can count time upwards
starting at zero (eg, to measure how
long something takes) or downwards
to zero (eg, to alert you when a certain
amount of time has passed). It also
has stopwatch type functions such as
a lap counter. It counts with 1/100th
second resolution for times less than
one hour, 1/10th second resolution
up to 10 hours, one second resolution
for up to 100 hours and with further
42 Silicon Chip
reduced resolution up to 1000 days.
Since infrared commands normally
take the same amount of time to transmit, receive and decode, the timing
should be pretty accurate, to within a
few hundredths of a second. However,
since there’s no guarantee an infrared
command will be received without corruption, you will need to hold down
the button to start the timer reliably
which could result in it sometimes being off by a fraction of a second.
There are three basic modes: count
up with no limit, count up until a specific time is reached, or count down
from a specific time to zero. When the
limit is reached (either counting up
or counting down), the piezo buzzer
sounds, although this can be turned
off if desired. Counting can be paused
and the counter can have one minute
added or subtracted while it’s running.
Starting the timer
Press the channel+ button and the
timer will start counting up from zero.
You can tell the timer and not the clock
is running since the colon LEDs switch
off and the decimal points flash instead. Press the pause button to pause
the timer; the display will freeze and
flash. Press the play button to resume.
If you press the stop button, the display will freeze and flash but it will
show the time for the last lap; ie, since
the timer started for the first lap, or
since the last time you pressed this
button for subsequent laps. Press the
play button to go back to the normal
timer display. Pressing fast forward or
rewind will add or subtract one minute from the displayed time.
Hold down the on/off button for a
second or so to abort timer mode and
go back to the normal clock display.
If you want to count up to a specific
time, press one of the numeric buttons
or up/down immediately after pressing channel+ (within a few seconds).
Enter the time to count up to (in a similar manner to setting the time), with
a maximum of 23 hours, 59 minutes
and 59 seconds. Once you’ve entered
the time, press select to start counting.
In this mode, the fast forward and
rewind buttons change the target time
by one minute; it will be briefly displayed when they are pressed, then it
will go back to showing the timer. Also,
when counting up to a target time, the
last decimal point on the display indicates whether the buzzer will sound
when the target is reached (by default,
it’s on). Press the record (alarm on/off)
button on the remote to toggle it while
in this mode.
Press the channel- (CNTDN) button to initiate counting down. The
procedure is essentially identical to
counting up, except that you are always prompted to set the initial time,
using the same method as described
above. Essentially, this mode is identical to counting up towards a target
time, except for the fact that the timer
starts at the set time instead and counts
down to zero.
Changing options
There are a number of options which
can be changed through the “OPTS”
menu. Once an option is displayed,
use the OK button to change it. Numeric values can be changed using
the up/down/left/right buttons or, in
some cases, the numeric keypad on
siliconchip.com.au
the remote. The options are:
(1) 12/24 hour time: the display shows either “12 HRS” or “24 HRS”. The hours
are shown as 01-12 in 12-hour mode
or 00-23 in 24-hour mode.
(2) Leading zero blanking: the display
shows either “LZB ON” or “LZBOFF”.
Press select to toggle between them.
Applies only to the first digit on the
display, ie, 3pm will be shown as
“3:00:00” with leading zero blanking
enabled or “03:00:00” with it disabled.
This would normally be disabled in
24 hour mode but you can enable it
if you wish.
(3) Hours/minutes/seconds separator in
time display: there are five options:
“COLFLA” (colons flash at 1Hz; default), “COL ON” (colons on permanently), “COLOFF” (colons off permanently), “DP ON”, (decimal points
on instead of colons) and “DP FLA”
(decimal points flash instead).
(4) Dimming sub-menu: each entry allows you to set a value between 0%
and 100%.
“BRIGHT” is the current manually displayed brightness setting. It
also changes when the volume+ and
volume- buttons are pressed.
“ULIM” is the percentage of ambient brightness where the display starts
to dim automatically. For example, if
set to the default of 75%, the display
will be at full brightness between 75%
and 100% ambient but will dim below
75% ambient. Set it to 0% to disable
auto-dimming.
“LLIM” is the percentage of ambient
brightness where the display reaches
minimum brightness. It will not dim
further as the ambient light level falls
below. The default is 10%.
“MINBR” is the display brightness
achieved at the lower ambient limit.
Setting this to zero means the display
will turn off entirely at the lower amsiliconchip.com.au
bient limit. The default is 25%.
(5) Piezo buzzer sub-menu: this determines the sound the piezo makes when
the alarm goes off or the timer expires.
The duration setting is from 0-900
seconds (0 seconds = off, default = 10s).
Hz indicates the frequency of the
pulses from the piezo between 1 and
10Hz (default = 2Hz). Duty is the duty
cycle from 1-100% (default = 50%).
Each of these can be set by pressing
select, then either up/down or using
the numeric buttons to enter a value.
Cadence lets you enter three pairs
of duration/pause values as a 6-digit
number. The default is 100000 which
gives an even series of pulses from
the piezo at the selected frequency
but, for example, a setting of 113200,
in combination with a 2Hz frequency,
would give a 0.5s beep, followed by a
0.5s pause, followed by a 1.5s beep,
followed by a 1s pause, with this pattern repeating.
(6) Date format: this defaults to “DDMYY” as is used in Australia. The other
options are “MDDYY” or “YYMDD”;
affects both date display and setting.
Changing infrared codes
The infrared menu, labelled “IR”
has two sub-menu options: “DISP”
and “CHANGE”. If “DISP” is selected,
the unit shows the Philips RC5 or NEC
code for any button pressed on the remote. Press either pushbutton on the
clock itself to exit this mode.
If “CHANGE” is selected, you can
then select any of the remote button
functions (as shown in Fig.8) using up
and down and re-program it by pressing OK. The procedure is similar to that
described in the initial set-up above.
Use the left pushbutton on the clock
to abort and leave that code as it is or
the right pushbutton to de-assign the
existing infrared code for that button
and disable it (until a new code is set).
Time zone/daylight saving data
As mentioned last month, the clock
incorporates geographic data, time
zone data and daylight savings data
which allows it to determine the correct local time virtually anywhere on
Earth’s land mass with just the output
of a GPS module. The geographic data
is shown in Fig.10, plotted on top of
the Earth’s surface. Each coloured region represents a different time zone.
You may notice that many of the
boundaries seem rather sloppy; this
is done on purpose as borders defined
Last Minute Extras
(1) To calibrate the 32kHz crystal, set
the XTAL menu option to between -512
(260ppm slower than default) and +511
(260ppm faster). This is adjusted automatically when a GPS module with a 1pps
output is used.
(2) The unit can show the day of the week.
Simply activate the date display function,
then press the same button again.
(3) A new menu item, “GPSLCK”, has been
added to the options menu. If set to “IGNORE”, the unit will use GPS time even
if the satellite fix is not perfect. This will
allow the unit to work in marginal signal
areas although time accuracy may not be
quite as good.
(4) A new brightness menu item, “CUR
RD”, shows the minimum/current/maximum raw LDR readings in 8-bit hexadecimal notation. The fourth digit decimal point
lights when the data is going to be saved
to flash memory and goes out once it’s
saved. This can be used to troubleshoot
the autodim function.
with fewer points take up less flash
memory. Basically, where two time
zones meet (eg, at the border of two
countries), we accurately define one
border, which is often defined by a river
or mountain range and thus has many
wiggles – often requiring thousands of
co-ordinates to define.
When we check whether your current location is within that time zone
with the well-defined border, and the
result is a negative, we don’t need the
border for the adjoining zone to be
defined with such precision since we
already know that if you are near the
border, you are on the other side of it,
by a process of exclusion.
As you can see, the data involved
is substantial and it takes up about
150KB, even after a specially designed
compression algorithm has been applied. If you’re interested in more details, see the panel on pages 34 and
35 of the Feburary 2015 issue of SILICON CHIP.
Time zone data updates
We’ve made a substantial effort to
provide up-to-date time zone geographical data and daylight savings
rules in the firmware for the clock.
However, the rules are very complex
and vary drastically between different
locations. They also change over time,
January 2016 43
Table 1: Time Zones & DST Rules
Display
Details
Offset
DST Rules
AU EAS
AU QLD
AU SA
AU NT
AU WA
AU EUC
AU LHI
AU COC
AUMAC
NZ NZ
NZ CHA
INTHAI
JAPKOR
FIJI
USA HI
USA AK
NA WE
NA MO
ARIZON
NA CEN
NA EAS
ASAMO
SA BOL
CAN NL
CAN NB
PERU
CAN SK
EUWES
EU IS
EU UK
EU EAS
EUMOS
AS NKO
AS BAN
AS NEP
RUWES
AFMOR
AF ALG
AF LIB
AF EGY
AFNAM
AF AZO
AFMAU
IRAN
AFGHAN
ISRAEL
GAZA S
JORLEB
SA SEB
SA NEB
SA PAR
BRAZIL
SA URA
SA VEN
MEXBJC
MEX W
MEX YU
MEX EA
RU EAS
GEORGI
INDIAS
MONGO
GRQAAN
GREENL
ATLSSI
PA BAK
PASAM
PA TON
PA KIR
FR PON
PAMAR
PAGAM
PAPITC
NSW, Vic, Tas
Queensland, PNG
South Australia
Northern Territory
Western Australia
Eucla
Lord Howe Island
Cocos Islands
Macquarie Island
New Zealand
Chatham Island
Indonesia/Thailand
Japan/Korea/Palau
Fiji
Hawaii
Alaska
USA/Canada West
USA Mountain
Arizona
USA Central
USA Eastern
American Samoa
Bolivia, Eastern Quebec
Newfoundland
New Brunswick
Peru, Ecuador, etc
Saskatchewan
Western Europe
Iceland
United Kingdom
Eastern Europe
Moscow
North Korea
Bangladesh
Nepal
Western Russia
Morocco
Algeria, Tunisia
Libya
Egypt
Namibia
Azores
Mauritius
Iran
Afghanistan
Israel
Gaza Strip/West Bank
Jordan, Lebanon
South-east Brazil
North-east Brazil
Paraguay
Rest of Brazil
Uruguay
Venezuela
Baja California
Western Mexico
Yucatan
Eastern Mexico
Eastern Russia
Georgia, Armenia
India, Sri Lanka
Mongolia
Qaanaaq, Greenland
Greenland
S. Sandwich Islands
Baker Island
Samoa
Tonga, Tokelau
Kiribati, Line Islands
French Polynesia
Marquesas Islands
Gambier Islands
Pitcairn Islands
+1000
+1000
+0930
+0930
+0800
+0845
+1030
+0630
+1100
+1200
+1245
+0700
+0900
+1200
-1000
-0900
-0800
-0700
-0700
-0600
-0500
-1100
-0400
-0330
-0400
-0500
-0600
+0100
+0000
+0000
+0200
+0300
+0830
+0600
+0545
+0500
+0000
+0100
+0200
+0200
+0100
-0100
+0400
+0330
+0430
+0200
+0200
+0200
-0300
-0300
-0400
-0400
-0300
-0430
-0800
-0700
-0500
-0600
+1200
+0400
+0530
+0800
-0400
-0300
-0200
-1200
+1300
+1300
+1400
-1000
-0930
-0900
-0800
AUST
AUST
AUST
AUST (+30)
NZ
NZ
FIJI
NTHAM
NTHAM
NTHAM
NTHAM
NTHAM
NTHAM
NTHAM
NTHAM
EURO
EURO
EURO
MOROC
EGYPT
NAMIB
EURO
IRAN
ISRAEL
PALEST
MIDEA
BRAZIL
PARAGU
BRAZIL
URUGUA
MEXIC
MEXIC
MEXIC
MEXIC
EURO
MONGO
MEXIC
GRNLND
SAMOA
-
44 Silicon Chip
so we decided there needed to be a way to keep the rules up-todate, at least for the locations that constructors occupy.
As a result, the clock has the facility for you to change the rules
for your current location. Updates are stored in the same section
of flash memory as the clock options are kept and override the
built-in rules.
There are three basic parameters for each location that can be
changed: offset from UTC (in hours and minutes), daylight savings
time shift (+0, +30 or +60 minutes) and daylight savings rules. The
menus that provide these options also offer some information regarding the currently detected time zone and GPS module status.
There are 19 different sets of daylight savings rules, listed in
Table 1 under “DST Rules”. Table 1 also shows which set of rules
is used by default in each location. The time zone menu allows
you to change the setting for your current location to one of the
other rules, including disabling daylight saving for a zone which
previously used it, or enabling it for one which did not.
To change these options for your location, go into the “CHA TZ”
menu (which appears when the unit has a GPS fix). The first five
menu items simply show information; press OK to display that particular parameter and then escape (on/off) to go back to the menu.
Of the remaining three, “OFFSET” allows you to change the difference in hours and minutes between UTC/GMT and your time
zone. This can be set anywhere from 22 hours before UTC to 22
hours after UTC in 15 minute intervals, although few locations
use offsets of more than 12 hours from UTC.
“DAYDEL” allows you to select how much the time changes
when daylight saving starts and ends. This will almost always be
one hour (60 minutes) although there is one location, Lord Howe
Island, which has a half hour (30 minute) DST delta. To disable
daylight saving in your location, you can either set this to zero
or change the DST rule to “NONE”.
“DAYRUL” allows you to select the DST rules for your location. These rules define which hour of which day DST starts and
ends in a given year.
Changing DST rules
Since these rules can also change, there is a separate menu
called “CHADST” to change them. There are nine DST settings
for each rule, represented by nine menu items, of which four define when it starts and four when it ends. The ninth determines
how these are interpreted.
The most common mode, used by the vast majority of locations, is “HDWM” which stands for “hour, day, week of month”.
For example, in Australia at the time of writing, daylight saving starts at 2am on the first Sunday of October and ends at 2am
(3am DST) on the first Sunday of April.
So in this case, the mode is HWDM and the following rules
are used:
STAMO: 10 OCT
STAWE: 1ST
STADAY: SUN
STAHR: 2
FINMO: 04 APR
FINWE: 1ST
FINDAY: SUN
FINHR: 2
(In this menu, the hour values always refer to the time before
daylight saving is applied, hence FINHR is 2, not 3).
The following countries use different modes. Iran uses “EQUINO” where DST start/end dates are relative to the spring and autumn equinoxes. Brazil uses “NOCARN” which is identical to
HDWM except that DST changes are delayed by one week if they
fall during Carnaval. Similarly, “NORAM” delays DST changes if
they fall during Ramadan and “NOROSH” delays DST changes if
SC
they fall during Rosh Hashana.
siliconchip.com.au
|