Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Most simple frequency meter?

Status
Not open for further replies.

Spadez

New Member
Hi,

Im new to electronics but Im planning to make a 16f628A frequency meter coded in assembly. In the future I will expand it to be a tachometer with an LCD readout.

Ive been looking on the internet for a while, and there is certainty no shortage of frequency meters, but there seems to be a huge variation in the code and techniques used to make one. I am trying to find out which is the most simple means of creating one that is able to track up to around 180Hz.

As a starting point, can anyone please tell me the most simple implementation of this, and (if you know of anywhere) post a link to a site that talks about using this method, preferably with some example ASM to help me on my way.

Any help would be much appreciated.
 
Thank you for the reply. Is it fair to say this is the most simple implementation then?

How complicated is it to change to 4 line databus instead of 7?

The circuit looks quite complicated. If I were to use a IR beam break system for the input, do you think the pre-amplification would be needed?
 
Last edited:
Thank you for the reply. Is it fair to say this is the most simple implementation then?

How complicated is it to change to 4 line databus instead of 7?

Would there be any need to?.

The circuit looks quite complicated. If I were to use a IR beam break system for the input, do you think the pre-amplification would be needed?

The preamp is to make it a real frequency counter, for logic level inputs it's not required - it comes from a VERY, VERY old MicroChip application note, that used an OTP PIC and 7 segment displays.
 
Good news about the preamplifier.

In my case it would be neccessary because i will be expanding it in the future and wouldn't have enough pins with 7 db's.

Is it a pain to change it to 4db? Is it a case of just changing a line or two or is it a whole rewrite?
 
Hi Eric,

That's exactly it. I spent time googling it yesterday but i'm having a hard time understanding it. I get that it sends it in two 4bit nibbles but the rest of it might as well be French! :s
 
Hi Eric,

That's exactly it. I spent time googling it yesterday but i'm having a hard time understanding it. I get that it sends it in two 4bit nibbles but the rest of it might as well be French! :s

OK,
So its the link that Nigel posted.?
You want to use a 16F628A .? with a external xtal, same frequency.?
Which of the 8 pins do you want to make into 4.??, I assume just the 4 high bits [ high nibble]
Any other features that you need to point out.?


EDIT:
I have downloaded the asm file with the introduction, is that OK, if not post the one you want.
 
Last edited:
Hi Eric,

Yes the one that Nigel posted is the one. Im going with the 16F628A. It will be using an IR beam break sensor for the input to measure frequency of up to around 180Hz.

For the pins on the LCD, I believe if I want to be using 4 pins it will have to be the four high DB's (DB3-DB7). My plan is to put the databus's on pins RB0-RB3 of the pic.

I hope I have supplied enough information (if not let me know), and thank you so much for offering to help.
 
hi spadez,
I have found a 628A version of an LCF meter I converted for a member last year, it works OK.

Just drop off the LC section.
Look at this pdf, it could get you what you want quickly.

Let me know.
 

Attachments

  • LCF[1].pdf
    538.3 KB · Views: 298
Thank you for posting the link. Ive had a look through it, but ive got to be honest it seems quite complicated, especially for a simpleton like myself. Which ever one I go for, be it the one posted originally, or the one you posted, it will need work. I think the simple 16F84 might be easier for me to work with in the future.
 
Thank you for posting the link. Ive had a look through it, but ive got to be honest it seems quite complicated, especially for a simpleton like myself. Which ever one I go for, be it the one posted originally, or the one you posted, it will need work. I think the simple 16F84 might be easier for me to work with in the future.

hi,
The 628A version I have on file, was converted from a 16F84 originally as well.
I will post a cut down version of the circuit diagram.

EDIT:
Cut down version showing Frequency circuitry only. [+psu]
You cannot get much more basic than that.:)
 

Attachments

  • FreqMtr1.gif
    FreqMtr1.gif
    22.7 KB · Views: 368
Last edited:
Hi 3v0. Ive looked at the link, the hardware looks simple, but the source code is huge. Im trying to keep this minimal hardware, minimal source code. Even though it fits the requirement perfecltly, its going to be too complicated to build upon.

Eric, my concern was more for the source code, since the one you posted has additional features, it seemed like it wouldnt be the most simple implementation. However, if you think its easier to use that and strip it down, rather than build the other code up, then i dont mind going down that route.
 
Hi 3v0. Ive looked at the link, the hardware looks simple, but the source code is huge. Im trying to keep this minimal hardware, minimal source code. Even though it fits the requirement perfecltly, its going to be too complicated to build upon.

Eric, my concern was more for the source code, since the one you posted has additional features, it seemed like it wouldnt be the most simple implementation. However, if you think its easier to use that and strip it down, rather than build the other code up, then i dont mind going down that route.

hi,
Look at my EDIT.
 
Hi. That looks really good, thank you for doing that for me. Can I ask what the IC2 is for? Also, how would this be adapted to use a IR beam break system as the input frequency? Would it be as simple as putting the IR receiver on pin 12?
 
Last edited:
Hi. That looks really good, thank you for doing that for me. Can I ask what the IC2 is for? Also, how would this be adapted to use a IR beam break system as the input frequency? Would it be as simple as putting the IR receiver on pin 12?

hi,
IC2 is a +5V voltage regulator, its connected to a 9V battery.
If your IR receiver output is at TTL voltage levels ie: ~ +5V and 0V and its NOT encoded, it will count the pulses.

At the low frequencies you mention, its quite easy to amplify the analog signal from a IR detector.

When you make your mind up how you want to proceed let me know, I will help with the project.
 
Hi Eric,

Yes I have been told that my simple IR receiver (Which is nothing more than a LED look device really) works at TTL voltage.

The next stage is to create an asm file, which is the most simple implementation of an LCD freq counter. I say that I want it to be simple because I want to build upon it in the future, and if it is over complicated, it will make this a bit difficult for me. Would you recommend using the code recommended in the second post, or is there another starting point you have in mind for the asm?
 
Last edited:
Hi Eric,

Yes I have been told that my simple IR receiver (Which is nothing more than a LED look device really) works at TTL voltage.

The next stage is to create an asm file, which is the most simple implementation of an LCD freq counter. I say that I want it to be simple because I want to build upon it in the future, and if it is over complicated, it will make this a bit difficult for me. Would you recommend using the code recommended in the second post, or is there another starting point you have in mind for the asm?

hi,
I have had a quick look at the work I have done previously on counters and I could post a circuit diagram and asm code for a frequency counter by tomorrow, I will keep simple.
If you want to go that way, let me know, yes or no, so I dont waste my time [ the weather in the UK is sunny and warm , don't want to waste it]
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top