Frequency counting without a microcontroller

ragnar, Sat Apr 21 2007, 06:42AM

Hi all,
here's an unconventional frequency counter circuit I've designed. I'll try and explain how it works:
(This circuit does not include a prescaler)

A schmidt-triggered inverter gate is used as a relaxation oscillator. You adjust R and C to get 512Hz. I call this signal "REFERENCE" because the displayed frequency will be proportional to this.

The 512Hz REFERENCE signal is divided by 128 using a CD4024 7-stage divider chip to give a 4Hz signal. I call this "REFRESH", because this inherently defines the refresh/readout rate of the LED displays.

I take REFRESH and squish it down from a 4Hz squarewave into a 4Hz pulse with a pulsewidth of more than 200nS. This is done using my pulse-squishing circuit; a diode, resistor, capacitor, and another schmidt-triggered inverter gate. The resulting pulse is called "RESET" because for those 200nS, the display will go blank and the counter will reset to zero.

I take the positive edge of RESET, and allow it to positively trigger another schmidt-triggered inverter (with the input floated at V/2 so it maintains its state). I take the negative edge of REFERENCE, and allow it to negatively trigger the same gate. The output of this gate is now the "INHBIIT" signal.

To count frequency:

Say we are measuring a 1MHz signal with no prescaler:

1) The "reset" pulse hits the counter, blanking the display and resetting it to zero. I will consider the 200nS infinitesimally small for purposes of clarity.
2) The positive edge of the same "reset" pulse "uninhibits" the CD4026s and they start counting.
3) The negative edge of the next "reference" pulse "inhibits" the CD4026 and they stop counting.
The CD4026s will have counted (1/512) * 1,000,000 pulses, and the clock will end up displaying "1953"
4) The clock will hold and display that value for 1/4 of a second, until the process repeats.

Now, to calibrate the frequency counter, you tweak the frequency of the reference oscillator (which affects the display refresh rate too, but who cares) until the display reads the appropriate value.

You can add a prescaler for higher frequencies. I recommend a CD4020 or a 74LS93.


Re: Frequency counting without a microcontroller
Sulaiman, Sat Apr 21 2007, 06:58AM

Very nice,

except for the reference frequency generation,
a quartz crystal oscillator would be more accurate/stable.
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Sat Apr 21 2007, 08:41AM

Are there any contrast issues with the 0000 readout then the 1953 readout? What I mean by that is do you see the segments dimly lit?
Re: Frequency counting without a microcontroller
Dr. Who, Sat Apr 21 2007, 10:34AM

Cool design. You could divide down a 32.768 KHz crystal to get a nice stable 4 Hz reference signal.
Re: Frequency counting without a microcontroller
ragnar, Sat Apr 21 2007, 10:39AM

Sulaiman, I cannot use a crystal with my design unless its frequency lines up perfectly with any prescaler and the width of the pulse-counting part of the 'read' cycle. In due course, I may make a version with the pulse-squisher and dividers to bastardize it so it works, but for now, it has to be manually calibrated. I guess that's OK for me, because I don't mind a +/-1% reading.

Hazmatt, I haven't made the circuit yet -- I don't even know if it will work. I'm just doing the PCB right this minute. :)
Re: Frequency counting without a microcontroller
Ken M., Sat Apr 21 2007, 03:04PM

