28 November 2016
BUILD IT YOURSELF
This article describes a
piece of lab test
combines a variable DC
voltage reference, a
wave generator, and a
frequency counter. This
project started as a
controlled variable voltage reference (VVR) using just a PIC, a fixed voltage reference,
and a digital-to-analog converter (DAC). The project then expanded to include a
programmable function generator (PFG) that can produce a sine wave, triangle wave,
square wave, etc. I also needed a mechanism to measure the frequency of the
function generator output, so I added a frequency counter capability to the PIC. The
total parts cost of this multifunction tester is less than $150 (includes components,
power supply, cabinet, all front panel parts, printed circuit boards [PCBs], etc.).
A 3-in-1 Tester for
By Jim Teixeira
Post comments on this article and
find any associated files and/or
downloads at www.nutsvolts.com
The key component of the design is the eight-bit DAC0800 digital-to-analog converter shown in Figure 1. The analog output of the DAC0800 is connected to the LM6181 op-amp similarly to
that shown in Figure 26 of the Analog Devices Application
Note AN- 17. The DAC0800 digital input can be
connected either to the eight-bit PIC port D or to the
input/output (tri-state) buss of an eight-bit RAM. As I
describe the design of the tester, the interaction between
the components will become clearer.
At the top left of Figure 1 is a 10 volt (I actually use
two five volt diodes in series) voltage reference that
determines the DAC maximum output voltage. When in
the function generator mode, a front panel level adjust
potentiometer sets the actual peak-to-peak output voltage.
When in the VVR mode, the potentiometer is bypassed
and the PIC sets the output level. The LM6181 is a high
performance amplifier that can output ± 10 volts at ±100
In the VVR mode, the LM6181 input connection is set
for unipolar output by grounding the plus input of the
LM6181 (see AN- 17); the PIC port D is set as an output;
and the RAM tri-state output is turned off so the PIC has
complete control of the DAC0800 output.
If port D is set to binary 00000000, the LM6181
output will be zero volts; if port D is set to 11111111, the
LM6181 output will be + 10 volts. Since there are 256
possible binary numbers between 00000000 and
11111111, there are also 256 possible output voltages.
The PFG mode can be implemented this way by
having the PIC repeatedly output the values describing the
function (for example, the sine wave amplitude values),
but the maximum frequency attainable will be limited
because the PIC — in addition to outputting function
values — must also continuously read the front panel
switches and perform the frequency counter work.
In my design, I decided to offload the PFG DAC
updates to external circuitry: the eight-bit RAM (U4), the
eight-bit counter (U3), and the high speed oscillator. This
PIC is no longer in the repetitive PFG loop and it can
perform the housekeeping duties mentioned above.