AM-FM-CW Scanning HF-VHF RF Signal Generator

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

AM/FM/CW

Scanning HF/VHF RF
Signal Generator Part 1
by Andrew Woodfield
ZL2PD
This low-cost, easy-to-build and user-friendly RF signal generator covers from
100kHz–50MHz and 70–120MHz, and is usable up to 150MHz. It generates
CW (unmodulated), AM and FM signals suitable for a wide range of tests. Its
output level is adjustable between -93dBm and +7dBm and it has an accurate
frequency display. It also includes a scanning function for filter alignment.

I
’ve always wanted a good Most lack accurate frequency read- Basic analogue and digital PLL-based
AM/FM HF/VHF signal generator. I outs or adequate stability. Spurious and RF signal generators are available be-
have tried to meet that need with a harmonic outputs can also be a problem. tween about £100 and £150. The ana-
variety of designs over the years, some (See the list of references at the end logue generators offer basic CW, AM or
analogue, others using DDS chips. of this article for three such designs that FM modulation. Output level and mod-
Recently, I have tried low-cost I considered and rejected). ulation depth on the low-cost analogue
fractional-N oscillator chips, includ- Table 1 (overleaf) shows what is avail- generators are typically controlled via
ing the Si5351A. These were only able at the moment. I rejected all of these internally mounted trimpots adjusted
suitable in specific circumstances, options for one reason or another – in- through small holes in the panel.
and did not make for a good general- adequate performance, lack of features, The low-cost digital signal generators
purpose test instrument. high price or unreliability. only offer FM and appear aimed at the
Obviously, it’s possible to purchase With few exceptions, the output lev- two-way radio industry.
an RF signal generator, new or used, els of most of these generators are quite These instruments are perfectly func-
but I couldn’t afford the price of a limited. Those with a variable output tional, but for hobbyists, the features
good one. Cheap signal generators level typically use a simple potentiome- are too limited. To use them effectively,
lack adequate performance and useful ter, with little regard to varying output you’d need extra equipment such as a
functions. Those with adequate perfor- impedance or accuracy. frequency counter, attenuators, amplifi-
mance are usually too expensive for Output levels are also often too low ers and a level meter. It’s far easier to have
most hobbyists, or are unreliable and for use in many typical applications. these features built into the generator.
difficult and/or expensive to maintain. Modulation, where available, is often As Table 1 shows, moving up in the
I have seen some designs published, limited. And, finally, some otherwise market significantly increases the price.
but these are typically simple analogue useful digital-based designs are now Used equipment is available at lower
LC-based designs with coverage up to difficult or impossible to build due to cost, but many otherwise excellent in-
around 150MHz, in a series of five or obsolete parts or unavailable software struments have recognised spare parts or
six switch-selected bands. or PCB layouts. reliability issues as the equipment ages.
So I needed to come up with my own
design that would tick all the boxes, and
that is just what I have done. See the
table opposite which lists its features
and performance figures.

Design goals
This design represents the outcome of
an extended period of development and
testing over the last few years.
This signal generator provides basic
CW (unmodulated) signals, plus AM
and FM modulation functions, primar-
ily across the high frequency range from
100kHz to 30MHz, with a continuously
variable output level suitable for most
requirements.
This frequency range includes most
common IFs (intermediate frequen-
cies) such as 455kHz, 465kHz, 470kHz,
10.7MHz and 21.4MHz.

14 Practical Electronics | June | 2020


