This application is a digital frequency counter sampling over a 1s period
and displaying up tp 20.000 kHz.

The output of the pre-scaler is set to 128, the MDM-1 has a 4mhz clock which
is divided down by 4 to give a 1uS period, therefore the prescaler fills after
128uS.  TMR0 counts up from 55, this equates to 200 times  The loop is executed
39 times.  the sample period is 128 x 200 x 39 = 0.9984mS depending on the accuracy
of the xtal.

The limiting factor on frequency is the interrupt loop which I have estimated at
46.5uS.  If this was all written in assembler then a higher frequency could be read.

The input is on RB0.  Although the count is triggered on a negative edge a
pull-up resistor is required. The input is via a schmitt trigger and worked with
a aquare, triangular and sine wave.  If a low level signal is provided then a
amplifier may be needed.  The checksum of the code is E917.

Jal is provided free of charge and is regularly updated.  If you wish to
support the continued development of the code a donation, in dollars, can
be made to Wouter via http://www.piclist.com/support.