It sounds like it will work and be moderaterly stable, minus maybe having to calibrate it every time you turn it on, but since that won't bother you its ok. As for the PCB desing looks nice except I don't see how your gonna be able to do the white jumpers that in between some pins, also these 3 red traces (I'm presuming) unless they were meant to make contact with those other or you still have some trace editing to do, all in all it looks great and sounds like it'll work.
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Sun Apr 22 2007, 12:59AM

Okay, I'll just sit-tight until you can test it. I'd like to know because every time I did a 4026 design I had that issue.
Re: Frequency counting without a microcontroller
Ken M., Sun Apr 22 2007, 01:10AM

I had a similar problem with my capstone, or final project for college ( It was a clock that displayed miliseconds as well as the usual time frames), even though it was based off a ucontroler, I solved it by doing a "Chained display" (Can't remember the acyual term for it). i.e since the clock displayed 12:00:00:00, lets say the clock showed 12:34:56:78, the actual display would light up 8 then 7 then 6...etc, i believe every display was shown for ~2-5ms, any faster and the display wouldn't light any slower and it would hang on a digit.
Re: Frequency counting without a microcontroller
ragnar, Sun Apr 22 2007, 01:14AM

WhiteArc, it only has to be calibrated once, ever. Then I'll record the values for Rfreq, Cfreq, Rsquish and Csquish, and I will be able to crank them out repeatably. Crystals are also expensive. The CD4026s should be good to at least 8MHz counting frequency, but with a prescaler, they won't need to count that fast.

Dangermouse, a 32,768Hz crystal will cost me a few dollars here, and it is imperative that I significantly change the reference frequency in order to calibrate the meter. (The initial readout value will have a completely arbitrary proportion to the input frequency -- you have to unbastardize it (and the prescaler) by adjusting the timing period)

Those white jumpers I will carefully stretch between pins. The 'red traces' will in fact be actual wires on the bottom of the PCB. At some point in time, when I can make these up commercially and get a double-sided board done, I won't need any links.

Matt
Re: Frequency counting without a microcontroller
Ken M., Sun Apr 22 2007, 03:12AM

Oh ok, I was just concerned about the jumpers because In a tech prep course I took in High school, we had to make PCB's, design, layout, print, etch, and test them, and putting solder points that close to each other just makes me nervous, so I was concerned, but I guess if you know how good you are at doing that kind of stuff then by all means go for it.
Re: Frequency counting without a microcontroller
Bored Chemist, Sun Apr 22 2007, 08:40AM


"Dangermouse, a 32,768Hz crystal will cost me a few dollars here,"
How much would a broken digital watch cost? Also, if, rather than 512 Hz you used exactly 1000Hz derived from a crystal clock, would you need to calibrate the thing?
Re: Frequency counting without a microcontroller
ragnar, Sun Apr 22 2007, 09:40AM

BoredChemist, I understand you are practically- and economically- minded. I am too, but for me that includes repeatability. I cannot use a crystal yet for the simple reason that the counting portion of the timing period is of an arbitrary length. That's how I can get away with doing this with only six chips. wink

OK, perhaps later it may land within 1% of a useful dividable value, then of course I'd spend a couple of dollars on crystals to pretend it has some semblance of accuracy. Until I can tweak the circuit and determine those possible values, I cannot use a crystal. The reference frequency has to be determined after I build it, and it depends on how squished the "ALLOW" pulse is. =)
Re: Frequency counting without a microcontroller
Steve Conner, Sun Apr 22 2007, 10:03AM

The counting period is not an arbitrary length, it's 1/512 of a second, if you ignore the reset pulse from your squisher.

If you replace your 512Hz oscillator with a quartz crystal and divider that outputs 1000Hz, you will get a counting period of 1/1000 of a second, so the display reads directly in kHz and doesn't need adjustment at all. If the pulse from the squisher is shorter than 1 microsecond, the display won't notice it.

If you can find the quartz crystal cheaper than you could find the resistor, capacitor and trimpot, you may still win. And if you want repeatability, this should either work accurately out of the box or not at all... The Schmitt gate oscillator will probably be unstable with changes in supply voltage and temperature. If you can't use a crystal, even a 555 with a good quality plastic film capacitor would be an improvement.

BTW, that trick of using a Schmitt gate as a flip-flop is astoundingly cheeky. I don't think you would get away with it in a commercial product though, because the threshold voltage and hysteresis varies between devices, between batches, and with temperature.

PS: If the reference waveform has a duty cycle of 50%, does the counter only count during the high period? In that case you need 500Hz, not 1000.
Re: Frequency counting without a microcontroller
ragnar, Sun Apr 22 2007, 11:34PM

Hi Steve,
the "RESET" pulse has to be of significant length that it is recognised by the CD4026s... as a result, it will eat into that 512Hz period, so the allow/inhibit period is going to be affected by that.

Yep, that 74C14 is extremely cheeky. ^_^

REFERENCE is a 512Hz squarewave,
REFRESH is a 4Hz squarewave,
RESET is a 4Hz pulse,
ALLOW is a 4Hz pulse longer than RESET and shorter than REFERENCE,
INHIBIT is the inverse of ALLOW.

I have the board with me in Sydney today, so I'll let you guys know what happens as I build it. I have no idea whether it will work, it just looked like a good idea on paper. =)
1177284868 63 FT24079 Freqcut

1177284868 63 FT24079 Freqholes

1177284868 63 FT24079 Freqrear
Re: Frequency counting without a microcontroller
Steve Ward, Mon Apr 23 2007, 04:24AM

Just out of curiousity, why did you specifically *not* want to use a microcontroller? Id been considering a similar project, and id definately be using a microcontroller unless there is some reason not to (nothing that i can see, provided i use a crystal oscillator for higher accuracy).
Re: Frequency counting without a microcontroller
ShawnLG, Mon Apr 23 2007, 04:49AM

"Just out of curiousity, why did you specifically *not* want to use a microcontroller?"
Are microcontrollers expensive? Discrete components are much more cheaper I believe.
Re: Frequency counting without a microcontroller
Wolfram, Mon Apr 23 2007, 05:04AM

Microcontrollers are actually not expensive at all. The PIC16F716 would propably manage the task, and it is under two dollars in smaller quantities from DigiKey. If you buy over 25, it's under the dollar. I'd be surprised if you could make it cheaper with discrete logic, especially considering all the board real-estate you'll save when using one microcontroller instead of 6 other chips. Then you could also make it autoranging, and add other practical solutions, and it would be very accurate. From looking at other PIC-based frequency counters, it could propably do over 50MHz without a prescaler.
Re: Frequency counting without a microcontroller
ragnar, Mon Apr 23 2007, 08:41AM

My two excuses(?) are:
A) I'm trying not to have to get into microcontrollers just yet,
B) All these microcontroller frequency counters seem to use LCDs, which are pricey, here, too.