Coverage extends to 50MHz, with an-
other range covering 70-120MHz. Cover-
age actually extends up to 150MHz with
some limitations, to permit limited use
in the popular 2m amateur radio band,
as well as parts of the widely used inter-
national 138-174MHz land mobile band.
Key design objectives included low
cost, ease of obtaining parts and ease
of construction. Special parts, such as This is the low-cost AD9850-based DDS signal generator used in this design.
chip-based attenuators, for example, Besides the chip, it has a reference osciallator (the metal can at left) plus a
were avoided in favour of the low-cost number of discrete components, including a low-pass filter for the output.
combination of slide switches and Achieving that performance, how- provide the desired functions and
standard resistors. ever, still requires moderately careful performance required at a modest cost.
The generator’s RF output is designed enclosure construction. The cheapest digital options include
for applications requiring relatively By using commonly available parts the powerful Silicon Labs Si5351A
high RF levels. These include testing and low-cost modules, I have been able device or widely available direct
double-balanced diode mixers in high- to keep the overall cost low. I estimate digital synthesis (DDS) modules based
performance receivers and for testing the cost to build this signal generator on chips such as the Analog Devices
multi-stage passive filters, where stop- currently at around £40. AD985x (see our article on the AD9850
band attenuation measurements require in the September 2018 issue of PE.
relatively high signal generator outputs. Design approach Other digital options include PLL
Lower RF output levels are also use- As shown in Fig.1, a modern signal chips such as the Maxim MAX2870.
ful, eg, for receiver sensitivity tests. generator consists of five functional While it is certainly possible to generate
The minimal useful level is mostly blocks: the RF oscillator, modulator, sinewaves from both the Si5351A and
determined by the limitations of low- RF buffer amplifier, variable attenuator the MAX2870, the additional circuitry
cost shielding and the simple hobbyist to control the output level, and some required to obtain low harmonic con-
construction methods used. control electronics. The logical imple- tent output signals, coupled with the
If an enclosure was carefully milled mentation of the control electronics challenges of adding modulation, make
from a 25mm thick metal billet with is based on a microcontroller. The them less attractive.
shielding slots for flexible conductive final block is the power supply, either AD9850 DDS modules (shown
inserts, the lower limit could be ex- battery-powered or mains-powered above) are available from ebay and
tended significantly, but relatively few (or both). AliExpress at reasonable prices.
hobbyists could achieve this. So I’ve The oscillator is a key element of any The instrument’s display require-
used simple shielding and a basic DIY signal generator. An analogue-based ments are modest, so I decided to use a
folded aluminium sheet metal box. This wide-range oscillator and modulator common 16×2 character alphanumeric
is reflected in the modest lower output involving sets of inductors and a tun- LCD. These are easy to read and drive
specification limit of around −90dBm. ing capacitor is impractical and can’t from a micro.

Features and specifications


Specification Comments
Coverage 100kHz-50MHz, 70MHz-120MHz Usable up to 150MHz
Tuning steps 10Hz to 1MHz in decade increments User selected
Accuracy and stability Within 150Hz at 30MHz (typical), 0-40°C, 0-80% humidity Can be enhanced with software calibration
Output level −93dBm to +7dBm (approximate) 50termination
Attenuation steps 0-80dB in 20dB steps (switched) + 0-20dB (variable)
Output socket SMA
Spurious and harmonics Typically better than −30dBc Within specified coverage frequency range
AM 30% modulation @ 1kHz
FM NB (12.5kHz spacing), 1.75kHz deviation @ 1kHz (60%)
WB (25kHz spacing), 3kHz deviation @ 1kHz (60%)
BC (12.5kHz spacing), 50kHz deviation @ 1kHz (60%) Suitable for standard broadcast FM receivers
Scanning Programmable start and stop frequencies 1kHz resolution
10, 20, 50, 100, 200 or 500 steps/sweep Auto step-size calculation
Display 16x2 alphanumeric LCD
Power control Soft on/off switch
Controls Two knobs and eight switches
Power supply 9-12VDC at 250mA
Dimensions 160 x 110 x 25mm (excluding knobs)
160 x 110 x 45mm (including knobs)
Weight ~250g

Practical Electronics | June | 2020 15


attenuation range. It works well into
mid-VHF frequencies.
The input impedance is main-
tained reasonably close to the desired
50across the adjustment range of the
potentiometer, so the attenuation is pre-
dictable. The output match to 50as the
potentiometer is adjusted is not perfect,
but it’s an acceptable compromise for
this design.

Amplitude modulation
with the AD9850
A key objective of the signal generator
was to deliver both amplitude (AM) and
frequency modulation (FM), as well as
providing an unmodulated RF signal.
Amplitude modulation with the
AD9850 is well documented. Analog
Table 1: I looked at a range of currently available commercial equipment, both Devices, the chip’s manufacturer, help-
new and used. However, for anything that had better-than-mediocre performance, fully published an application note
that third column definitely caused me some heartache! I estimate the instrument
(AN-423) which describes adding a
described here could be built for not much more than £40, plus case.
small-signal NMOS FET and a few ad-
A rough outline of the design began transistor becomes warm during use, ditional parts to do this. A quick test
to take shape and, adding up proces- but a heatsink is not required. confirmed that it works as described.
sor pins required, the very common The design of the attenuator stage Most signal generators use a 1kHz
ATmega328P 8-bit microcontroller also posed some challenges. Recently, modulation tone, which can be pro-
appeared suitable. While an Arduino PE4302 30dB step attenuator chips have duced in several ways. One approach
was briefly considered, I would need to become popular. While only relatively is to use the ATmega328 to generate a
use practically every pin on the device, new devices, these have recently been 1kHz square wave using one of its inter-
and I wanted to keep the instrument listed by the manufacturer as obsolete. nal timers and then filter this to give a
compact, so I decided to use a stand- The replacement devices, while having 1kHz sinewave. But extensive filtering is
alone ATmega328 processor. improved performance, also come at a required to obtain a suitable tone. That
The RF buffer amplifier requires only substantially increased price. involves quite a few extra parts.
modest gain. It must handle the some- Relay-controlled fixed attenuators can A second, similar approach is to use
what unusual 200output impedance be used, but with an eye on cost and the ATmega328’s counter/timer in its
of the AD9850 module and the following simplicity, I decided to use inexpensive pulse-width modulated (PWM) mode.
50attenuator stages and 50output. slide switches instead. Experience has The resulting waveform is closer to
Another consideration is that the buffer shown these to perform adequately for a sinewave but still requires some
should not be overloaded by the some- this type of application. However, these filtering to remove the 31kHz PWM
times high output swing of the AD9850. limit the attenuator steps to specific at- frequency. Usefully, that filter is far less
Numerous designs published on the tenuation values. Ideally, the generator complex given the much higher clock
Internet suffer from this problem. should have a fully variable output level. frequency compared to the 1kHz tone.
The buffer should also maintain its So I decided to build and test a A third option is to build a discrete
gain across the design frequency range. Serebriakova attenuator as an alterna- 1kHz sinewave oscillator and just use
And the buffer should be able to work tive to a more costly PIN diode-based the ATmega328 to turn it on and off as
into a reasonable range of loads and design. This configuration is shown in required. At first glance, the discrete
survive typical bench treatment. the lower right-hand corner of Fig.4, oscillator approach is attractively
I’ve used MMIC amplifiers such as the the circuit diagram. simple and uses relatively few com-
ERA-series devices from Mini-Circuits It’s a simple passive resistor net- ponents, so I tested this out, using the
to buffer AD9850, AD9851 and AD9854 work that acts as a variable attenuator, circuit shown in Fig.2.
DDS chips in the past. These drive well suited for basic designs like this. It works quite well. The 3.3nF ca-
50loads with good performance. Apparently of Russian origin, the pacitor value can be adjusted to give
However, in testing this signal gen- attenuator network uses a 500linear the required modulation level at the
erator with a wide variety of filters, potentiometer to give a 20dB variable AD9850’s RF output. This works by
amplifiers, receivers, transmitters and
other loads, several MMICs suffered
early deaths. These were probably due
to the very low impedances presented
by some of the test filters.
The search for a more suitable buffer
stage was ultimately concluded with
the inclusion of a traditional single-
stage buffer amplifier using a robust
2N4427 VHF transistor. It is widely
available at low cost, as is its near-
equivalent, the 2N3866. It proved more
than adequately robust over many Fig.1: the basic arrangement of a modulated signal generator with adjustable
months of use. The TO-39 case of the output level. Our design follows this configuration.

16 Practical Electronics | June | 2020


Fig.2: a typical
example of how you What is Frequency
can apply amplitude
modulation to
Modulation (FM)?
the output of an With frequency modulation, the audible
AD9850-based signal tone of (say) 1kHz results from the carrier
generator module frequency of the signal generator being
using discrete instantaneously shifted (or ‘deviated’)
components. from its nominal frequency in proportion
to the amplitude of the modulating tone.
In the end it was
As the amplitude of the tone increases,
decided to abandon
this idea in favour at that 1kHz rate, the carrier frequency of
of a PWM-based the generator proportionally increases.
microcontroller Similarly, as the 1kHz tone’s amplitude
approach. decreases, the carrier frequency is pro-
portionally decreased. It is proportional
because the extent of the carrier frequency
shift, or deviation, depends on the signal
bandwidth required.
For broadcast radio FM, the peak devia-
replacing the fixed resistor (RSET) on the AD9850 and uses fewer components
tion is ±75kHz. The resulting signal fills the
pin 12 of the AD9850, typically 3.9k, than the other options. It also allows
standard FM broadcast channel bandwidth
with the variable resistance of Q2’s chan- other modulation tones to be added in
of 200kHz. Traditional VHF FM two-way
nel. This resistance sets the AD9850 future if required. Finally, this approach
radio transceivers used for amateur radio
digital-to-analogue converter (DAC) also adds another important feature –
or commercial/government mobile radio
current and, subsequently, the AD9850 reasonably accurate linear control of
use a much smaller ±5kHz deviation, and
RF output level. the AD9850 RF output level.
these signals occupy 25kHz channels.
By varying the gate voltage of the Note though that this approach re-
More modern so-called ‘narrow-band’
2N7000 at 1kHz using the voltage quires the removal of that 3.9kresistor
amateur FM transceivers typically use
from the collector of audio oscil- from the module as supplied, and the
±2.5kHz deviation, and these use more
lator Q1, the AD9850 RF output is addition of a wire to control pin 12 from
densely-packed channels spaced apart
amplitude modulated. However, this Q1 to one of its pads. This change will
by 12.5kHz.
analogue tone is not precisely 1kHz. be described in more detail later.
Its frequency is determined by the
passive components around Q1. To Frequency modulation (FM) Another Analog Devices application
give a more accurate (and potentially Again, there are several options to note (AN-543) suggests a solution. It
adjustable) modulation frequency, the produce FM with the AD9850. One ap- describes a powerful Analog Devices
PWM-based approach was used in the proach would be to externally modu- DSP chip which samples incoming
final circuit. See the ‘OUTPUT LEVEL late the AD9850’s separate 125MHz stereo audio at 48ksamples/sec and
CONTROL’ section in Fig.4. reference crystal oscillator. Frequency then sends a stream of 40-bit frequency-
Pin 11 (output PD5) of IC1 produces and phase modulation could be both setting words serially at very high speed
the 1kHz sinewave as a 31kHz PWM implemented this way. Unfortunately, to the AD9850.
square wave, or potentially at other fre- the 125MHz reference oscillator in the Each of these 40-bit words programs
quencies by changing the software. This low-cost modules is inside a sealed the AD9850 to a new instantaneous fre-
is filtered and used to control a current metal can. quency, which is necessary to emulate a
sink made using standard NPN transis- There is no external voltage tuning stereo FM signal (including the 19kHz
tors. An extra 100nF bypass capacitor input which might otherwise be pressed and 38kHz pilot tones).
was added to pin 12 to the final PCB to into use to produce FM. It’s possible to With some care and a few lines of
address AD9850 module stability. replace the reference oscillator module assembly code for speed where neces-
The 31kHz pulse-width modulated with a discrete oscillator to allow for sary, the ATmega328 can modulate
1kHz signal is produced by the AT- external modulation, but that takes the AD9850’s output frequency in this
mega328 from its 8MHz internal RC some effort. It is also possible to use the manner. Sadly, the resulting modulation
oscillator. The variable DC voltage of AD9850 internal phase modulation reg- sounds pretty average. The problem is
0-5V arriving on the base of Q1 is con- ister but resolution is too limited (4 bits). the time required by the ATmega328 to
verted to a variable collector current in
Q1 of 0-700µA, the maximum current
value being set by its 1kemitter resis-
tor. This figure was selected to exceed
the 625µA maximum current sink range
required by the AD9850.
This approach is not perfect. Using
the RSET pin and the standard unbal-
anced RF output from the AD9850
module, the typical approach used in
these low-cost modules, the output
modulation produced is asymmetric.
In practice, however, this does not Fig.3: the output of a DDS signal generator module contains the wanted
matter terribly. frequency plus a number of alias frequencies. These are normally filtered out
This simple circuit delivers clean- but it is possible to instead filter out the fundamental frequencies and keep one
sounding amplitude modulation with of the higher alias frequencies to extend the signal generator’s range.

Practical Electronics | June | 2020 17


send the serial string of 40 bits to the However, the AD9850 can also be in the ATmega328. This is much closer
AD9850 each time its frequency has to controlled using a parallel interface. to a proper sinewave. The difference is
be updated for frequency modulation This requires sending five 8-bit words clearly audible in an FM receiver. The
via the typical 3-wire interface. in quick succession to the chip, along parallel method gives a demodulated
The poor result is not surprising. With with some control signals via two or signal that sounds very clear and clean,
the conventional serial load method and three additional pins. The only pub- just like a sinewave should.
our 8MHz, 8-bit chip, it is (just!) possible lished example I could find is based So for FM, the 20-point sampled
to load four modulation samples per on a PIC processor. waveform is created by calculating the
1kHz cycle into the AD9850. A four- There is a considerable advantage required AD9850 output frequency
point sinewave is actually a triangle in this method. Rather than taking every 50µs and sending that data over
wave, which is full of harmonics! about 250µs for the ATmega328 to load the fast parallel interface.
Closer study showed that there is each 40-bit word serially, the parallel The FM deviation is controlled by
another way to communicate with the approach can reduce this to as little changing the magnitude of the frequen-
AD9850 chip. Almost every AD9850/51 as 2.5µs. cy changes which occur 20,000 times
based design uses the three-wire serial With the parallel loading method, it per second (20 points × 1kHz).
bus to send 40-bit control words to the is possible to send 20 samples per 1kHz Selecting narrow band FM (the LCD
AD9850 each time the frequency needs cycle without any trouble at all, even shows ‘FM-NB’) on this generator
to be updated. with the (relatively) slow 8MHz clock for 12.5kHz spacing for FM two-way

AD9850-based CW/AM/FM HF/VHF Signal Generator


Fig.4: along with the 16×2 LCD module, the ATmega328P microcontroller (IC1) drives the AD9850 signal generator
module using an 8-bit parallel bus plus three control lines. This allows it to modulate the output frequency at 20kHz,
which results in clean 1kHz frequency modulation. Amplitude modulation is applied using PWM from pin 11 of
IC1, which is filtered and then controls a current sink comprising transistors Q1 and Q2. The resulting current flow
controls the signal generator output level. The output signal is buffered by transistor Q3 and then passes four switched
20dB attenuators and then a 0-20dB variable attenuator (VR2) which gives a 100dB overall output range. Q4 and Q5
form a ‘soft power’ switch for the circuit, which is controlled by pushbutton switch S3.

18 Practical Electronics | June | 2020


radios produces ±1.5kHz FM; select- of discrete frequency steps across a for setting the start and stop frequency
ing wideband FM, for older 25kHz- defined range. For the transceiver ex- is acceptable.
channel-spaced two-way radios, gives ample, the Signal Generator could be I decided to add a SCAN pushbutton
±3kHz FM (‘FM-WB’), while selecting programmed to produce signals across to the design, to enable this mode. As I
broadcast FM produces ±50kHz FM each of the nine bands used for the had run out of pins on the ATmega328,
signals (‘FM-BC’). bandpass filters being tested. I used two diodes (D1 and D2) so that
By monitoring the amplitude of the pressing this button is effectively
Frequency scanning resulting output from each filter on an equivalent to pressing the two existing
A further feature was added for test- oscilloscope, it is possible to quickly buttons (MODE and STEP) simultane-
ing and aligning filters. For example, align each filter while seeing the im- ously. The micro can detect this as a
while designing this Signal Generator, pact of every change. This forms, in ef- press of the SCAN button – see Fig.4.
I was also building a 9-band HF trans- fect, a ‘poor man’s spectrum analyser’.
ceiver. Its receiver front end features This saves considerable time and effort Expanded frequency coverage
nine sets of coupled tuned circuits, over manual alignment methods. Typical AD9850 modules are fitted
each requiring careful alignment, with The start and stop frequencies can with a 125MHz reference oscillator.
three or four adjustments per set. be set anywhere across the range of DDS oscillators deliver clean sine out-
In the scanning mode, the generator the signal generator. Since filters are puts up to about 30% of the reference
briefly produces a signal on a series generally fairly broad, a 1kHz step size frequency; in this case, say 40MHz.

Practical Electronics | June | 2020 19


NAVIGATING THE MENUS In fact, these modules have three out- products do not appear at the SINB out-
puts. The first is the filtered output as put. However, since there is no similar
Starting frequency and mode
described. It appears on my module low pass filter on the SINA output, these
on the pin labelled ‘SINB’. alias signals are all usefully present, in
An adjacent pin, ‘SINA’, might appear full, at this pin.
to be similar. However, this signal comes As the user continues to tune the
directly from the AD9850 DAC. It is a AD9850’s output upwards in frequency,
Press ‘MODE’ to select next mode (AM) 180° phase-shifted (inverted) version the ‘wanted’ and first ‘alias’ output ulti-
of the signal at SINB but without any mately coincide and pass each other at
additional low-pass filtering. Fout = 62.5MHz.
The third available output comes A few tests using this SINA pin sug-
from an internal comparator in the gested that the usually unwanted alias
AD9850. It produces a square wave ver- frequencies above 65MHz could be
Next press selects narrowband FM sion of the output. This is output level obtained from the module using an ex-
dependent, the duty cycle being set by ternal high-pass filter (HPF). That would
adjusting a miniature trimpot on the allow the signal generator to provide
module. If it is adjusted for a good 50% useful outputs from, say, about 70MHz
duty cycle output at a lower frequency up to about 120MHz. With additional
setting, it tends to be less accurate at filtering, still higher aliasing products
higher frequencies. could be filtered out and amplified.
Twice more selects broadband FM There is little difficulty in obtaining This permits the generator to pro-
(wideband FM not shown) reasonably clean filtered signal genera- duce signals across the 2m amateur
tor outputs up to 50MHz from the fil- band or across part of the 138-174MHz
tered (SINB) pin. Some testing showed land mobile bands. As it turns out,
that output was acceptable down to useful outputs across these bands
100kHz. That’s useful for covering re- could be obtained just from using a
Once more selects SCAN mode
ceiver intermediate frequencies (IF) and single HPF, and the maximum tun-
IF filters between 455kHz and 470kHz, ing frequency for the signal generator
for example. was therefore set at 150MHz. Those
Looking more closely at the module, wanting other bands or fewer aliasing
the second SINA output looked poten- outputs can modify the HPF to suit
MODE button tially useful too. Because this output individual requirements.
is not filtered, the full set of DDS alias
Pressing SCAN selects ‘start’ frequency
frequencies are available here. Detailed circuit description
(Adjust with “tune/step”)
In one example, illustrated in Fig.3, The final circuit arrangement is shown
the ‘wanted’ output (labelled Fout) is at in Fig.4. While it may appear complex
30MHz. As the user increases this fre- at first glance, this design uses remark-
quency, tuning towards 35MHz for ex- ably few components given the range
ample, this output frequency increases, of modulation modes and coverage it
shown by the blue arrow. provides. Some of the complexity is
At the same time, the AD9850 (like hidden in the software for IC1.
Pressing SCAN again selects End; all DDS chips) also produces ‘alias’ To enable the frequency modulation
then Steps frequencies. These are shown in orange. described above, the AD9850’s 8-bit
The nearest is at 95MHz, ie, the clock data port (pins D0-D7) is connected
frequency of the DDS (125MHz) minus to micro IC1’s PORTB digital outputs
30MHz. It decreases in frequency as the (PB0-PB7). The three 10kseries resis-
user tunes from 30 to 35MHz, ending up tors have been added so that IC1 can
at 90MHz (ie, 125-35MHz). be reprogrammed in-circuit (via ICSP
Pressing SCAN again starts Scanning There are many other alias frequencies header CON3) while IC1 is still con-
which are produced simultaneously, the nected to MOD1.
next nearest being at 155MHz (the clock MOD1 is also connected to 5V
frequency of 125MHz plus 30MHz), power (VCC) and GND, plus the
with others at 220MHz, 280MHz and so slave select (SS) and reset (RST) pins,
SCAN button on, theoretically continuing forever. The which go to digital I/Os PC4 and PD4
MODE button direction these alias outputs tune can be on IC1 respectively.
seen by the direction of the arrows, some Its two output signals are fed to the
rising while others reduce in frequency HPF and switch S4, while the square
Increasing but acceptable levels of as the primary frequency is increased. wave output goes to CON4, although
aliasing products are present in the The amplitude of all of these signals the signal which appears there is of
output spectrum up to 45% of the follows a strict mathematical relation- limited use, as its duty cycle varies
reference frequency, say 50MHz. ship, called the ‘sine x upon x’ curve. with frequency.
Beyond this, as the output frequency That’s shown in green on the figure. With switch S4 in the position
approaches the Fourier limit of about There’s about a 10dB level difference shown, the lower frequency (100kHz-
60MHz, spurious products render the between the 30MHz output and the 50MHz) signals pass through S4a, the
output unusable. 95MHz alias signal, for example. 100nF coupling capacitor and S4b
Cheap modules are usually supplied That’s the reason for the substantial directly on to the buffer amplifier (the
with an onboard elliptical low-pass fil- onboard filter on the AD9850 module. base of transistor Q3).
ter with a cutoff frequency of 70MHz to It’s a low-pass filter designed to cut off at For higher-frequency signals, S4 is
maximise the output frequency range. 70MHz, so the majority of these aliased moved to the alternative position where

20 Practical Electronics | June | 2020


the buffer amplifier is fed from the HPF User interface The circuitry to provide this function
output, which receives its input from IC1 updates the 16×2 LCD using a typi- is shown at the upper right of Fig.4. It
the unfiltered DDS output pin. cal 4-bit interface. The lower four bits was initially described by Zetex in their
The HPF is a standard seven-pole of PORTC on IC1 (pins 23-26) drive the February 1996 Design Note 27, for use
Chebyshev filter. Elliptical filters pro- four upper LCD data pins, while pins as a relay driver.
vide a faster pass-to-stop band cut-off, 12 and 13 (digital outputs PD6 and However, several problems were en-
but the resulting spurious and harmonic PD7) drive the RS and EN control lines countered with that design, including
rejection is less effective compared of the LCD. some curious component choices and
with the Chebyshev type. The filter Backlight brightness is fixed using a overheating. A minor redesign and the
was optimised to suit standard leaded 1kresistor, with the backlight powered use of a higher-gain switching transistor
components and home-made inductors. whenever the device is on, and trimpot solved them all.
For best performance, the coupling VR1 provides contrast adjustment. When the supply is initially connect-
between the coils must be minimised. The Grey code pulses from the rotary ed, the voltage appears on the emitter of
The PCB layout provides for small tin encoder are sensed using IC1’s PD2 Q4 and the 1µF capacitor charges via the
plate shields to be fitted between filter and PD3 digital inputs (pins 4 and 5), three series resistors (2.7k, 1kand
stages, a simple and effective solution. while presses of the encoder’s integral 270k). However, Q4 cannot turn on
The alternative HPF shown could pushbutton and the SCAN and MODE until momentary switch S3 is pressed
potentially shift the 70-150MHz upper pushbuttons (S1 and S2) are sensed and no current is drawn from the supply.
output range to 125-187.5MHz with using digital inputs PD0 and PD1 (pins When S3 is pressed, current is sup-
appropriate software changes. 2 and 3). plied to the base of Q5, which switches
These have internal pull-ups enabled it on, and it in turn sinks current from
RF buffer amplifier so that they are held high when no but- the base of PNP transistor Q4, switch-
As noted earlier, the buffer amplifier is tons are being pressed. ing it on also and bringing up its col-
a robust discrete design, based on NPN As mentioned earlier, diodes D1 and lector voltage.
transistor Q3. This is a well-known sin- D2 have been added to allow presses of Current can then flow from Q4’s
gle-transistor broadband arrangement three buttons to be sensed using the two collector to Q5’s base via the two 1k
providing about 15dB gain along with available pins. series resistors, so Q5 remains on and
good dynamic range. Gain is necessary Jumper JP1 and ICSP header CON3 so does Q4.
to provide the required maximum out- have been provided to allow IC1 to be However, the 1µF capacitor discharg-
put level for the signal generator and re-programmed in situ. Removing JP1 es because Q5’s collector is now being
to compensate for the insertion loss of prevents the programmer from trying pulled low, to 0V. So if S3 is pressed
the Serebriakova attenuator. to power the RF circuitry. CON3 has again, Q5’s base goes low, switching it
Alternative discrete buffers seen in the standard Atmel 6-pin program- off, and in turn switching off Q4, so the
other AD9850/51 based designs lack mer pinout. circuit is back in the initial off-state.
sufficient gain across the output range
and/or frequently overload with the Power switching Part Two, next month
typically higher module output levels The external power supply, nominally Next month’s article will have the parts
present below 10MHz. 12V DC, directly powers the output list, details of PCB assembly, case con-
By contrast, this buffer amplifier’s buffer. The buffer can operate down to struction, programming IC1 and how
gain is relatively flat and only reduces 9V although harmonic distortion at full to use the RF Signal Generator. We’ll
above 50MHz. This is acceptable given output increases by about 6dB at 9V also have performance data, including
the application and circuit simplicity. compared to 12V. spectrum plots.
If you find the 2N4427 transistor The 12V supply is also regulated
difficult to source, you may be able to down to 5V by REG1 for the AD9850 Reproduced by arrangement with
find a 2N3866 instead, although the module and the ATmega328 processor. SILICON CHIP magazine 2020.
gain may reduce by several decibels. The AD9850 module is current-hungry, www.siliconchip.com.au
The output of the amplifier is taken so REG1 requires a heatsink.
from the centre tap of autotransformer Dissipation losses would be reduced
T1 and coupled to the output attenuator by using a switchmode regulator, but
by a 100nF capacitor. this can introduce switching noise References
The attenuator consists of four iden- inside the signal generator, and could 1. Gary McClellan, Programma-II
tical 0/20dB switched attenuators, fol- potentially modulate the output buffer synthesised signal generator, Radio-
lowed by the aforementioned 0-20dB output signal. Electronics magazine, Aug & Sept
Serebriakova attenuator, giving an As it turns out, the metal signal gen- 1981 (300kHz to 30MHz CW/AM
overall range of 0-100dB. This allows erator case forms an effective heatsink signal generator, 10kHz tuning steps,
you to adjust the output from about for REG1, and this avoids the need for 10-300mV output)
−93dBm to +7dBm. additional hardware. 2. G. Baars, PE1GIC, DDS RF Signal
As mentioned earlier, this range The signal generator will continue to Generator, Elektor, October 2003
is limited by shielding effectiveness operate with a supply voltage down to (50Hz to 70MHz, CW/AM/FM, 1Hz to
and RF signal leakage across the atten- 6V; however, its performance degrades 1MHz tuning steps, 0 to -127dBm out)
uator sections. significantly below 9V. By 6V, the maxi- 3. Ian Pogson, Solid state modulated RF
Better shielding between sections mum output falls by 10dB and harmon- test oscillator, Electronics Australia,
is likely to allow another 20dB fixed ics are only suppressed by 10dB due to May 1979 (455kHz to 30MHz in four
attenuator to be added, significantly the reduced dynamic range in the buffer ranges, approximately 100mV output)
improving its utility for small signal stage. So, operation at 6V is possible but 4. http://lea.hamradio.si/~s53mv/dds/
work. Further improvements would not recommended. theory.html
likely require considerable additional A ‘soft switch’ circuit has been added 5. www.picmicrolab.com/ad9850-
design efforts around the power supply to allow the use of a momentary push- pic16f-interface-parallel-data-load/
and control sections. button (S3) as a power switch.

Practical Electronics | June | 2020 21


AM/FM/CW
Scanning HF/VHF RF
Signal Generator Part 2
by Andrew Woodfield
ZL2PD
We introduced this RF signal generator last month. It is an ideal entry-level
test instrument for anyone into radio: capable, yet low in cost and quite easy
to build. None of the parts are too hard to come by, either. . . Now let’s get into
building it – and getting it up and running. We also have some performance
plots and instructions on how to use it.

T
he Signal Generator is built It is recommended that you attach The module I used is, I believe, the
on one double-sided PCB cod- REG1 to the case for heatsinking, but most-common version, but there ap-
ed 04106191, measuring 152.5 we haven’t built the case yet. Any- pear to be other versions available that
× 102mm, available from the PE PCB way, the easiest way to do this is to use the same circuit but a different lay-
Service. Refer to the PCB overlay dia- cut the three regulator leads short, out. So if your module does not look
gram, Fig.5. then solder 25mm lengths of medium- exactly the same as mine, don’t panic!
Most of the top (component-side) duty hookup wire to the stubs, using You can use a DMM set on continu-
surface has been retained as a ground some small diameter heatshrink tub- ity mode to identify the resistors con-
plane for added shielding. No SMD ing to insulate the solder joints and nected to pins 3, 4 and 12 of the IC and
parts are used in the construction of the lead stubs. then remove them.
the Signal Generator, making it rela- You can then solder these three You can do this by heating the ends
tively easy to build. leads to the regulator pads on the PCB, of the resistors alternately with a sol-
Start by fitting all the resistors where ensuring that it is soldered the right dering iron while holding the body
shown. It’s best to check each one with way around – ie, so that if you hold it of the resistor with tweezers. Once
a DMM set to measure ohms before fit- up above the board with the wires not enough heat has been applied, you can
ting them, as the colour bands can be crossing over, the tab is facing away lift it right off the board. If you have
hard to distinguish). Don’t forget the from the board, as shown in Fig.5. a hot-air rework station that makes it
47Ω resistor hiding under S4. even easier.
Then mount diodes D1 and D2, en- Early testing It’s then just a matter of soldering a
suring they are oriented as shown. Now you can apply 12V power to DC 100mm length of light-duty hookup
Next, mount IC1’s socket with its input connector CON1 and make some wire, or Kynar (wire wrap wire) to the
notched end facing the top of the board. checks. Unfortunately, there is no now-empty pad which connects to pin
Now fit the ceramic and MKT ca- power-on indicator LED at this stage 12 of the IC, as identified in the pho-
pacitors, which are not polarised. (there will be when MOD1 is fitted), to. This will be soldered to the main
Don’t get the different values mixed so the simplest check is to measure board later.
up though. There’s also one of these the voltage at the right-hand pin of JP1
under S4. Follow with trimpot VR1 relative to a ground point such as the Winding coils L1-L3
and plastic package transistors Q1, mounting screw hole in the middle of The three inductors, L1-L3, are wound
Q2, Q4 and Q5. Q4 is a different type the board. At this stage, there should with 0.8mm diameter (26 gauge) enam-
than the other three. be little to no voltage. elled copper wire. These are air-cored,
Next, solder 6-pin header CON3 and Now briefly press power switch S3, meaning the coils are first wound
two-way headers CON4 and JP1 to the and you should measure close to 5V around a suitably sized former, then
board, followed by the power socket on the right-hand pin of JP1. Press S3 the former is removed.
(CON1) and then the electrolytic ca- again and that voltage should drop The coil diameters should all be
pacitors. These are polarised: the long- away to almost zero. That confirms 3mm, so a 3mm drill bit shaft or 3mm
er lead must go to the pad marked with that the power supply section is work- diameter metal tube would be suitable.
a ‘+’ on the PCB. The stripe on the can ing correctly. The coil is then self-supporting when
indicates the negative side. mounted on the PCB.
Fit the three pushbutton switches, Modifying the AD9850 module L1 and L3 need to be 160nH while
with the flat side oriented as shown Minor modifications are required to L2 is 150nH. To achieve this, wind 11
in Fig.5, ensuring they are pushed the AD9850 module before mounting it turns for each coil, but then stretch L2
down fully onto the board before sol- on the PCB. Three SMD resistors need so that it is around 1mm longer than
dering their pins. S3 is red while S1 to be removed and a thin wire soldered the other two. That reduces its induct-
and S2 are black. You now have almost to one of the free pads. These changes ance to the required value. (You could,
enough components mounted to test are shown in Fig.6 and the accompa- of course, use an inductance meter to
the power supply. nying photo of the modified module. verify the coils if you have one).

