Dear Pictron,
I have written a pbp program for the frequency counter by using 16F628. I have used TMR1 which is working as 16 bit.
The first trick is the TMR1 which is working on the back I mean it is not related with your program. The second trick is to use fixed periods such as 1000 ms - 100 ms - 10 ms - 1ms for counting and making sampling during these periods. The only problem with PBP is the timing. I have used pause command but I have seend that it is not enough precision to use that command and I decided to use a timing section written in ASM language.
I made a very good frequency counter which is working also as auto range. There are 4 different measuring mode on counting the frequencies between 0 and 40 MHz.
- 0- 65 KHz, Mode 0 , 1000 ms sampling period
- 65KHz-650 KHz , Mode 1, sampling period 100 ms.
- 650KHz - 6,5 MHz Mode 2, sampling period 10 ms.
- 6,5 MHz - 40 MHz, mode 3, sampling periode 1 ms.
I used also one divider (U664) for counting frequencies between 40 MHz up to 1200 MHz and one switch was selecting the inputs as LF and HF.
If you have enough knowledge you can write your own program with these instructions.
ERO




Bookmarks