cable for the connection to the 3. 5 mm audio jack for the Audio IN. Connection of
the programming port requires a specific connection to the jack as described in
the PICAXE manual. The four AAA battery pack is connected directly to the board
and doubles as the power switch for the circuit. If you like, you can substitute or
add a 5V supply such as from a USB port or other rectified source to power the
circuit without modification to the electronics. The NiMH supply will last about a
week before needing to be recharged.
Figure 7 is an example of the assembled components. The display driver
connects to the back of the display board in a shield-like fashion using SIP headers.
With the driver connected to the display board, the entire assembly mounts to the
upright panel of the document holder, also shown in Figure 7. The two eight-pin
male headers located on the driver board supply the display board with 15 I/O
lines and a positive supply by way of the two headers. Threaded standoffs are used
to attach the display and driver shield to the frame of the document holder.
The Discriminator Software
Software for the
circuit is pretty
straightforward. We
are basically using
the PIC as a low-level resolution
frequency counter. I
began writing this software using the COUNT command to
actually measure the literal frequency. This would work fine
if we were just measuring static tones, but for dynamic
music it turned out to be a little too slow. The alternative is
to use the PULSIN command which measures the length of
the incoming pulses and produces a corresponding
number between zero and 255. This is less graceful but at
the end of the octave sampling day, achieves the same net
result. You just have to be willing to translate your target
frequency range initially into their corresponding 256 bit
■ FIGURE 6. Wiring connections
to the driver board.
values, and then use that translated value in your
conditional statements. This is actually easier than it
sounds. To translate the output using the PULSIN
command, start a DEBUG window and input a
frequency to the PIC using the following example code:
DO ; begin loop
PULSIN C.6, 1, W0
; measure the frequency on pin C.6 and put
; result in variable W0
DEBUG W0 ; start DEBUG monitor
■ FIGURE 7. Display and driver board connecting to the
front of the document holder.
The DEBUG window will show a list of all your
variables. If the input frequency was 2,400 Hz, the
translated value of 19 is what got stored in W0 as shown
in Figure 8. Instead of using the actual frequency in Hz
for the octave range, you would record the translated
value for both the low and high end of the octave range
and then use those values in your conditional
statements.
The software that accompanies this project already
November 2013 37