28 Practical Electronics | July | 2020


Fig.5: use this
overlay diagram
as a guide
to building
the Signal
Generator. We’ve
shown both LCD
screens in place
here, (Jaycar
QP5516 and
Altronics Z7013;
one on top of the
other) but you
would only fit
one or the other.
Edge connector
CON2’s middle
pin is soldered
on the underside
of the board. VR2
can be a standard
16mm pot
mounted through
the board, with
the body on the
underside, or
a 9mm vertical
PCB-mounting
type.

If you want to achieve the alterna- Wind four turns of the twisted wire The wire you connected to that
tive inductor values mentioned last onto the core and trim the ends of the module earlier connects to the lead
month, reduce the number of turns to ‘bifilar’ wires, so you have four short of transistor Q1 which is closest to
six, then stretch L2 by around 0.5mm. lengths of wire each about 20mm MOD1. RevB PCBs have a dedicated
Now remove the enamel at each end long appearing at one pig-nose end pad for this wire.
of the remaining wire on each coil. of the core. Otherwise, solder it directly to Q1’s
Some enamel coatings vaporise while Tin these four ends. Use a multime- lead, on the top side of the PCB. Ei-
being tinned, but most must be scraped ter to identify the start and end of the ther way, trim the wire to length be-
off with a sharp knife. two coils. fore stripping and soldering it. This
Take care if you use the latter ap- The start of one coil and the end wire should ideally be routed under
proach, especially to avoid cutting of the other (shown as ‘AS’ and ‘BF’ the module for neatness. If you keep
yourself. You can verify that you’ve in the diagram) go to the two central it short, it won’t move around later.
scraped off the insulation properly by mounting pads for T1 (either together Next, fit output socket CON2. As
tinning the wire ends and then check- into one pad, or separately into each), it’s an edge connector, push it onto
ing that the solder has adhered. while the other two wires go to the the edge of the PCB, with the central
But note that you don’t want a lot of mounting pads at either end. pin sliding over the central pad on the
excess lead length on these coils; just It doesn’t matter which goes to bottom side.
enough to make it through the mount- which, as the coil is symmetrical. Solder that central pin, plus the
ing holes on the PCB and be soldered Again, cut the leads to leave just a posts on either side, on both the top
on the underside. minimal amount and then strip the and the bottom sides of the PCB.
So cut the wire ends to length before enamel off and tin them before solder- As this is a fairly substantial chunk
stripping the enamel. ing them to the board. of metal being soldered to copper
Don’t stretch or compress the coils This should allow you to mount the planes, you will need a hot iron and
to fit the pads on the PCB as this will balun close to the board, so it won’t rat- be generous with the solder.
affect their inductance; just use a short tle around after the wires are soldered. Then install mini slide switches S5-
length of extra wire at one or both ends S9. The board is designed with slots
to reach the mounting pads. Proceeding with construction to suit their lugs, so you can solder
Now fit metal-can transistor Q3 close to them right down onto the PCB. Again,
Winding the transformer the PCB, leaving about 1mm between be generous with the solder to ensure
T1 is wound on a 7mm-long ferrite the bottom of the device and the up- good joints.
balun core. Begin with 400mm of per PCB surface. Don’t install it firmly Next, mount the LCD. There are three
0.315mm-diameter (28 gauge) enam- down on the PCB because the metal possible headers to suit different LCD
elled copper wire. case of the transistor is internally con- module styles, although Jaycar QP5516
Fold the wire in half so the two cut nected to the collector terminal of Q3. or Altronics Z7018 are the best fit.
ends meet, then twist the two wires to- Also, before you solder it in place, For the Jaycar LCD, solder an 8×2-
gether to produce a twisted wire simi- check the metal case is not touching pin DIL header to the row of pins near-
lar to that shown in Fig.7. any adjacent component leads. est the left edge of the PCB, then at-
It can have anywhere from one to five Next, fit your modified AD9850 DDS tach the four short tapped spacers to
twists every 20mm; this isn’t critical. module by soldering two 10-pin head- the corner mounting holes from the
Twisting the wire simply makes wind- ers to the PCB, then soldering the mod- bottom of the board, using 5mm ma-
ing the wire onto the core a little easier. ule to the pins on top of these headers. chine screws.