I'll gladly admit that I've learned a whole lot more by thinking through the circuit and designing it all with logic chips I've never touched before, than I would have by copying somebody elses assembler code (which I wouldn't understand) onto a microcontroller (with a programmer I don't have, nor do I have the inclination to build).
Re: Frequency counting without a microcontroller
Wolfram, Mon Apr 23 2007, 11:25AM

Excuses, excuses.

Here's a simple frequency counter using LED displays. Here's an other one.

LCDs can be very cheap at ebay.

A programmer can be as simple as two resistors.

The argument about learning still holds.
Re: Frequency counting without a microcontroller
Steve Conner, Mon Apr 23 2007, 11:57AM

Meh, you have to learn about discrete logic AND microcontrollers some time, does it really matter which you start with?

I started with discrete logic the same as BP, because I was studying a joint degree in electrical and mechanical, and one of the things they left out of the electrical curriculum to make room for the mechanical stuff was microprocessors.

The most complex thing I built was a coin recognition mechanism for a vending machine, as part of a uni team design project. There were three of us, so we made one sensor each, and I did the control board and display too.

It used all 74 series logic, apart from a large EEPROM that stored a lookup table telling what ranges of sensor outputs corresponded to which coins. We calibrated it by flinging about 100 different coins through, writing down all the sensor outputs, and then typing the ranges we got into a simple C program that spewed out a binary file. We then put this on a floppy disk and took it to the electronics tech who burnt it into the chip for us. Nowadays it would all be done with a 5 dollar PIC programmed from a laptop, and each coin you tossed in would post a LiveJournal entry suprised

The second most complex thing I made from discrete logic was a temperature controlled soldering station: Link2 Again, a 5 dollar PIC would have replaced 90% of the guts of this unit, however it has worked fine since I made it in 1996 and I can't be bothered rebuilding it.

Again, microcontrollers are incredibly powerful and useful, but if you don't understand discrete logic, you may find it harder to understand how the guts of a uC work, which may make it harder for you to program in assembler. (It's just a big heap of flip-flops, gates, and memory.) A knowledge of logic circuits is also very important for working with PLDs and FPGAs.

So I think BP is doing the right thing by starting simple. The only thing I would say is to try not to rely too heavily on one-shots! (that's essentially what your pulse squisher is) Synchronous logic is much preferred over stuff that relies on little RC delays here and there. (Try getting a one-shot on board a FPGA, and you'll see why!)

Anyway, BP, your board pr0n looks great as always, now build it and let's see it working! :P
Re: Frequency counting without a microcontroller
Ken M., Mon Apr 23 2007, 08:12PM

