2.2.4 Frequency measurementFor using the with the dialog selectable frequency measurement is a little hardware extension neces-sary. The input pin PD4 (T0/PCINT20) of the ATmega is used for the frequency measurement. Thesame pin is also used for the connection of the LCD. With normal layout, the PD4 pin is connectedto the LCD-RS signal, with the strip grid design it is connected to LCD-D4. For both signals thePD4 pin can be switched to input as long as no output to the LCD is required. The LCD respect theinput value only, if the LCD-E signal is switched to GND. For driving the input pin from externalclock source at least one serial resistor of 270Ω should be used. Better you should use the circuit offigure 2.5 . The voltage at the PD4 pin (LCD-RS or LCD-D4) should be adjusted to 2.4V withoutthe assembled ATmega or during frequency measurement of the ATmega, to get the best sensivityfor the input frequency signal. The LCD should always be installed for adjusting, because the pullup resistor of the LCD change the voltage.