Practical Electronics | July | 2020 29


REMOVE THESE
SMD RESISTORS

Fig.6: these three SMD resistors must be removed from the AD9850 DDS module. One
of the pads which connected to the now-gone 3.9kresistor makes a handy connection
point for the extra wire needed to connect pin 12 of the IC (RSET) to the collector of
transistor Q1 on the main board, for output level control. See also the close-up photo CONNECT THE RSET
at right. (PIN 12) WIRE HERE

You can then slip the LCD over the the underside of the PCB and its shaft the upper-left corner of the board. (If
pin header and attach it using four more passing up through a hole. you haven’t already programmed it or
5mm machine screws, then solder the Mounting it in this way is a bit fid- purchased a programmed chip, see the
header pins to the top of the LCD. dly, but there are two benefits: this is a panel below detailing the program-
The procedure for the other LCDs standard part that’s easier to get, and its ming instructions.)
is similar except some LCDs may re- shaft will line up perfectly with push-
quire short jumper wires to connect buttons S1/S2 and the access hole for Further testing
to the PCB. trimpot VR1 (if provided). Later, we will be attaching REG1 to the
The final two components to fit are Alternatively, if you can get your metal case. However, since we haven’t
rotary encoder RE1 and potentiome- hands on a 9mm PCB-mounting right- built it yet, for further testing tempo-
ter VR2. Mounting RE1 is easy; make angle potentiometer, it will be dead rarily attach a flag heatsink or attach
sure it’s perpendicular to the PCB and easy to mount to the PCB, as it’s fitted it to a spare sheet of metal using a ma-
pushed all the way down before sol- similarly to RE1. However, due to the chine screw and nut.
dering its pins. Solder its five pins and location of the hole for the 16mm pot’s You can now apply 12V power to
two mounting lugs; you will need a shaft, its shaft will sit around 3.5mm CON1, press S3 and check that you
hot iron for the latter, and be gener- lower than S1/S2 and VR1. (This is can control the output frequency and
ous with the solder. hardly a tragedy – the choice is yours!) amplitude (see the operating instruc-
For VR2, we’ve provided two dif- Now plug in the ATmega328 mi- tions below).
ferent options. The prototype used a crocontroller (IC1), making sure its Power the unit down before finish-
16mm potentiometer with its body on pin 1 is oriented correctly, towards ing construction.