As a matter of fact you can even get samples of Micro controls namely PIC's I have a few, my personal choice for a high res digital display would be the mamoth PIC16f777-17p Its a 40 pin but it can handle driving 8 digits at a very high accuracy, and thats with 7segment displays. As for programming software, you can demo Pic basic and pro at compilerspot.com i think...its been a while and besides I have Picbasic here at home and its great being able to type in basic phrases to run a system. As well as Steve and the others...your board looks awsome shades, you make it, or did you get a PCB manufacture to make it?
Re: Frequency counting without a microcontroller
Steve Ward, Mon Apr 23 2007, 08:50PM

Well, my school is very heavy on digital design (even though its not my area of focus). Now that i know how to program uCs and FPGAs (field programmable gate arrays), i dont think i could ever do electronics without them. Up until about 4 months ago, i think i was right along with you BP... thought i could just manage all the stuff i wanted to do with gates.

Anyway, you are certainly capable of learning these devices, so maybe in a few months you can start the "Frequency counting WITH a microcontroller" thread, where you can discuss the advantages and disadvantages you find with each design wink.

Funny Conner mentions synchronous design... In my digital electronics lab i once got "made an example of" by my TA for BAD design practice for gating a clock signal to one of my flip flops (despite this, the circuit actually did work exactly as required, as i expected). If he saw this frequency counter, i think he'd blow a gasket :P. Personally, while i think true synchronous design (where you dont mess with the clock!) is always better, i dont frown upon little RC tricks and stuff as long as its for your own uses.
Re: Frequency counting without a microcontroller
ragnar, Wed Sept 19 2007, 07:47AM

Well, you might think of this as letdown of the year. Steve reckoned in April that in a couple of months I could have got into microcontrollers. Shamefully, I didn't. I'm still doing it with 40-series logic.

I made this frequency counter once before, and then after assembling it, discovered that the segments on the LED displays I used didn't line up with the datasheet. Wrong datasheet. My fault. I got thoroughly frustrated and tossed the board into my junk projects tray for a rainy day.

Now, in September I needed a frequency counter. Sure, I've got one in my oscilloscope, and I've got one in my multimeter, but for some reason, I wanted to build a signal generator with one in there too. But what actually reminded me was when I saw the newly available BLUE seven-segment LED displays at my store. They're so pretty.

So, I redesigned the circuit, and, without the help of an autorouter, was able to get the four CD4026s connected to the displays, their clocks/carries together, their disp.enbl.in/disp.enbl.outs together, their resets together and their inhibits together, on one layer without a single jumper.

Oh, and because I only have a hand-drill here, everything is surface-mounted. I surface-mounted the chips directly, because if I used sockets I wouldn't be able to get the solering iron tip down between them to solder their legs to the board.

Now I use a CD4060 (with oscillator) to get my "reference" clock. I divide it down, Q10 & Q9 & Q8 & Q7 & !Q6 to give me a the "inhibit" period. I use "inhibit" & !Q5 & !Q4 to give me my "reset" pulse. Now the relationship between reset and inhibit is non-arbitrary, and everything is a lot more predictable and a lot more stable.

The one-off calibration involves tuning the CD4060 oscillator until the numbers displayed match the frequency of your test signal. The display refresh rate will change, but who cares?

The two improvements I made whilst calibrating it were realising that a ~15Hz refresh rate made the "counting pulses" stage almost unnoticable. It might only be 1/100th of a second, but the '0000' segments were juuust momentarily visible. By hooking the "display enable" pin to "inhibit", the display is only turned on when the numbers aren't changing -- with a suitable refresh rate, my eyes' POV makes the display look like it's on all the time. Beautiful.

Now I prescale it as much as I want, and it doesn't matter if it's I use a binary or decimal chip because I can just factor it out by recalibrating. Squee!

Who wants one?

Readout

Scopeout
Re: Frequency counting without a microcontroller
..., Wed Sept 19 2007, 02:25PM

sweet!

It always amazes me that you can cram circuits so closely on a 1layer board (although it looks like you needed a little rework over on the clock generator side...).

As soon as I get a signal generator I will start looking into a decent frequency counter tongue
Re: Frequency counting without a microcontroller
Marko, Wed Sept 19 2007, 06:43PM

