MAIN SITE HOME
Technical Tips

LCD FREQUENCY COUNTER
see also TFT Counter , LED Counter

Updated 3/4/2017
Counter uses PIC16F628A . Included C code and circuit diagram. The LCD and driver module is a 2 lines 16 characters, it has 14 way connector. The LCD is driven by 4 bits data bus.
The frequency is displayed on line 1 by 7 digits with leading zeros removed down to 3 digits. Signal input is a TTL type. The time base is generated by the 32768Hz crystal oscillator.
The CPU frequency is 4MHz from the internal oscillator.
The counting resolution is 1 Hz for frequencies up to 1 MHz and 8 Hz for frequencies over 1 MHz.
The counting is first for a period of 1 second with resolution of 8 Hz and if the frequency is over 1 MHz it is displayed. If the frequency is less than 1MHz the counting is repeated for a period of 2 seconds with resolution of 1 Hz and then displayed.
I tested the counter at up to 2MHz, I don't have the means to test higher frequencies.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).

ARDUINO LCD FREQUENCY COUNTER
see also Frequency Counter for ANDROID

The Arduino generates an accurate 1 second time base for the counter by cascading timer0 and timer2. The link between digital inputs 3 and 4 connects the output of timer2, 250 Hz, to input of timer0. The software waits for the output of timer0 to go positive to start the count of frequency input to timer1. Timer1 is a 16 bits timer, it overflows at the count of 2 power of 16, that in turn advances over-flow register. At the end of the 1 second the 16 bit register is recorded. The Arduino then calculates the frequency and period and displays them on the LCD.
LCD display and driver has 14 way connector, 10 connections are used, 4 bits data bus is selected. There is a big selection of LCD modules, and they are very similar in characteristics . The LCD module has to be HD44780 compatible.
The frequency input is TTL signal levels, for low signal a video amp has to be added. The spects recommend input up to 6 MHz, I tested it at 2 MHz.

You are free to use the circuit diagram and the software with no limitations.

Circuit Description
See also Technical Tips

The crystal is a low power 32,768 Hz watch crystal.
Supply is 5V +/-10%. Input signal is TTL levels.
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
LCD display and driver has 14 way connector, 10 connections are used, 4 bits data bus is selected. There is a big selection of LCD modules, and they are very similar in characteristics i.e. DM1601, ACM1601.
Vss - Supply GRD.
Vdd - Supply 5V
Vo - Contrast Adjust
RS - Register Select
R/W - Data Read/Write
E - Enable
D4-D7 - Data Bus Lines