Two inter-coil screens, show in red on the overlay) must be The modified AD9850 module in situ on the main PCB.
fitted between the coils as shown here. These can be cut from The three SMD resistors are all removed and the yellow wire
a scrap of tinplate (eg, a food tin). This photo also shows the is soldered to the appropriate pad – the one marked R6.
mounting of the 7805 regulator on the case heatsink. (make sure it is the pad closest to the AD9850 IC).

30 Practical Electronics | July | 2020


Parts list – HF/VHF RF SIGNAL GENERATOR
1 double-sided PCB, coded 04106191, 152.5 x 102mm (from the PE PCB Service)
1 AD985x-based DDS module (MOD1)
1 PCB-mount barrel power socket (CON1)
1 SMA edge-mount socket (CON2)
1 2x3 pin header (CON3)
2 2-way pin headers (CON4)
1 jumper shunt/shorting block (JP1)
1 16x2 alphanumeric LCD with backlight (LCD1)
[eg, Jaycar QP5521 or Altronics Z7018]
1 500mm length of 0.8mm diameter enamelled copper wire (for winding L1-L3)
1 400mm length of 0.315mm diameter enamelled copper wire (for winding T1)
1 7mm ferrite balun core (for T1) [Jaycar LF1222, Altronics L5235]
Fig.7: autotransformer T1 is easy to 1 PCB-mount vertical rotary encoder with integral switch (RE1) [Jaycar SR1230] –
make, with just four bifilar turns wound IMPORTANT see below
on the small ferrite balun core. AF 1 28-pin narrow DIL socket (for IC1)
and BS are interchangeable and are 2 10-pin headers (for mounting MOD1)
connected together on the PCB. 1 16-pin SIL or 8 x 2 DIL header (for LCD)
4 6.3mm-long M3 tapped nylon spacers (for LCD)
Fitting the shields 8 5mm M3 panhead machine screws (for LCD)
You will notice several holes around 2 black PCB-mount momentary pushbuttons (S1,S2)
the buffer, attenuator, output and band [eg Jaycar SP0721, Altronics S1096]
select/HPF sections of the board. There 1 red PCB-mount momentary pushbuttons (S3) [Jaycar SP0720, Altronics S1095]
are also lines on the PCB ‘silkscreen’ 5 DPDT mini slide switches (S4-S8) [Jaycar SS0852, Altronics S2010/S2020]
between these holes. This is where 1 9mm-diameter knob to suit VR2
shield plates can be fitted. 1 28-34mm-diameter knob to suit RE1
However, you do not need to fit 1 0.5mm-thick tin plate or cleaned tin-plated steel cans
shields in most of these areas; the only 2 0.8mm-thick aluminium sheets, 300 x 250mm
ones that are critical are those between 1 adhesive panel label, 157 x 107mm
the three high-pass filter sections (be- 4 small self-adhesive rubber feet
tween L1 and L2, and L2 and L3). Hookup wire, misc. enclosure hardware
So you only really need to cut two Semiconductors
shield pieces and mount them using 1 ATmega328P microcontroller programmed with 0410619A.hex, DIP-28 (IC1) – a
four posts in the holes provided. These programmed IC is available from: www.siliconchip.com.au/Shop/9/5056
are shown in red on the PCB overlay 1 7805 5V 1A linear regulator, TO-220 (REG1)
diagram, Fig.5. 3 BC548 NPN transistors, TO-92 (Q1,Q2,Q5)
Each shield piece should be around 1 2N4427 NPN RF transistor, TO-39 (Q3)
8mm high and cut from 0.5mm tin 1 BC327 PNP transistor, TO-92 (Q4)
plate, or recycled tin cans (a fruit or 2 1N4148 small signal diodes (D1,D2)
Milo tin lid is ideal).
The strips are then mounted to the Capacitors
board using component leads off-cuts 2 10µF 50V electrolytic 1 1µF 50V electrolytic
soldered into the holes shown in red. 11 100nF 63V MKT 1 10nF 63V MKT 1 1nF 63V MKT or 50V ceramic
This is simple yet effective. 2 15pF 50V C0G/NP0 ceramic 2 10pF 50V C0G/NP0 ceramic
You could fit shields in the other Resistors (all 0.25W 1% metal film)
locations, but testing has shown that 2 470k 1 270k 5 10kΩ 1 3.9k 1 2.7kΩ 5 1k
it makes virtually no difference to 1 820 1 390 5 220 8 56 2 47 2 27
the device’s performance so I don’t 1 10k mini horizontal trimpot (VR1)
feel that it’s worth the time and ef- 1 500 9mm vertical PCB-mount or 16mm standard potentiometer (VR2)
fort to do so.
Encoders: we have discovered that some rotary encoders look identical but work
Making the enclosure differently, resulting in erratic operation. The V14 firmware addresses this; by default, it
I couldn’t find a suitable ready-made box works with pulse-type encoders. You can identify these by testing continuity across the
for the Signal Generator, so I came up two internal switches; if they are both always open when the encoder is at rest, it is a
with a relatively easy way to make one. pulse type. With the level type, one or both switches may be closed at rest, depending
It’s a simple folded metal box and on the encoder’s rotation. If you have a level-type encoder and V14 software, solder a
works well, resulting in a unit that is 100kΩ resistor from pin 28 of the Atmel chip to ground, on the underside of the PCB.
light but robust, compact and effective- That will change the software to work with level-type encoders.
ly shielded. Dimensioned drawings of
the metalwork are available on the July
2020 page of the PE website – they’re This grade of aluminium is light from standard drills, a metal nibbling
a little too large to publish here! The enough to be cut and folded easily with tool is ideal for cutting out the rectan-
two panels are cut and folded from hand tools, but heavy enough to form gular holes.
0.8mm-thick aluminium sheets. The a sturdy box for the Signal Generator. Final finishing during fitting can be
top cover and base may each be cut Several holes need to be drilled and completed with a fine file.
from a small 300 × 250mm sheet, mak- cut into the panel for the controls, slide The completed PCB is mounted using
ing it relatively inexpensive to build. switches, regulator and the LCD. Aside spacers and 3mm machine screws. It’s