Matt those blue displays are beautiful.
Apart from maybe being a bit inaccurate the circuit is cool.
Have you considered to use une of those 32khz watch crystals for reference?
It would add a lot of IC's, though.



My fault. I got thoroughly frustrated and tossed the board into my junk projects tray for a rainy day.

That's why I use donutboards.. and still I find more than enough things to get frustrated with ill
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Wed Sept 19 2007, 07:19PM

I never could get the right frequency divided down because my local store never had the right crystal for a 100Hz reference, so I got some from Mouser. The other frequency counter thread has it, which is like 3.27MHz or something... that's the one you would want to use for your standard.

Glad to see it working! I was wondering how you would solve the missing latch problem.
Re: Frequency counting without a microcontroller
ragnar, Thu Sept 20 2007, 02:01AM

No offense intended, but I did want to compete a bit with your "World's simplest frequency counter" thread.

I mumbled under my breath that it couldn't possibly be simple -- it has TWENTY chips! wink

I just wanted to brag that I could do it cheaper and dodgier with six chips.
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Thu Sept 20 2007, 03:26AM

But Matt, I can do it in 4 and it won't be dodgy, it all depends on what chips you select and how you implement it.

The reason I did the 'sledge hammer to squish a fly' version is for everyone to see how the technology works, and for a few other reasons too:
1. sequential logic
2. latching and how memory works
3. no timing capacitors, its all gated so the only deviation is from the crystal, which by the way could be scaled to 100MHz and in an oven for perhaps 1ppb tolerances.

As far as rock solid design goes, I think that's pretty much there.

I liked the 4026's because conceptually they would do the same job in fewer IC's, so yea I liked them too. But when I found the combination of the 4011 and 4553, I could do a 3 1/2 digit frequency counter that would be rock solid with those from the 4000 family, then use the 4060 with the right crystal, fed to the 4017 as my timing engine, and bam... rock solid in 4 chips. So if you want to beat me, you can try but I think that pretty much sums it up.

Conversely I could use the 4060 and 4017 to generate my timing and send that to the 74C925 and do it in 3 chips if you want to be beat out by 2:1, so its your choice. heh.

I was really interested in the strobe situation though.
Re: Frequency counting without a microcontroller
..., Thu Sept 20 2007, 03:54AM

Using a multiplexed display driver is no fair tongue

I guess we need to change the competition to 'chips not including the display drivers' wink

Also hazmat, I doubt you would be able to get 9 digits out of your design (enough to be able to see the 1ppb stability you quote), due to pratical limitations in the max frequinecy you can use If you run the clock at 1hz (much slower than that and counter wouldn't be very usefull...), and your input frequinecy tops out at 40MHz (although the chips are only reated for 15MHz even at 15v), you stiil only get 7.5 usable digits... Unless you found a way to get subHz resolution with resonable refresh rates that I overlooked.
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Thu Sept 20 2007, 08:49PM

1ppb clock stability is what I was talking about.

Multiplexed driver chips are fair because he's using a divider decoder. If divider decoders aren't fair then what I did is the only 'fair' way to build the counter, 1 chip per function.

Anyway, that doesn't matter, I'm glad to see interest in frequency counting because it requires some thought and I havne't seen much discrete stuff out there that actually works.
Re: Frequency counting without a microcontroller
Marko, Thu Sept 20 2007, 10:46PM

Note that I could do it with a single IC and say it's world's simplest F-counter.

The ghettoness and availability of IC's also competes as I think.
Re: Frequency counting without a microcontroller
Hazmatt_(The Underdog), Thu Sept 20 2007, 11:15PM

You mean this chip? This chip which isn't available from any source even if you try to find it? Unless maybe you by 10 or so from an obsolete dealer. Last time I checked they want $72 each for it.

You could have gotten it ~10 years ago, but now you have to find it from Maxim, if that's even possible now, I don't know.
014f
Re: Frequency counting without a microcontroller
Ken M., Fri Sept 21 2007, 05:27PM

Actually Hazmatt, Maxim makes the chip I believe Marko is talking about, the icl7136cpl. I got 2 of them probably never gonna use them, but hey they WERE FREE samples from the company.
Re: Frequency counting without a microcontroller
Reaching, Fri Sept 21 2007, 07:07PM

Heres my feedback on this thread. its a simple frequencycounter which is small and nice and accurately without using a microcontroller. everyone can build a frequencycounter with a microcontroller. who can build one without ? :P


1190401645 76 FT24079 Frequencycounter1



The circuit uses a funny way to create 10mS count and 10mS display signal with a small reset impulse for the counter decade. the 3,2768mhz from the cristal oscillator is divided by 16384 to get 200hz then divided by 4 to get 50hz lol. well, you can read out the frequency in realtime every 1/50th second :)
Re: Frequency counting without a microcontroller
ragnar, Sat Sept 22 2007, 12:50AM

