For some years I was lucky to use an HP33290A wave generator for my radio building projects, a fantastic instrument for generating all kind of signals up to 15MHz. Since I could not always rely on it and buying one would by far exceed my yearly hobby budget, I decided to build an HF generator instrument myself. It would not come close to the HP33290A in terms of performance, still it was the source of inspiration. I didn’t bother about the features I never used, but added a few of my own, the HF detector part being the most important.
Eventually it became a
firmware controlled stand alone HF generator & detector consisting of
- a DDS controlled HF generator from 1kHz to 16MHz, with a switchable output of
0dBm or -30dBm into a 50Ohm load
- two broadband logarithmic detectors +10dBm to -50dBm (DC to 100MHz) and
- a reflection bridge, a 20dB attenuation “Stockton” type SWR bridge connected
to the above detectors.
The instrument has two basic modes of operation: transfer mode and reflection
mode, where the generator and the detector part are both used. It can obviously
be used as a stand alone HF generator or HF power meter. It is moreover capable
of sweeping a frequency band and of FSK modulation (hamradio standard).
Its user interface consists of a rotary encoder switch, two buttons, and a 4 line by 16 character LCD. It as a COMport interface, to output a string of comma separated values for the frequency and power estimations.
The circuit consists of three parts: the micro-controller, the HF generator and the HF power estimator. See here for the first part of the circuit diagram (controller and power supply) and here for the second part (HF generator and detector part).
The micro-controller,
an Atmega16 (see
Atmel AVR 8-Bit RISC Homepage) in a 40 pin DIL package and clocked at 12MHz,
will serve the serial interfaces of the DDS and ADC chips (3 I/O lines each),
the LM041L LCD module which includes a HD44780 driver chip (10 I/O lines), the
user interface (rotary encoder and 2 buttons: 4 I/O lines), the relay drivers (2
I/O lines) and the COMport (2 I/O lines).
For the latter, a SOIC version of the traditional MAX232 is used to level shift
the signals.
A 5pin header, a few resistors, diodes and one transistor are permanently build
into the circuit for the in situ programming of the Atmega16 with the PonyProg
application (taking another 3 I/O lines + the reset). The use of this technique
is really amazingly easy, just connect the COMport to the circuit (using an
adequate cable), launch PonyProg and manipulate whatever part of the
micro-controller’s memory, the firmware will even spontaneously restart
afterwards.
The current version (not entirely finalised) of the firmware uses less than 30%
of the memory resources of the Atmega16 chip.
The HF generator part
consists of a AD9835 DDS chip clocked at 48MHz by an external crystal
oscillator. The SDATA, SCLK, FSYNC and FSEL lines are controlled directly by
the micro-controller, the latter being used for the FSK modulation. The DDS
chip is set to output 850mVpp in a 220Ohm load.
It is followed by an 7th order elliptical low pass filter with a
corner frequency of 18MHz. The inductors are of standard values and of the
moulded type.
Then comes the output/power amplifier based on the AD8099 high speed video
operational amplifier. This circuit can amplify into the 100MHz region, it is
tamed somewhat to behave from DC to 25MHz. The signal is amplified to 1.25Vpp
at the output of the operational amplifier, which yields 0dBm into a 50Ohm load
at the BNC connector behind a 50Ohm source impedance.
Finally, a switchable 50Ohm T-attenuator yields a –30dB attenuation controlled
by the micro-controller.
The HF detector part
consists of two AD8310 logarithmic broadband detectors connected to a “Stockton”
SWR bridge. The bridge is a quite elaborate mechanical construction for the
shielding, and care is taken to keep all things as symmetrical as possible. Two
FT50-43 toroids are used, the ratio of turns is 1 to 10 which yields an
“attenuation” of 20dB (or 1%) between the power at the input of the bridge
(forward or reflected) and the power at the load resistors. The resistance of
which are designed to keep as close to the nominal 50Ohm as possible using
standard 1% components. The use of RG58 coax as the primary of both
transformers in the bridge creates a Faraday shielding separating the primary
from the secondary (at least from electrostatic coupling), care should be taken
to connect the shield only on one side to the ground.
The choice of the logarithmic amplifiers as detectors elements over the
traditional Germanium diodes is quite obvious in view of their far better
linearity at low signal levels. Their maximum input of +10dBm on the other hand
limits the power in the SWR bridge to +30dBm, which is quite all right as the
build in HF generator will almost always be used as the HF source.
A relay controlled by the micro-controller will switch the input of one of the
logarithmic amplifiers to a separate input, so that direct power measurements
can be made (transfer mode).
Although the AD8310 will work with a 3.3V power supply, it is specified to work
when fed at 5V, its output will never exceed 2.8V though. The output of both
AD8310 are led to a dual channel 12bit ADC, the MAX1286, using the 5V power as
its reference.
The use of a separate ADC rather than the 10bit ADC on board of the ATmega16
chip was inspired by the gain of at least 1 bit in resolution, and the improved
performance for the instrument. The MAX1286 is directly controlled by the
micro-controller through its serial bus.
A cheap battery adaptor of 9V 150mA is used as power source, as a 7805 chip provides clean power to the entire circuit. An RFI filter and additional filter capacitors (ca. 2mF) are furthermore included in the power line.
The firmware consists
of four more or less independent routines:
The 1st is the main routine and contains all the user interface and the LCD
manipulation, it is the biggest part and loops after the initialisation
The 2nd is the modulation routine, an interrupt is generated every 11.11ms and
will shift one 1/2 bit from a Baudot coded message to the FSELECT port
The 3rd is the COMport interface, the TDbuffer empty interrupt will trigger to
write the next character to the UART until the transmit buffer is empty,
The 4th is the key detect and debounce routine, it will validate a key press
The calculation of the
32bit
DDS word from the frequency involves an unsigned 64bit division,
while the frequency and power values
display involve 64 bit and 16 bit binary to decimal conversions.
Quite a number of default values are centralised in the "equates" section of the
source, including the calibration values. If I am courageous in
the
future I
will write some nice configuration interface for each of these parameters.
The Baudot message resides in eeprom and can be modified providing some
manipulation of the code, it is stored as a continuous string of 1/2 bits
values including stop and start bits.
A single Baudot character of 1 start, 5 data and 1.5 stop bits is hence stored
over 15 bits (or 1.875 bytes). The modulation interrupt routine will fetch
bit by bit and byte by byte until the entire message is send and than start over
again. This gives an absolute control over the message, in future I intent
to implement the ASCII modulation scheme at 110 baud as well.
The firmware for the
micro-controller is written in assembler and developed using
AVR Studio 4 (an excellent programming and simulation freeware), click
here for the source file. The device was programmed using PonyProg (see
PonyProg - Serial device programmer).
The main board (double
sided 160*100 mm) contains everything except the DDS and the logarithmic
amplifiers. Regular through hole components were used save for the MAX232 and
the AD8099 (both SOIC components and mounted on the solder side),
see a picture of the top side of the board with the LCD
and without, further a
detail of the SWR bridge.
The component side of the board
is unechted and forms the ground plane, pins of components connected to the
ground are simply soldered on this side. See the pictures of the
component side and the deatails of the
DDS and detector modules.
Two small (stamp size) daughter boards were made to contain the small pitch SMD
components, the first contains the AD9835 (16pin TSSOP package) and the few
associated SMD capacitors and resistors. The other daughter board contains both
AD8310 (8pin MSOP package) and the MAX1286 (8pin SOT23 package, which is really
small) along with several SMD components. The building of these little boards
were the usual exercise in patience involving the use of good lighting, heavy
magnifying glasses, fine tweezers, a steady hand and a strict minimum amount of
solder. All went well as I have no broken components to report. Eventually
both daughter boards were mounted on the solder side of the main board.
All the boards were home made, see
elsewhere on this Web site for some comments about the “manufacturing”
process.
The complete system is housed in a nice aluminium box of 168*103*56 mm in size (Conrad ref. 523232-02), having the BNC connectors on one side and the user interface and power connector on the other side, see picture1, picture2 and picture3. The LCD is visible through a rectangular window in the top plate, see picture4.
The schematics were drawn using the TinyCad freeware, the artwork was draw using the CirCad (free evaluation). Find here a zipped file with the design files containing the drawings in their original format and here a large zipped file with the PCB artwork.
The few measurements on
the HF generator part I did gave the following results:
- frequency accuracy: better that 1ppm, compared with the HP33290A, at room
temperature, after a warm up period of 30min and after a calibration exercise in
the firmware. I hope it will stay like that for a while.
- output level in 50Ohm at the 0dBm setting: better than 0.5dB for frequencies
up to 10MHz, slightly worse, up to 1dB for 15MHz (again compared with the
HP33290A instrument). The 30dB attenuator gives 30.5dB in reality.
- I did a few spot measurements
on the harmonic distortion using one of the HF receivers I have an tuning the HF
generator to 1/2 and 1/3 of the frequency, I found that the harmonic
signals were at least 50db down versus the fundamental.
At the detector side I
came to the following:
- after a two point calibration in the firmware and with with a 7MHz input
signal the tracking was close to 0.5dB from +10dBm to –10dBm) and gradually
worsening to 3dB at –40dBm.
- the frequency response was essentially flat from 100kHz to 15MHz
- the Stockton SWR bridge yields a –32dB reflection attenuation when terminated
on a pure 50Ohm, which is perhaps not so excellent. This may be due to the lack
of symmetry of the bridge or accuracy of the impedances. Still, the result is
better than 1.05 SWR and more than adequate for the tuning of antennas. The
bridge is essentially yielding the same results from 3MHz to 15MHz.
Still to be done in (near) future:
- finalise the sweep function, the real time part is ok, the user interface part
is still work in progress.
- implement a remote control feature, where all settings can be made through the
COMport.
- have a true SWR indication, currently I have a reflected power indication in
dB. Though the formula is fairly simple, I have yet to find a good algorithm
for calculating the power of a value with only additions and multiplications.