Practical Electronics | July | 2020 31


Programming the ATmega328 micro signal generator PCB, making sure that pin
1 on the programmer cable lines up with
You can purchase a pre-programmed mi- the pin 1 indicator on the PCB.
crocontroller (see parts list). Alternatively, Now select ‘Write FLASH buffer to
to program AVR family microprocessors, chip’ or ‘Write – Flash’ to program the
you need a programmer such as the USBasp ATmega328 with the HEX file. The LEDs
(see www.fischl.de/usbasp/ for details on the USBasp will blink furiously for a
and drivers). This can be purchased minute or two while the HEX file is loaded
online from many suppliers for Launch into the ATmega328. A bar graph may be
a few pounds. the pro- displayed in some cases on the PC screen,
Suitable free software is gramming software to show progress.
available for Windows, Linux you downloaded earli- You then have to program the
and iOS online. This description er and set the target device ATmega328 internal ‘fuses’. These
focuses on the Windows version. to ‘ATmega328’ or ‘Atmega 328P’, configure the operating characteristics of
You need to install the USBasp depending on your chip. Both may be the ATmega328 to suit the software being
drivers and download programming used. Now download the HEX file for this run on the device.
software. For Windows, this includes: project from the July 2020 page of the PE For this step, insert the following set-
website (if you don’t already have it) and tings into the relevant Fuse page/section
eXtreme Burner
select it as the file to be used to program of the programming software, then click
http://extremeelectronics.co.in/avr-
the chip in your software. on ‘Write’ to send the data to the fuses:
tutorials/gui-software-for-usbasp-based-
Make sure JP1 has not been fitted to
usb-avr-programmers/ Low byte: 0xE2
your signal generator board; if it has, re-
High byte: 0xD9
AVRDUDESS move it now. Note that since some of the
Extended byte: 0xFF
http://blog.zakkemble.net/avrdudess-a- ATmega328 pins connect to the AD9850
Lock byte: 0xFF
gui-for-avrdude/) module, the AD9850 module’s power LED
will still light up and flash while the pro- Since the processor and display are pow-
Khazama
grammer is connected and running, de- ered via the programmer, once program-
http://khazama.com/project/programmer
spite having removed JP1 and therefore ming is complete, the display will briefly
Plug it in and complete the installation of cut the power supply to the module. This show the start-up message and then the
the USBasp programmer into your PC. If is of no concern. initial signal generator screen. At this
you have the option of 3.3V or 5V program- Plug the six-pin connector from the point, you can unplug the programming
ming levels, select 5V. USBasp programmer into CON3 on the cable from CON3 and place a shunt on JP1.