So, your frequency counter counts with the display OFF for 10ms, and then displays with the display ON for 10ms?
Re: Frequency counting without a microcontroller
Reaching, Sat Sept 22 2007, 08:52AM

right, it counts for 10mS and stops counting, then it displays for 10mS and resets to 0,
Re: Frequency counting without a microcontroller
Experimentonomen, Sat Sept 22 2007, 10:26AM

Whats the range of this counter ?

If its up to atleast 1MHz, can i order one ?
Re: Frequency counting without a microcontroller
ragnar, Sat Sept 22 2007, 12:36PM

Order one?

If I ever get some PCBs made up, I'll let you know!
Re: Frequency counting without a microcontroller
rupidust, Sat Sept 22 2007, 09:03PM

Anders M. wrote ...

Excuses, excuses.
Here's a simple frequency counter using LED displays. Here's an other one.
LCDs can be very cheap at ebay.
A programmer can be as simple as two resistors.
The argument about learning still holds.

Anders is right on all points.
I did it all with discrete components long ago. Decided to evolve and will never look back. This project is nice but is neither new nor rare. I cannot bring myself to waste the board space of and waste 7 (16+ pins) ICs to do what I can do in a day with 1 cheap 18+ pin highly configurable and adaptable microcontroller procured for a few bucks or free from the Manufacturer.
Re: Frequency counting without a microcontroller
Experimentonomen, Sat Sept 22 2007, 09:09PM

Thats if you know how to make it with a pic/avr.

Most of us barely even know what a pic/avr is, nor have the knowlege to program them.
Re: Frequency counting without a microcontroller
rupidust, Sat Sept 22 2007, 09:11PM

Perhaps you 6 or so people ought to run a search for PIC Wiki or AVR Wiki on google before the year is over.
No one was burn with the knowledge of diodes, resistors, capacitors, and ICs. If you choose to learn them, so to may you choose to know beyond them.
Re: Frequency counting without a microcontroller
Reaching, Sat Sept 22 2007, 09:32PM

if theres no need for a microcontroller i wouldnt use one. i have logic ics on hand, and not a single microcontroller. i have no possibility to program one and i have no knowledge about the code in a µC etc. so why is it so difficult to understand that some people just dont want to get into µC´s or do not have the knowledge? i´ve build a frequency counter without a µC and it works fine for my needs, and its cheap. i dont want to mass product them so i think im fine..

Re: Frequency counting without a microcontroller
Ken M., Sun Sept 23 2007, 01:58AM

I look at it as, Do you wanna set up quiet a few parts, or use minimum parts, and learn something new?

Besides uC are very versitile.

But if you wanna use descrete logic over uC, go for it.
Re: Frequency counting without a microcontroller
ragnar, Sun Sept 23 2007, 04:51AM

I didn't intend to open (or argue) the "But you could do this with a microcontroller" can of worms.

The circuit here is a straightforward frequency counter that "anyone" can build with COMMON discrete logic chips, NOT MANY of them, uses COMMON seven-segment displays, and the driver is of reasonable size in comparison to the display.

The simplicity and 'understandability' comes at the expense of some accuracy. **shrug**

Perhaps when I finalize the circuit design, I'll see some it replicated by a few people =)
Re: Frequency counting without a microcontroller
Firnagzen, Sun Sept 23 2007, 07:12AM

I had a rather peculiar thought when reading this topic-

Whitearc mentions having to reclibrate it everytime you use it. Why can't you use itself to measure the frequency of the relaxation oscillator? Or is that a silly idea.
Re: Frequency counting without a microcontroller
ragnar, Sun Sept 23 2007, 07:29AM

