|XR-2206 Function Generator|
Part 2 ~ The Frequency Counter
The 8-digit 7-segment LED display circuit is very simple and straightforward. An ATmega328 microcontroller uses an Arduino library (FreqCounter) to count the rising edges of the +5v square wave pulses from the waveform generator at digital pin D5.
I tried several different Arduino frequency counter libraries and they all use more-or-less the same principle of setting up an ATmega328 internal 16-bit counter and measuring the pulses on pin 'T1' - which maps to Arduino pin D5. Luckily, it's all taken care of in the FreqCounter library.
The counter works reasonably well but, being implemented in software, there is a one-second delay between frequency measurements so isn't quite as responsive as a hardware implementation might be.
I'll show a simple PCB layout on Page 4.
One slight problem with the specified LED display module is that it's supplied with the pin header already soldered in place and, as it faces forward, it would make mounting the display flush with the front panel difficult. One solution would be to ignore the pin header and solder wires directly to the back of the PCB.
I took a chance and desoldered the pin header and fitted a new one facing to the rear. I say "took a chance" because plated-through holes can be difficult to desolder. It's easier if you cut off the header's black plastic spacer/separator so you can deal with each pin one at a time.
The Arduino Sketch