best to line it up with the holes in the Small self-tapping screws are used Trim the front panel artwork to cut
lid to figure out exactly where it will sit to hold the cover to the base of the out the holes for the various controls
in the case before marking and drilling box. Once you’ve cut and bent the and display and test-fit onto the com-
out the three mounting holes in the base. sheets, rivet or screw the 7805 regu- pleted metalwork.
Alternatively, as in the prototype, lator (REG1) onto the metal cover just The most reliable method to fix the
the Signal Generator PCB can be held before the final step of screwing the artwork in place is to spray the rear
onto the front panel using the rotary cover to the base. side of the artwork with adhesive spray
encoder nut, although it would prob- The front panel artwork is shown obtainable from most art shops. While
ably be better to attach using at least in Fig.8. It can be printed and covered tacky, press the panel artwork into
one tapped spacer too. with self-adhesive plastic film. place. Remove the rotary encoder nut

Fig.9: the CW (carrier wave, ie, unmodulated) output at Fig.10: analysis of the AM output at 10MHz/−12dBm with
10MHz/−28dBm with a span of about 9-37MHz, selected a 20kHz span (ie, 9.99-10.01MHz). The 1kHz sidebands are
to include the first two harmonics. This shows the second visible either side of the carrier, as are the 1kHz modulation
harmonic (20MHz) at around −40dB and the third (30MHz) tone distortion products at ±2kHz (−21dB below the 1kHz
at around −47dB. fundamental) and ±3kHz (−26dB below the fundamental)
indicating acceptable audio distortion levels. The
modulation depth is the industry test standard, 30%.

32 Practical Electronics | July | 2020


before attaching the
front panel, then re-
attach it on top.

3D-printed knobs Reproduced by arrangement with


