Frequency Counter

SgtWookie

Joined Jul 17, 2007
22,230
That PIC freq counter is pretty nice, Mark.
Converting it to use a USB port would make it viable for a number of years to come, as RS-232 is legacy and no longer included on most newer PC's.

Might be able to use an RS232 to USB adapter, but would the Realterm software recognize that?

Yako,
Programming in C or Basic can add a lot of overhead due to library calls, and usually results in "code bloat". The PIC16F628 doesn't have an abundance of program space available, so the code needs to be pretty compact.

Rewriting it in C or Basic would not necessarily improve the portability, as PICs have lots of hardware differences between the various models.

I would like to see much more documentation in the assembler code though.
 

Thread Starter

Sparky49

Joined Jul 16, 2011
833
Thanks for the replies guys, I'm afraid I've no experience with PICs, so I'm try to avoid that route which is hard!

Don't worry, I'll be asking about PICs very soon!;)
 

Yako

Joined Nov 24, 2011
245
Yako,
Programming in C or Basic can add a lot of overhead due to library calls, and usually results in "code bloat". The PIC16F628 doesn't have an abundance of program space available, so the code needs to be pretty compact.
It can yes, but it often depends on the programmer.

You can do a lot with C and a PIC16F628 despite what some will say.

I got a bit of a congrats at first on the mikroC forum where I posted that LED star project.

The PIC16F628 has close to 50% of code space still remaining.

I only used very common libs like delay(n);

Most of the program is raw and from scratch.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
I understand you Sgt. Sparky wants to learn how to design a system using standard ICs which I will be happy to provide.
You're going to provide the ICs? Or the design? Or both?

Your statement has me rather confused.
If Sparky wants to learn how to design a system using standard ICs, then he should design it.

I guess you mean you are going to provide the ICs?

But, it also sounds like you're going to draw the schematic diagram...

At any rate, 4000 series and 74 series really shouldn't be mixed. 4000 series is relatively slow, but very economical on power and can tolerate a wide range of voltages for the supply. However, with the output being an LED display, power economy kind of goes out the window ... so that doesn't make much of a difference.

The only reduction I will use is a combination 4511 latch/driver which will simplify the wiring a bit.
With a 4543/4553 combination, you need 2 ICs, 3 transistors, 3 caps and 11 resistors per 3 displays. With the 4511, you need 6 ICs, 6 caps and 21 resistors per 3 displays. Which combination requires less wiring?

(This does not include decimal point selection if desired).

This is very similar to the schematic Bill posted at post #28.

http://forum.allaboutcircuits.com/attachment.php?attachmentid=35543&d=1319221510
Yes, I saw that. Lots of parts.

This is a design exercise.
I still don't know - is it a design exercise for you, or for Sparky?

The Intersil ICM7226 is a single chip 8-digit 10MHz Frequency Counter if you wish to go that route.
I used to have a couple of those; actually got so far as designing a board for it. Unfortunately, I had the wrong displays for the IC, and didn't want to get others, so I inverted the output logic - would up to be a bit more complex than I wanted.

I scouted around a bit, but can't seem to find them at reasonable prices. $23 USD is the best I've found, and they're 15 GBP in the UK. You just about can buy a meter with a built-in frequency counter for that.

The absurd thing is a single PIC with an LCD running on a couple of batteries would be less expensive, more compact, and have more features than any of the solutions so far.
 

THE_RB

Joined Feb 11, 2008
5,438
A google search for "PIC based LCD frequency meter" brought up heaps of simple projects.

Here's a nice one, that is not much more than a PIC chip and and LCD and some switches;
http://www.hamradioindia.org/circuits/fcountlcd.php



And if you want a nicer one with more features (that can also be bought as a kit);
http://hem.passagen.se/communication/fcntlcd.html



And of course you should check out multimeters on Ebay or in the stores. Many digital multimeters now have a frequency meter built in. That might be a good investment. :)
 

MrChips

Joined Oct 2, 2009
30,824
For beginners who want to play and learn about digital electronics, here is a simple circuit to get you started. This is a single stage decade counter (0-9) followed by a BCD decoder/driver feeding a 7-segment LED display.



Notes:

1. The part numbers for the counter is 74LS160 and the decoder/driver is 74LS47. You may substitute ICs from other 74xxx series family (staying with ICs in the same family).

2. There are two basic types of 7-segment displays, common anode and common cathode. You cannot interchange these. Make sure you use the correct one. The ones used here are common anode. Substitute with similar displays. The pin assignments are fairly standard but always check before using.

3. The input pins 1, 7, 9 and 10 on the 74160 should be connected to +5V.

4. The input pins 3, 4, and 5 on the 7447 should be connected to +5V.

5. Pin 3 on the 7447 is the LAMP TEST function. Connect this to GND temporarily and all the LED segments should be lit.

6. Note that pin 8 (GND) and pin 16 (Vcc = 5V) on both ICs are not shown in the schematic.

7. Use a 555 timer oscillator at 1Hz to feed the CLOCK INPUT at pin 2 of the 74160.

8. The resistance R value is chosen depending on the efficiency and brightness of the 7-segment LED displays. Typical value is in the 330-ohm to 1K-ohm range. A lower value will make the display brighter.

9. WARNING: If you accidentally short any of the LED pins to GND, you will blow that LED segment.

10. Finally, take a photo and post to show us your efforts.

There are quite a number of little projects you can do with this little circuit and so much to learn from it.
 
Last edited:

MMcLaren

Joined Feb 14, 2010
861
That PIC freq counter is pretty nice, Mark.
Converting it to use a USB port would make it viable for a number of years to come, as RS-232 is legacy and no longer included on most newer PC's.
I agree... The usb-to-serial adapter pictured below is quite a bargain at less than $3, including shipping, from China.



Now you have power and serial connections for a simple Serial 50-MHz Frequency Counter...




 

Attachments

Last edited:
Top