Frequency meter up to 100MHz

Short story: I needed frequency meter, so I made it 🙂

Why my own? I found few frequency meters over the internet, but most of them was based on PIC microcontroller (and I hadn’t experience with this type of UC), had range up to 40-50MHz and not so accurate. But making frequency meterer based on well known AVR was difficult because maximum frequency that this chip could count directly is only half of CPU frequency which is 20MHz maximum. So, I needed divider or prescaler. Looking for right prescaler was difficult, all good looking solution was unavailable for purchase or very expensive. At the end I looked into my stock of ‘nice to have’ parts and I surprisingly found 74HC393 chip which have maximum frequency of 100MHz! And from that point everything became easy:-)
From my junk I also digged small, cheap LCD display with serial (SPI) interface, made prototype, and surprisingly everything worked 🙂

Schematic:

Frequency meter - schematic diagram

Frequency meter – schematic diagram

Prototype:

Frequency meter - prototype

Frequency meter – prototype

Design of PCB:

Frequency meter - PCB

Frequency meter – PCB

Making PCB:

Frequency meter - PCB after termotransfer

Frequency meter – PCB after termotransfer


Frequency meter - making PCB in high speed :-)

Frequency meter – making PCB in high speed :-)


Frequency meter - PCB almost ready

Frequency meter – PCB almost ready

Everything assembled:

Frequency meter - assembled, bottom side

Frequency meter – assembled, bottom side


Frequency meter - assembled, top side

Frequency meter – assembled, top side


Because I had problems with analog input not working as expected I left this part without elements, so I have only TTL/CMOS input. As you can see below, it’s sufficient to me:-)

Testing:

Frequency meter - working

Frequency meter – measuring RC controller frequency

Software:
It was quite easy to write first working version. But then appeared that even measuing itself, there was an error. After some checking I found a reason: delay between reading value from divider and internal counter, and clearing it. Error was exactly equal to number of clock cycles between these two operations. I added subroutine to correct this and it now works much more accurate. There is a possible hazard situation between reading and clearing counters as it couldn’t be atomic operation, so it requires also some fix, but maybe next time 🙂
Right now it just works for me:-)

And one important additional feature I almost forgot to mention: it outputs current frequency value also via serial interface 🙂

Eagle files and assembler source code you can download here.

This entry was posted in Electronics and tagged . Bookmark the permalink.

5 Responses to Frequency meter up to 100MHz

  1. Alnoor says:

    Hi
    I would love to make this project, but LCD you are using is not easy to get, most electronic
    stores sell 2×16 lcd’s

    Alnoor

    • majek says:

      Hi Alnoor,

      I’m aware that this lcd I’ve used is quite rare, but at the time I had to build this frequency counter, I hadn’t anything else.
      Some time ago I’ve got standard 2×16 lcd, so it’s possible that some day I’ll do more friendly version:-)

  2. P. says:

    Dzień dobry,
    czy tym miernikiem można zmierzyć częstotliwość na linii o napięciu wyższym niż 5V, np. 12V?
    A co się stanie jeśli podłączę napięcie ujemne -5V? Ulegnie uszkodzeniu?
    Pozdrawiam.

    • majek says:

      Tak jak pisałem, stopień wejściowy na tranzystorze niezbyt działał, a że go nie potrzebowałem, to już dalej tematu nie drążyłem. Czyli obecnie ma wejście tylko TTL. Jakby wejście podłączyć przez jakiś rezystor, to pewnie układ by wytrzymał ujemne napięcia, jak i za duże dodatnie, bo to powinny przyciąć diody zabezpieczające wewnątrz licznika. Teoretycznie im większy rezystor, tym bezpieczniej, ale z drugiej strony za duży albo wprowadzi problem z wysterowaniem, albo obetnie pasmo wraz z pojemnościami wejściowymi układu. No i jeszcze zależy co będzie mierzone. Najlepiej poeksperymentować 🙂

      • P. says:

        Dziękuję za informację. Mierzyć będę głównie TTL, ale czasem może się w projekcie trafić linia z ujemnym napięciem. Bardziej chodzi o to, żeby przy pomyłce w podłączeniu nie umarło. W sumie to zrobię sobie mały zapas licznika :).
        Wyświetlacz kupiony, będę składał.
        Jeszcze jedno. Chciałbym przerobić program do obsługi LCD na HD44780. Czy mogę?

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.