This is only a preview of the December 2017 issue of Silicon Chip. You can view 38 of the 104 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 "Touchscreen Altimeter and Weather station":
Items relevant to "The Arduino MegaBox from Altronics":
Items relevant to "Build your own Super-7 AM Radio Receiver – Part 2":
Items relevant to "El Cheapo Modules 11: Pressure/Temperature Sensors":
Items relevant to "Part 3: Finishing our new 6GHz+ Digital Frequency Meter":
Purchase a printed copy of this issue for $10.00. |
6GHz+
Touchscreen
Frequency and
Period Counter
Having described our new 6GHz+ Touchscreen Frequency/Period Counter
in the first article (October) and then built and tested it (November), we
shall now show how to use it and explain what it can do. Apart from its
very wide frequency range, it offers outstanding accuracy.
Part 3: by Nicholas Vinen
A
went well, your unit should be operaa few small tweaks as the software has
ssuming you’ve managed to
tional. The rest of this article explains
been finalised.
source the components for
how to use the software and its touchThere is information shown in each
the Frequency Meter (most of
screen interface.
corner of the screen, plus the large frewhich are available from either the
quency/period display in the centre.
SILICON CHIP Online Shop or Digi-Key)
Main screen display
The frequency/period is auto-ranging
and successfully put it together, you
Pretty much all the functions of the
with frequency using units of mHz
can then program the Explore 100 with
Frequency Counter are available on
(millihertz, ie, 1/1000th of one hertz),
the software.
the one main screen, shown in Fig.5.
Hz, kHz, MHz or GHz and period havWe don’t supply the PIC32 pre-proThis is similar to the prototype screen
ing units of ps, ns, µs, ms or s.
grammed with the BASIC code beshown in the last two articles but with
You can switch between frequency
cause the Explore 100 provides a USB
and period disinterface that makes
play by touching
loading it quite easy.
the centre of the
The PIC32 which
screen.
is supplied in our ExChanging beplore 100 kit (or the
tween frequency
one from Rictech in
and period disNew Zealand) does
play does not afalready have the
fect the way the
MMBasic firmware
measurement is
loaded. So you just
being taken; both
need to connect it to
readings are calyour PC, download
culated based on
the software from
the number of
our website (free for
pulses received
subscribers) and load
from the referit into the Micromite
ence clock and
Plus chip.
the input signal
The procedures for
in a given period.
doing that, as well as
The frequency
setting up the LCD
is simply calcutouchscreen, were Fig.5: the default main screen, showing the frequency reading in large digits at
lated as Fin/Fref
given in last month’s the centre and various additional information below that, and in the corners of
while the period
article.
the display. To change the settings in the corners, it’s generally just a matter of
is Fref/Fin.
Assuming that all touching that area of the screen.
84
Silicon Chip
Celebrating 30 Years
siliconchip.com.au
Note that all settings, including this
one, are retained in Flash memory automatically so that the configuration
is retained for the next time the unit
is powered up.
Accuracy and precision
estimate display
Another indication of reading accuracy is the fact that the last couple of
decimal places in the reading may be
dimmed, indicating that they have a
degree of uncertainty and even with
a stable signal, you may see these digits fluctuate. If averaging is active then
over time, the reading will become
more certain and these digits will
become lighter. With a stable signal,
white digits should be quite stable.
these update rates by touching the
update line near the lower right-hand
corner of the screen.
The update rate is independent of
the averaging setting. Say you select
30s averaging with a 2s update rate.
You will get a reading after two seconds but it will only be based on two
seconds of data.
Then you will get a reading two seconds later which will be slightly more
accurate (and the accuracy and precision figures will reflect this).
The time span over which the signal
has averaged so far is shown in parentheses ( ) at the end of the Mode line.
The reading accuracy will continue to improve until the 30-second
mark, at which point the precision
and accuracy figures will not improve.
The reading will continue to change
though, representing the average signal frequency over a time “window”
spanning the last 30 seconds.
In other words, the displayed value
is a moving average.
If the signal frequency changes, you
would have to wait 30 seconds for
the new reading to be accurate. Alternatively, you can simply touch at
the end of the Mode line, where the
averaging time so far is displayed, to
reset it to zero and start the averaging
window anew.
To change the maximum window
(ie, averaging) time, simply touch
the left side of that line instead. This
will cycle through a series of different time values from one second up
to ten minutes.
To turn averaging
off, you can keep
pressing this until
you get back to the
“immediate” setting or alternative,
to save time, hold
your finger on the
Mode line for a couple of seconds.
Regardless of what is being displayed, the precision and accuracy
estimates are shown below. Precision indicates repeatability, ie, if you
Input switching
measured the same exact signal using
the same settings on two different ocThe current input is shown in the
casions, this is the maximum differlower left-hand corner of the screen
ence you could get between the two
and you can switch inputs simply
readings.
by touching it. Make sure you press
This relates to the stability of the
far enough down the screen that you
reference oscillator and how its frearen’t pressing the Mode line above;
quency changes over time and with
changing mode will be explained
temperature.
shortly.
It’s computed based on the reference
Mode switching is simple since it
clock tolerance and measurement pejust toggles between the SMB (high
riod and shown as both the parts per
frequency) input and the BNC (low fremillion/billion error and a frequency
quency) input. If you’re using averagor period uncertainty.
ing, it will reset when changing inputs.
When using averaging, the uncerThe SMB input impedance is fixed
tainty will drop over time until it
at 50Ω but the BNC input impedance
reaches a minimum value, once the
can be switched between 75Ω and
programmed averaging time period
about 1MΩ. This can be changed simhas passed.
ply by touching that part of the Mode
The accuracy shown automatically
line when the BNC input is selected
improves quite dramatically if you’re
and like the other settings, it is reusing GPS disciplining since this will
tained even when power is lost.
allow the unit to compensate almost
Update rate and averaging
entirely for long-term drift (since GPS
timekeeping is much more stable) and
The range of update rates has been
temperature drift will also be reduced
expanded to include one update every
(but not eliminated).
three, two or one second or five times
The accuracy figure is shown in a
per second. You can cycle through
similar manner
but this also takes
into account the
initial error in the
reference oscillator frequency.
This can be reduced if you have
a more accurate
reference source
to calibrate the
TXCO.
When using
GPS disciplining,
the accuracy figure will generally match the precision figure (or
come close) since
the accuracy provided by the GPS Fig.6: a similar display but this time with the output shown as a period rather
time signal is ex- than a frequency, and with averaging enabled. Most of the operation and
interaction with the unit is done via this screen.
cellent.
siliconchip.com.au
Celebrating 30 Years
Changing the
display
brightness
To change the
LCD backlight display brightness,
press and hold your
finger on the lower
right-hand corner of
the screen, where
the current brightness percentage is
December 2017 85
displayed. While still pressing on the
screen, swipe your finger up or right to
increase the brightness, or left or down
to decrease the brightness.
Because you’re starting in the lowerright corner, it’s easiest to swipe up to
increase and left to decrease. But if you
swipe up and increase the brightness
too much, you can go either down or
left to bring it back to the desired value.
Reducing the brightness to the minimum will drop power consumption
by around 200-250mA compared to
maximum brightness. The estimated
current drawn from the DC supply for
a given configuration is shown in the
upper-left corner of the screen.
Frequency reference calibration
There are three ways to do this. The
first is the simplest but needs to be
done with the case open and requires
an accurate frequency meter. It needs
to be more accurate than the one you
are calibrating, eg, around 1ppm or
±0.0001% accuracy or better.
Measure the frequency at pin 9 of
the Explore 100 header, relative to pin
1 (ground). Then press on the TCXO
frequency at upper-left and hold your
finger down for a couple of seconds,
then lift it.
A keypad will appear and you can
enter the precise TCXO frequency in
Hz.
It will then ask you for a second
figure, the accuracy of your frequency meter, in ppb (parts per billion).
1ppm = 1000ppb = 0.0001%. This is
used to provide the estimated precision and accuracy figures when making a measurement.
If you don’t know, abort entering
this number and the default value for
an uncalibrated TCXO will be used,
but the calibration itself will still be
performed.
The new figures will be stored and
displayed but you can recalibrate again
at a later date if necessary.
The second option can be done with
the case closed and all you need is an
accurate frequency source. For example, you could use the 10MHz reference output from another piece of test
equipment.
Make sure the TCXO frequency is set
to the default value of 16.368MHz; if
not, set it using the above procedure.
Feed the signal in and measure its
frequency with reasonably long averaging (eg, one minute). Take note of the
figure shown on the screen. Let’s call it
Fmeas and the expected frequency Fexact. Now perform the following calculation, with all values in Hz:
TCXO =
16368000 x Fexact / Fmeas
You can now program the resulting
figure in as the new measured TCXO
frequency using the procedure given
above. If you know the accuracy of
your reference signal frequency, enter
that in when prompted for the “ppb”
figure (in parts per billion).
The third method is a combination
of the above two methods and requires
a stable (but not necessarily accurate)
frequency source along with an accurate frequency meter.
You simply measure the frequency
of your signal source using the accurate meter, then feed that same signal
into your newly built Frequency Meter and measure it as stated immediately above.
You can then perform the same calculation, using the figure you got from
your known-accurate meter in place
of Fexact and the figure from your new
Meter as Fmeas. As before, the accuracy (ppb) figure should reflect the accuracy of the meter you’re using for
calibration.
The upper-left corner also shows the
TCXO frequency and measured CPU
(PIC32) operating frequency.
The latter is mainly for interest’s
sake. The CPU is typically operated
at 80MHz as a compromise between
screen update speed and power consumption/stability.
The PIC32 itself is perfectly stable at
higher speeds but we saw some display
glitches when driving the touchscreen
at faster rates (the LCD bus speed is
determined by the CPU clock rate).
The TCXO specified operates at a
nominal 16.368MHz and this will be
the default value at power-up. It can
change for two reasons: either you’ve
manually calibrated it (as described
GPS disciplining
below) or the GPS 1PPS signal has been
used to determine the actual TCXO
If you fit a GPS module, this is all
frequency. So when GPS disciplining
pretty much automatic. The PIC32
is available, the
should detect a
TCXO setting autovalid serial stream
matically updates
from the GPS unit
when necessary.
and display some
These changfigures in the upes are saved to
per-right corner
the PIC32’s Flash
of the screen. If
memory so that
not, check that you
the frequency can
haven’t transposed
be accurate the
the TX and RX pins
next time the unit
of the GPS unit or
is powered up bemade some other
fore it’s been runmistake with the
ning long enough
wiring. Check also
to get an accurate
that the power LED
reading of the GPS
on your GPS unit
time base.
is lit.
For manual caliMost
GPS
bration (eg, if you
units (including
have not fitted a
the recommendFig.7: using the on-screen keypad to calibrate the onboard oscillator for greater
GPS unit), you must accuracy. There are three different calibration methods given in the text, with
ed VK2828) also
first measure the the simplest involving measuring the oscillator frequency with a more accurate has an LED which
TCXO frequency.
flashes when it has
meter and then typing it in as shown here.
86
Silicon Chip
Celebrating 30 Years
siliconchip.com.au
a good satellite
inputs. You still
SILICON CHIP 6GHz+ Touchscreen Frequency/Period Meter
lock.
just need to substiTimestamp,Hz,Freq,PrecHz,AccHz,TCXO,Input,Imped,Mode,AvgSec,GPSSats,UTC,Date
If you’re gettute the units when
6239317,5260135255,5.26013526GHz,240,370,16367993,SMB,50,1,5,124837,03112017
ting some indireading the divided
6239817,5260134170,5.26013417GHz,230,360,16367993,SMB,50,1,5,124837,03112017
cation in the upoutput to get the ac6240317,5260134285,5.26013429GHz,220,350,16367993,SMB,50,1,5,124838,03112017
per-right corner
tual frequency.
6240817,5260133925,5.26013393GHz,210,340,16367993,SMB,50,1,5,124838,03112017
that the GPS unit
Note that while the
6241317,5260133910,5.26013391GHz,200,330,16367993,SMB,50,1,5,124839,03112017
has been detectaverage
frequency
6241817,5260133965,5.26013397GHz,200,330,16367993,SMB,50,1,5,124839,03112017
ed but you aren’t
produced
from the
6242317,5260133940,5.26013394GHz,195,325,16367993,SMB,50,1,5,124840,03112017
seeing a proper
reference
output
6242817,5260133995,5.26013400GHz,190,320,16367994,SMB,50,1,5,124840,03112017
fix (latitude, lonshould
be
very
ac6243317,5260133965,5.26013397GHz,190,320,16367994,SMB,50,1,5,124841,03112017
gitude, time, date,
curate, there could
Table 1: sample output from the unit over the serial console, captured with
etc) then you may
be some jitter bea terminal emulator. The result is in a CSV format so you can save, plot
need to move the
cause of the Pulse
and analyse it easily using standard software such as Microsoft Excel or
unit closer to a
Diffusion technique
LibreOffice/OpenOffice Calc.
window or conused to provide an
sider fitting a GPS module with an and leave it powered up for at least accurate division ratio. So it’s best to
external antenna.
half an hour to allow it to calibrate feed it to equipment with a reasonably
Note that it may take several min- the TCXO frequency to a reasonable long acquisition window (say at least
utes to get a lock even with a good sig- accuracy.
100ms) to get good results.
nal, especially if the GPS module has
If you’re only using it in short bursts
not been used for many days.
later, it may not have enough time to Serial output
Once a signal has been found, a cir- get a good lock and so doing this periOne feature we haven’t mentioned
cle is displayed which should flash at odically (eg, every couple of months) so far is that the measured frequency/
1Hz, concurrent with the 1PPS signal will help it continue to provide good period, TCXO oscillator frequency and
from the GPS unit. It will be red if a accuracy.
general configuration are also printed
satellite lock has not yet been achieved
to the serial console in CSV format.
Reference output
or green if it has.
So if you want to hook the MeOnce it’s green, the unit will start inAs stated in the earlier articles, the ter up to your PC, you can do so and
ternally “time stamping” each pulse. reference (BNC) output can produce capture/log/process the resulting data
If the lock remains good for at least a one of three signals: a fixed 1Hz or quite easily.
few minutes, the time stamps will be 1kHz reference signal, or a frequency
You can see the output of the unit in
used to improve the TCXO frequency that is equal to the measured frequency MMEdit’s “MMChat” window or you
and thus the reading accuracy and divided by 1000 (for the BNC input) or could use a serial console program
precision.
like Tera Term Pro to view and capture
1,000,000 (for the SMB input).
The length of time that the unit has
This varying division ratio is nec- this data. Set its baud rate to 115,200
had a good satellite lock is shown be- essary to keep the output frequency and make sure the correct COM port
low the latitude, longitude and alti- within reason at the upper end of the is selected. Make sure to close MMEdtude information (which are provided device’s measurement range and is it before launching Tera Term Pro so
merely for your curiosity).
shown on-screen when you switch that the COM port isn’t already in use.
Also, it’s imOnce captured, save
portant to realthe data to a CSV file
ise that the time
so you can open it latand date giver for analysis.
en are for UTC
Conclusion
(GMT).
They’re also
Despite all the preprovided for
vious explanation,
your reference;
this meter is quite
you need to
simple to use, espeknow your curcially if you are usrent local time
ing GPS disciplinzone offset to
ing since there is no
convert them to
need for manual calilocal time.
bration.
By the way,
All you need to do
we suggest once
is connect your signal
you get the Meup to one of its inputs,
ter up and runpower it up, select the
ning, you leave
appropriate input and
it in a location Fig.8: having entered the measured TCXO frequency, you also have the option
averaging time, then
of providing an accuracy figure to go along with it. This allows the unit to
with a good compute and display the new, better accuracy figure for any given reading.
wait a few seconds and
GPS signal lock Press the Save button and the new calibration figures will take effect.
read off the result. SC
siliconchip.com.au
Celebrating 30 Years
December 2017 87
|