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.

Frequency Counter Using PIC 16C54

Status
Not open for further replies.

Musicmanager

Well-Known Member
Hi Guys

I want to build a Frequency Counter to go with a Function Generator from schematics I found on the net. The FG is no problem now I've identified some of the components I didn't recognise, however, the FC uses a PIC 16C54 IC which I'm guessing will require a .hex file. I've tried contacting the author but there has been no reply although the website is quite old so that may not be surprising.
Remembering I'm a complete novice and writing code is way beyond my understanding or ability as yet, is there likely to be a code library somewhere that will have a copy, given that these units were once very popular ?
Any other suggestions that don't involve a cliff with a long drop or the fast lane of the motorway would be well appreciated.
Thanks

S
 

Attachments

  • el-freq-counter.pdf
    29.7 KB · Views: 307
There are dozens of schematics of how to use a PIC as as freq counter on the web. I would go for a more modern PIC. Some of the articles had downloadable code...
 
Hi House,
Thanks for that link, I did see that one and had a reasonable look through. My knowledge limit is a serious handicap at the moment and I must confess there were many bits of that one I didn't understand so I chickened out of it. That's also why I went for the other one because I understand all but the code which should be available somewhere.
I'll download again and spend some time at it.
Thanks for your help
S
 
If you manage to contact the author, most probably he is going to be a very OLD man.
 
LOL, that's two of us then.

Guys, please drop the topic - I'll do some research into the suggestions already received.
I don't want to waste your time and lose your goodwill.
Thanks
S
 
Hi House,
Thanks for that link, I did see that one and had a reasonable look through. My knowledge limit is a serious handicap at the moment and I must confess there were many bits of that one I didn't understand so I chickened out of it. That's also why I went for the other one because I understand all but the code which should be available somewhere.

The 16C54 is a seriously OLD device, and is only OTP (One Time Programmable) - it's also unlikely to be supported by any remotely modern programmer.

The better example given above uses a somewhat more 'modern' device, and is easy to program - it's based on a VERY old application note from MicroChip, updated to use a 'newer' chip and an LCD display instead of the original LED one.

Incidentally, I also have the exact same frequency counter, which I ordered as a kit long ago.
 
Yes but its on a 32khz crystal.... I'm sure the same design will do 50Mhz plus.... on a 4Mhz crystal....

You've presumably not looked any closer :D - it already runs at 4MHz (using the internal 4MHz oscillator), the 32KHz is just for giving a 1Hz period.

As it's purely a software counter it can't reach the higher speeds of the hardware counter of the other example, which uses a direct input to clock the counter inside the PIC (which is what gives the more than 50MHz capability). It also used a 'sneaky' method to manually clock the counter in order to read the half that you can't read directly.
 
Nigel said:
You've presumably not looked any closer :D - it already runs at 4MHz (using the internal 4MHz oscillator), the 32KHz is just for giving a 1Hz period.

You are right I didn't look any closer... But as the input is directly into T0k1 the internal timer could theoretically count much faster.... Anywho, I didn't see a speed specification in the OP's first post.... I only suggested a counter where the hex file is available and the author is a member of this forum!!
 
Beautiful hot discussion, brings the best out of people. I think this is one of those rare cases where both sides are right.
Musicmanager, is your generator for audio frequency range? LCD modules are easy to use and don't need extra supply. In the future you'll be able to add to them text messages and voltage reading.
 
Last edited:
Morning Guys

Let me explain .. .. I'm a complete novice - ignorance is prolific !
I'm enjoying exploring electronics as a new hobby in my retirement. I've done some basic projects successfully and recently I completed a precision timer system to operate a bank of machines in my son's business ( See pics attached)
I felt the need to understand when and how to use an oscilloscope so with help from here I acquired an old CRT scope which I stripped down and cleaned and all works perfectly. I found a schematic for a function generator which I've ordered parts to build and the same plan included a schematic for a frequency counter which I thought I could hook up to the 'scope and probably help my understanding. This plan is very old and involved a PIC 16C54 but no .hex file. I am incapable of writing software as yet so I asked if anyone knew of a source, hence the posts about alternatives.
As for what I need it to do or not do - I dunno - and since it's only an experiment of mine to try and extend my learning and understanding I felt the debate was getting far too involved and wasting a lot of people's time which is a pet hate of mine.
I'll pick one of the alternatives suggested based on how much I understand and build it into my function generator box perhaps.
Thanks for everyone's help
S

Dryer Timers 1.JPGDryer Timers 4.JPG Dryer Timers 6.JPG
 
If Nigel has the exact same counter, no doubt he will have the hex to go with it!

BTW... You are not wasting any of my time.... Viewing and posting here is totally optional... If I reply it's because I'm genuinely interested in helping you.... I should imagine this will be the attitude of all who reply..

Don't worry about Nigel and I ranting... It happens all the time... He's been doing this a hell of a lot longer than me and consequentially knows a lot more.. After his post I downloaded the code and realized that he was correct....
 
Do not worry. Anyone answering questions, not only yours, is not forced to do so.

What machines (and how) do you control?
 
If Nigel has the exact same counter, no doubt he will have the hex to go with it!

Both the hex and the source code are freely available :D

Don't worry about Nigel and I ranting... It happens all the time... He's been doing this a hell of a lot longer than me and consequentially knows a lot more.. After his post I downloaded the code and realized that he was correct....

Can't beat a nice discussion :D

However, the link you posted is really nice (and I've bookmarked it), but it's nothing like the full PIC frequency counter - which is probably it's biggest advantage, and I'll shamelessly 'steal' parts of the code in the future.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top