I don't know why WhiteArc says you have to recalibrate it every time you use it -- I certainly didn't say that; and you certainly don't have to, thanks.

Yes, it can read its own reference frequency -- this is what I actually used as a test signal through development.

For your interest, though, you can't use the reference frequency to calibrate itself; if you lower the reference frequency, you lower the number of pulses per second that would hit the input. But because it counts pulses for a longer period (because you just lowered the refresh frequency), it will read the exact same figure. If you plug the reference frequency into the input, the display reads "002.4" no matter what the reference frequency is. =P
Re: Frequency counting without a microcontroller
Steve Conner, Sun Sept 23 2007, 10:57AM

I agree that this topic should probably be renamed to "Doing things without a microcontroller that are really best done with a microcontroller". wink PICs count as "common logic chips" nowadays. And once you've learnt how to use them, they open a hell of a lot more options for you in your hobby projects.

That's beside the point though, if Matt wants to write about frequency counters made out of discrete logic, we're not going to stop him! It's all more quality content for 4hv, and the arguments over whether it should have been done with a uC are quality content too. And the blue displays are so sexy!

PS: About recalibration, there is no excuse for a frequency counter with anything other than quartz accuracy. If the accuracy budget depends on a relaxation oscillator in there somewhere, you need to go back to the drawing board! mistrust
Re: Frequency counting without a microcontroller
ragnar, Mon Sept 24 2007, 02:42PM

After the logic rework (which Peter '...' spotted), the revised board layout is a little smaller and even neater. Even just optimizing this was great fun for me.

Here's how it's looking currently.

Who says I etch one to see if I got it right?

1190644978 63 FT24079 3freq2c6
Re: Frequency counting without a microcontroller
ragnar, Wed Jun 18 2008, 05:27PM

I still haven't progressed to microcontrollers, but this one had been smirking at me from my junk pile for too long. I've finished this version to such a stage that it may now be comfortably ignored.

There are two PCBs, the display drivers / counters, and the circuit that buffers the input and generates the appropriate timings to reset / inhibit the counters. Both boards are single-sided, with a five-wire interface connecting them together [ground, inhibit (= dispenbl), clock, reset, vcc].

Both the driver chips and the displays are offensively overdriven and get too hot to touch after minutes of operation; I guess this is why god gave us resistor networks, which I am yet to discover.

Volts into the DC jack on one side, wiggles into the SMA jack on the other side, and the displays show pretty numbers. It drifts horribly with temperature, cost me more than my frequency-measuring multimeter, and consumed hours laying out the board. Case closed.

Back
Front
Side
Bluedisplays
Re: Frequency counting without a microcontroller
uzzors2k, Wed Jun 18 2008, 05:35PM

Cool Matt, your stuff always looks so pro. Btw, where've you been the last two years? I've only seen you here intermittently with just a few new projects.
Re: Frequency counting without a microcontroller
Experimentonomen, Wed Jun 18 2008, 06:11PM

Hey uzzors, matt IS a pro! tongue wink
Re: Frequency counting without a microcontroller
ragnar, Wed Jun 18 2008, 07:12PM

Dr. Srozzu wrote ...

Cool Matt, your stuff always looks so pro. Btw, where've you been the last two years? I've only seen you here intermittently with just a few new projects.

All work and no play makes Matt a dull boy.
Re: Frequency counting without a microcontroller
..., Fri Jun 20 2008, 12:48AM

How bad is the drift on the beast? For most applications even 10% wouldn't be impossibly high (effectivley making it a 3 digit counter).

Glad to see that it is finally working!
Re: Frequency counting without a microcontroller
ragnar, Sat Jun 21 2008, 09:39AM

The drift is pretty bad, about 0.5%, assuming my signal generator is stable. I'll increase the cathode resistors on the seven-segment displays so they draw a little less current; that way the drivers won't go through such a thermal gradient every time you warm it up.
Re: Frequency counting without a microcontroller
Sync, Sat Jun 21 2008, 11:53AM

I have a old east German Counter thats built in complete standard logic, let's see if i can dig a manual. It's quite nice because they implemented quite a few functions, like RPM measurement and stuff like that.

Got it... Click

It's in german but the schematics should be understandable, if someone wants a list of the translated parts (they used the soviet chipnames of course) let me know