Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 31
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
One birthday today, congrats!
uzzors2k (35)


Next birthdays
03/29 GrantX (34)
03/30 Adam Horden (39)
03/30 Mr.Warwickshire (23)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: General Science and Electronics
« Previous topic | Next topic »   

Frequency counting without a microcontroller

1 2 3 4  last
Move Thread LAN_403
ragnar
Sat Apr 21 2007, 06:42AM Print
ragnar Registered Member #63 Joined: Thu Feb 09 2006, 06:18AM
Location:
Posts: 1425
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.


Back to top
Sulaiman
Sat Apr 21 2007, 06:58AM
Sulaiman Registered Member #162 Joined: Mon Feb 13 2006, 10:25AM
Location: United Kingdom
Posts: 3140
Very nice,

except for the reference frequency generation,
a quartz crystal oscillator would be more accurate/stable.
Back to top
Hazmatt_(The Underdog)
Sat Apr 21 2007, 08:41AM
Hazmatt_(The Underdog) Registered Member #135 Joined: Sat Feb 11 2006, 12:06AM
Location: Anywhere is fine
Posts: 1735
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?
Back to top
Dr. Who
Sat Apr 21 2007, 10:34AM
Dr. Who Registered Member #326 Joined: Sat Mar 18 2006, 01:12PM
Location: Glasgow, Scotland
Posts: 66
Cool design. You could divide down a 32.768 KHz crystal to get a nice stable 4 Hz reference signal.
Back to top
ragnar
Sat Apr 21 2007, 10:39AM
ragnar Registered Member #63 Joined: Thu Feb 09 2006, 06:18AM
Location:
Posts: 1425
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. :)
Back to top
Ken M.
Sat Apr 21 2007, 03:04PM
Ken M. Registered Member #618 Joined: Sat Mar 31 2007, 04:15AM
Location: Us-Great Lakes
Posts: 628
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.
Back to top
Hazmatt_(The Underdog)
Sun Apr 22 2007, 12:59AM
Hazmatt_(The Underdog) Registered Member #135 Joined: Sat Feb 11 2006, 12:06AM
Location: Anywhere is fine
Posts: 1735
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.
Back to top
Ken M.
Sun Apr 22 2007, 01:10AM
Ken M. Registered Member #618 Joined: Sat Mar 31 2007, 04:15AM
Location: Us-Great Lakes
Posts: 628
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.
Back to top
ragnar
Sun Apr 22 2007, 01:14AM
ragnar Registered Member #63 Joined: Thu Feb 09 2006, 06:18AM
Location:
Posts: 1425
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
Back to top
Ken M.
Sun Apr 22 2007, 03:12AM
Ken M. Registered Member #618 Joined: Sat Mar 31 2007, 04:15AM
Location: Us-Great Lakes
Posts: 628
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.
Back to top
1 2 3 4  last

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.