Documente Academic
Documente Profesional
Documente Cultură
Self-calibrating
Frequency Meter
No alignment necessary
By Willem den Hollander (The Netherlands)
In the May & June issue of ElektorLabs Magazine we described a 10-MHz reference frequency source that
uses the signals from GPS satellites to provide an extremely accurate reference frequency. The author has
designed a self-calibrating frequency counter based on that circuit.
Input amplifier
As we all know, digital circuits are only
VCC VCC
happy with digital signals, so the input
signal has to be conditioned before it is R6 R7 R9 R11
C6 C7 16
applied to the microcontroller port. Fig-
560R
560R
VCC
15k
1k2
10
TE
ure 2 shows the relevant part of the cir- 100n 2u2 7
PE
9
LD
cuit (top half). The display module is also C2 R3
C4
IC1 1
CLR
22R 1 4 Q1 14
IC2
shown here in the bottom half, because J1 C1
47p T1 R5
22u TLV3501
5 2
CLK
Q2 13
R2
R13 Q3 12
that part of the circuit is located on the T3 3
74AC161
220k
100k
J309 Q4 11
T2 2 3
100n P1
10k
C3 6
display board. You might wonder why it D1 BC849C
4
P2
5
R1 22u P3
is on the display board. The answer is R4 BC849C R8 R10
C5
R12 6
P4 TC
15
1M
GND
330R
15k
1k2
8
47p
VIN
E
2
ered by the FET T1. This input circuit is 1
A1 RS
39
RS 3
20 38
LCD1
required to obtain an input impedance A2
LCD- DISPLAY
CSB CSB 4
R14 R15
CK 5
of 1 MΩ and to avoid overloading due to 2 EA DOG-M 29
10k
10k
C1 D6 SI 6
19 28
C2 D7 7
high-amplitude input signals. R/W PSB CAP1N CAP1P VSS 8
37 23
Transistors T2 and T3 provide enough 21
C8
22 27 9 HOLD
10 RANGE
10k
C3 C4 RC5 output of the microcontroller
J2 100n 10u (pin 16);
1
20
2 • a second 3.3-V voltage regulator
VCC 3 4 5
1
VDD
28 4 VCC V_BCKP (IC4) has been added to provide the
MCLR RB7/ICSPDAT
X1 2
RA0 RB6/ICSPCLK
27 5 1
RXD1 IC2 TIMER
7 supply voltage for the display, the
4 1 3 26 6 2 8
VCC
20MHz
ADJ
4
RA1
RA2
RB5
RB4
25 10
TXD1
RESET
AADET_N
NC
9
J3
input amplifier and the GPS receiver.
IC1
C1 C2 5
6
RA3 RB3
24
23
6
1PPS
L80
EX_ANT
11
That way the VCTCXO and the micro-
RA4 RB2 SMA
100n
VCTCXO
10u 7
RA5 RB1
22 GND GND controller have their own power sup-
2 3 9 21 3 12
GND OUT
10
RA7
RA6
PIC16F1778
RB0
RC7
18 ply and the stability of the reference
11
12
RC0 RC6
17
VCC
frequency is assured.
RC1 LM1117-3.3
VDISP
13
RC2 RC5
16 10MHz
IC3
14 15 3 2
J4
RC3 RC4 VIN VOUT
Connector J2 is intended for in-circuit
VSS VSS GND
1
2
INP
8 19
C12
1
C5 C6 C7
programming of the microcontroller, and
3 RS 100n 22u 100n 100n
J4 provides the connection to the dis-
4 CSB
5 CK play board.
6 SDO J1 LM1117-3.3
7 IC4 Vdisp
8
1 3
VIN VOUT
2
Construction
9 HOLD GND
10 WINDOW 2 C8 C9
1
C10 C11 As previously mentioned, the input ampli-
22u 100n 22u 100n fier and the display are located on the
160706 - 13
display board. With the exception of the
connectors and switches, which should
preferably be leaded types because they
Figure 3. Schematic diagram of the microcontroller portion. There aren’t many components, so the
are subject to physical stress, all compo-
PCB is remarkably empty.
nents are SMDs. That keeps the overall
package pleasantly compact (see Fig-
teen characters and white LED backlight- shown in Figure 3. It is largely the same ure 4). It’s a pity that for proper oper-
ing. The display is driven by the micro- as the 10 MHz reference frequency proj- ation the GPS receiver has to be kept
controller over an SPI bus (connector J2). ect in the May & June issue. For more as far away from the oscillator as pos-
details, see the article in that issue. The sible; otherwise it could have also been
Microcontroller portion only differences are: mounted on this circuit board.
The microcontroller, the clock crystal and • the two indicator LEDs are deleted Figure 5 shows the microcontroller
the GPS receiver are located on the main (the microcontroller pins are needed board. It is very sparsely populated, but
circuit board. The schematic diagram is for the SPI interface (J4); that is beneficial for the GPS receiver.
The boards are fitted in a Teko 011 case,
with the original aluminium front and
back panels replaced by acrylic sheets
covered with aluminium-coloured self-ad-
hesive film because the GPS receiver
needs access to the outside world. The
power source is a standard 5-V USB AC
line adapter.
Figure 6 gives an impression of the
author’s prototype.
Firmware
The firmware residing in the microcon-
troller, which performs all the functions
required for proper operation of the fre-
quency counter, is written in assembly
language because using a high-level lan-
guage would have a number of serious
disadvantages.
First of all, it would not be possible to
control the timing of the various functions
with sufficient accuracy, and secondly,
it would take up more memory space.
Figure 4. The display board with the input amplifier. And the software would run slower – also