SILICON CHIP magazine 2020.
Suitable knobs may be
www.siliconchip.com.au
available from normal -20dB -20dB -20dB -20dB RF OUT
suppliers. However,
I designed the knobs 0-20dB
for my Signal Genera-
tor using DesignSpark
Mechanical and 3D-
printed them from
grey PLA filament. MODE SCAN
My knob STL files
can also be down- BAND
loaded from the July 0-50MHz 70-120MHz
2020 page of the PE
website for those
wishing to print their
own knobs. They TUNE STEP
press into place and POWER
hold securely.
It’s useful to add
SILICON ZL2PD HF/VHF AM/FM/CW Scanning Signal Generator
four self-adhesive CHIP siliconchip.com.au DC IN
rubber feet to the
rear of the metal en-
closure. This prevents Fig.8: download this panel label from the July 2020 page of the PE website (as a PDF). Just print
any sharp corners of and laminate it, cut out the display and switch holes, then cut it to size and glue it to the outside
top of the case.
the aluminium box
from scratching the
bench and helps to keep the oscillator The display shows the current out- each click as RE1 is rotated. When you
in one place on the workshop bench. put frequency and operating mode; push this button, the underline below
the Signal Generator always starts at the LCD frequency display moves to
Using the Signal Generator 10.000MHz in CW (unmodulated) mode. indicate the current step setting.
Briefly press power switch S3 to turn The display also features a frequen- The Band switch (S4) selects be-
the Signal Generator on. The display cy ‘dial’ which covers a 1MHz span tween the two output frequency rang-
will show a start-up message, then af- with 100kHz markers. As you rotate es, 0-50MHz (left) and 70-120MHz
ter a short delay, the normal screen. RE1 (‘TUNE’), the output frequency (right), while S5-S8 at the top, in com-
If you cannot see any text on the dis- changes and the cursor on this scale bination with VR2 at right, set the out-
play, adjust VR1. This sets the LCD con- shifts across the ‘dial’. put amplitude.
trast. You can see examples of the vari- Pushing RE1’s knob in (the ‘STEP’ The Band switch must be in the
ous possible displays in the first article pushbutton) changes the increments in correct position for the currently selected
in this series, published last month. which the frequency is adjusted with frequency to get the expected output

Fig.11: a ‘narrow band’ 1.75kHz frequency-modulated Fig.12: ‘wideband’ or broadcast radio-style FM, again with
signal with a 10MHz carrier and a 20kHz span. The iconic the carrier at 10MHz, this time captured with a 500kHz
equi-spaced 1kHz sidebands of a standard FM signal are frequency span. This clearly illustrates that most of the
clearly visible. signal energy falls within the 200kHz channel bandwidth
permitted for broadcast FM signals.

Practical Electronics | July | 2020 33


amplitude. The HPF is very effective at minimising energy processor using the entered values. The scanning speed is
from aliasing below 70MHz, so the output level can be lower surprisingly fast.
than expected by over 60dB if the incorrect selection is made. Scanning may be interrupted and restarted using the
But no damage will occur as a result of an incorrect setting. SCAN key. When stopped, the Start and End frequencies,
While the upper range is described as 70-120MHz, tun- as well as the number of scan steps, can be adjusted again,
ing and operation are maintained up to 150MHz, although and the scan restarted.
output levels fall significantly above 120MHz. To exit the scan mode, press the MODE key. This also
The maximum output of +7dBm is with S5-S8 all in the stops the scan and resets the Signal Generator to the last
up position and VR2 fully clockwise. For each 20dB of at- scanned frequency, and CW mode.
tenuation you need, switch one of S5-S8 into the down po- At each stage, the output can be checked with a suitable
sition (it doesn’t matter which). Then for fine attenuation oscilloscope or with other RF test instruments.
adjustments, rotate VR2.
For example, if you want −30dBm, set any one of S5-S8 Performance
down (+7dBm − 20dB = −13dBm) and then VR2 should Typical output signals from the Signal Generator are shown
be set quite low, to give an additional 17dB of attenua- in Figs.9-12. These were captured using a Siglent 3GHz
tion. (Note: standard DDS amplitude rolloff impact above spectrum analyser. See the figure captions for details.
30MHz – see Fig.3 in part 1.) Fig.13 demonstrates how effective the high-pass filter is,
The Signal Generator mode is selected with brief presses despite being made from a self-wound air-cored inductors.
of the Mode key (S2). This shows that the filter provides 60dB of attenuation for
This selects between CW, AM, FM-NB (±1.5kHz devia- signals below 40MHz with a virtually flat passband from
tion), FM-WB (±3kHz deviation), FM-BC (±50kHz devia- 70MHz up. The filter roll-off is quite steep at around 75dB/
tion), or SCAN mode. octave (the span from 40MHz to 70MHz is about 0.8 octaves).
Pressing the Mode key again will select the initial CW
(unmodulated) mode again, and the standard display screen. Future possibilities
It is possible to add further features to the software. With
Frequency scanning mode the supplied software, less than 30% of IC1’s program
If the SCAN mode is selected, the display changes to show memory is used.
the currently saved Start and End frequencies for the scan, For example, RF output levelling would be possible, by
and the number of steps selected. At power-on, this is set using the pin 11 PWM output which drives the RSET pin
to 200 steps. If this is the first time after power has been of the AD9850 module (currently used to provide AM)
applied, the default frequency settings (starting at 1MHz to offset the sinX/X roll-off for frequencies up to about
and ending at 30MHz) are shown. Otherwise, the last used 50MHz, at the cost of a reduced maximum output level at
settings will be displayed. lower frequencies.
Pressing the Scan button again allows each parameter to Extended frequency coverage also appears possible
be selected for adjustment. through the use of alternative high-pass filters and/or by
Use the TUNE and STEP controls to set the Start and replacing the AD9850 module with one based on the pin-
End frequencies in turn; here, the STEP button selects the compatible AD9851.
tuning step as usual. Some minor additional software changes would be re-
When the scan Steps parameter is selected with the SCAN quired to permit the AD9851 to be used. The AD9851
button, the TUNE control has no effect, but pressing the can be clocked at up to 180MHz, which may allow the
STEP button allows the number of steps to be selected (10, generator to operate up to 100MHz in a single range, and
20, 50, 100, 200 or 500 per scan). possibly up to 300MHz with a modified HPF. Suitable
Finally, pressing SCAN again saves the selected values AD9851 modules are available from the same sources as
and starts the scan. The display now reports SCAN instead the AD9850-based module.
of the number of steps. Adding other modulation modes such as FSK and BPSK
The scanning frequency increment is calculated by the is also feasible, but adding QPSK, for example, may be be-
yond the reach of this design.
Moving to an even more advanced DDS device, such as
one based on the more modern AD99xx series chips, could
be done. However, this would substantially increase the
overall cost and complexity of the device.
It is also possible to replace the basic passive output
variable attenuator network with a more elegant PIN-
diode-based system.
This involves using components that are more difficult
to obtain, but sufficient space has been left in this area of
the PCB for such an addition.
Finally, you could consider adding a numeric keypad
on the front panel to permit the direct entry of frequen-
cies, tuning step and scan settings, plus you could add a
settings memory for frequently used configuration.
However, this would likely require a processor change,
or potentially even an additional microcontroller for han-
dling keypad entry, to obtain the necessary spare I/O pins.
Fig.13: measured performance of the high-pass filter Having said all that, the design as presented is a good
comprising inductors L1-L3 and four small ceramic
capacitors. As you can see, the response is pretty much
compromise between low complexity and cost, while still
flat from 70MHz to 400MHz, but signals from 0-40MHz are having a useful frequency range and a good set of features.
attenuated by 60dB. The transition is smooth and quick, at It makes a great entry-level RF signal generator – a ‘must’
around 75dB/octave, or 2dB/MHz. for anyone interested in radio at any level!

34 Practical Electronics | July | 2020

You might also like