Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> Displaying Clock Frequency, Using a 7-segment display for frequency
Berry
Posted: September 16, 2017 09:55 am
Reply to this postQuote Post


Newbie
*

Group: Members+
Posts: 3
Member No.: 41,057
Joined: September 16, 2017




I'm in the process of building some tools to further my digital electronics experimentation. I have a series of projects planned of increasing complexity. But I'm having trouble conceptualizing some of the steps I'll have to take to get to a nice polished version of one of these tools.

I'm currently designing two generations of a digital signal generator. The first has been prototyped and is in the process of being PCBed. For outputs, it has a bounce-free single-bit signal and a clock signal. The clock is switchable between a manually-actuated one-shot and a pulse train of roughly 1KHz. The frequency is adjustable via potentiometer. For a visual indicator of clock speed, I'm using a divider / counter feeding an array of LEDs.

The eventual goal is to have a more sophisticated version that outputs several bits (at least 8, switchable via DIP array), and to replace the pot with a dpot and a couple of tact switches. At that point, I'd like to set up a more advanced clock speed indicator and use a set of 7-segment LED displays to read out the actual frequency. And I really don't have any idea how to accomplish that. My google-fu keeps landing me on pages with designs for digital clocks, and that's not exactly what I'm going for.

I'm not asking for an outright design of this subsystem, but I'd like to get my hands on some resources that can show me the way. Any ideas? Thanks in advance.
PMEmail Poster
Top
Berry
Posted: September 16, 2017 02:20 pm
Reply to this postQuote Post


Newbie
*

Group: Members+
Posts: 3
Member No.: 41,057
Joined: September 16, 2017




With the benefit of a night's sleep and some coffee, I have gained a bit of clarity.

What I need is a frequency-to-voltage stage, followed by a voltage-to-BCD stage. (I'm checking out the LM2907 / LM2917 now.) However, it would be simpler to convert frequency straight to BCD, which was my original thought.
PMEmail Poster
Top
Sch3mat1c
Posted: September 16, 2017 03:11 pm
Reply to this postQuote Post


Forum Addict ++
Group Icon

Group: Moderators
Posts: 20,541
Member No.: 73
Joined: July 24, 2002




Nah, F-to-V is inaccurate -- why go through the analog hole, when you can keep it precisely digital?

What you're missing is a counter. Connect your clock to a counter. Within a well defined counting window, count the number of clocks. Simple as that. smile.gif

The window is another clock source, which is precisely known. Usually, it's the overflow from another counter which divides, say, 1MHz from a crystal oscillator down to 10Hz or 1Hz. Every time the window signal goes high, copy the frequency counter to a register (which goes into binary-BCD and BCD-7seg logic), then reset the counter to zero. (Note that that exact process is a little tricky: if the window is a square wave at exactly 10Hz -- so your display reads out 10x in Hz -- you don't have any time to copy the counter's value, THEN reset it, THEN continue counting. Ideally, you'd add some control logic that sequences these events, and the window signal won't be precisely 10Hz, but very slightly slower to include those events. It might also not be a 50% square wave, but just a short series of pulses. In that case, the majority of the time spent waiting is called the gating time. Which is to say: as long as the counter is held in reset, it's not counting, it's gated off.)

You can do this with discrete logic, but it's kind of annoying (lots of chips), and rather old fashioned. There are single chip solutions, like the ancient ICL7xxx family. I forget exactly which one was the most popular (7107?), but this is an example:
https://www.intersil.com/content/dam/Inters...cm7216b-16d.pdf

Nowadays, you'd do it with a small FPGA, or microcontroller. MCUs have the hardware built in (counter with external clock input option), making it especially easy ... if you don't mind doing a little programming, that is.

Tim


--------------------
Answering questions is a tricky subject to practice. Not due to the difficulty of formulating or locating answers, but due to the human inability of asking the right questions; a skill that, were one to possess, would put them in the "answering" category.
PMEmail PosterUsers Website
Top
Berry
Posted: September 19, 2017 05:42 am
Reply to this postQuote Post


Newbie
*

Group: Members+
Posts: 3
Member No.: 41,057
Joined: September 16, 2017




Cool, thanks. That appears to be exactly what I'm looking for. I'll probably do it the hard way at first, though. I've done some work with microcontrollers, but I don't want to dedicate one to such a simple tool.

Mostly I'm working on these to hone my soldering and building skills, but also to eliminate tedious steps in larger projects. I found myself having to make 5V regulated power sources a lot, so I built a couple in project boxes. Same with 12 and 18 (+9 / -9) V sources. I've got a handful of Arduinos and Basic Stamps I can mess with, but they're all earmarked for eventual robotics and sensor projects. So I'll probably try to piece it together with ICL7xxx, with whatever supporting circuitry is required, for the final product, but use an Arduino while I'm learning how to put it together. I bet I have a couple of old oscillators sitting around that I can experiment with.

Thanks again!
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force