Mims Circuit 14. Using Range
1 allows the frequency to be
adjusted within a useful audio
range. Keep in mind that with
the PIC emulating a one-shot,
the pulse width — or period —
is the parameter being
controlled. This means that a
small change in control
voltage at the high frequency
end (lower voltages) will yield
a large change in frequency.
The narrowest pulse width
is about 30 µs, giving a period
of about 60 µs ( 16. 66 kHz),
with a resolution of 10 µs. The
next lower frequency is about
12 kHz, period = about 82 µs.
Note that the period resolution is double
the pulse width resolution.
Another solution for a PIC based audio
oscillator is the NCO discussed in Part 3 of
this series (and shown here in Schematic
5). Although the schematic is for a toy
organ (discussed next), you can replace the
resistor network on pin 5 with a simple
divider or potentiometer.
Mims Circuit 15
Circuit 15 (Schematic 4) shows the
555 being utilized as a toy organ using
different value capacitors to develop the
different frequencies. With all switches
open, the output will be high. As soon as
one (or more) of the switches is closed, the
555 will start to oscillate.
Schematic 5 shows an easy way to
implement a toy organ using a PIC NCO
with the program NCO_Toy_Organ.asm
(available with the downloads). The
purpose of the diodes is to enable the
output by grounding the gate when the
associated switch is closed. Range 0 for the
NCO is the most appropriate for an audio
application: 7. 5 Hz to about 7. 5 kHz. If you
want a higher maximum frequency but still
stay within the audio range, you can modify
the program so that the A/D value is
doubled. This will make the lowest
frequency and step size about 15 Hz, and
the highest frequency about 15 kHz.
February 2018 39
SCHEMATIC 3. PIC 555 voltage controlled audio oscillator.
GRAPH 1. PIC NCO frequency vs.
SCHEMATIC 4. 555 toy organ.