1-32 Khz in 1khz divisions

I need to generate 1khz, 2khz, 3 khz, 4 khz, etc.. up to 32 khz.. They don't have to be exact.. Each free running, each on their own output..

My first inclination was to use counters, but that would be a few counters, prescalers, flip flops, etc because the divisions don't come out nicely. My second idea was to use a microcontroller with a lot of outputs.. E.g. Input A1 gets turned on/off every 1 ms (1 khz)..

Any ideas for an approach?

__________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Reply to
Barry S.
Loading thread data ...

Try 32 binary rate multipliers (BRM)

If you clocked them all with a 32kHz clock, a series of 5-bit wide BRMs could give you anything from 1 out of every 32 pulses to 31 out of 32.

The pulse rate isn't regular. If that is a problem, start off at

1.204MHz, and divide each output by 32, which will give you equally space pulses at every frequency from 1kHz to 32kHz in 1kHz steps.

There used to be a 6-bit BRM in TTL (7497), but I don't think the distributors carry it any more - but it would be easy enough to realise the logic in a programmable device.

--
Bill Sloman, Nijmegen
Reply to
bill.sloman

You need only 16 BRM's for the frequencies of 17, through 32 kHz. The rest you can get with flip flops, dividing those by 2 (multiple times, as needed).

If the tolerances are not too tight (for frequency accuracy and duty cycle), I think you might be able to generate these 16 seed frequencies with a 20 MHz PIC processor and the rest with 8 dual flip flops.

Reply to
John Popelish

If you don't want a bunch of jitter, you're probably stuck with logic of some kind. A microcontroller is not very appropriate for this, although I've implemented similar systems with a few outputs (eg.

0.5/1kHz/2kHz to energize a conductivity probe) with very little overhead and no jitter on a micro- but you need to have a micro with a compare module that can directly control an output pin for each independent frequency you want to generate. You can roughly halve the number of primary frequencies you need by tacking some binary dividers on some outputs (eg. 14kHz will also give you 7kHz), but that's still quite a few micros, maybe 5 or 9 depending on type, plus the external counters. If you just needed a single output or two of programmable frequency, the micro would be a very good choice.

Lowest parts count approach is probably to use a small FPGA, config memory and an oscillator module. That will give you 32 pretty much jitter-free outputs, accurate to better than 0.1%, say, with a 20MHz oscillator, with not much effort and very little board space. A bit costly, though, maybe $25 one-off, but considering the hundreds of flipflops and all the logic, not too bad.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Those are pretty vague requirements. No oscillator is ever exact! (And no vacuum ever perfect...) How non-exact can they be? If it's

+/-20%, then a bunch of 555 astables with RC's may be perfectly reasonable.

Output square wave, sine wave, or what? How much jitter is allowed?

I think the microcontroller is perfectly reasonable if you can live with some jitter. As others have said, making a couple of harmonically related outputs without jitter isn't a big deal. Doing it for 32 outputs that are not divided down from a master can be tricky (if anyone knows a good trick I'm all ears! My back-of-the-envelope calculation indicates the lowest frequency which can be divided down to all of 1..32 kHz is something like 10^18 Hz...)

31 PLL's (e.g. 4046's) would also work with a reference of 1kHz and simple dividers. 10-32kHz crystals are available (some standard values, most custom). I'm thinking there might be some clever way to beat a couple of them against each other and avoid all digital logic, just use a bunch of balanced mixers and make the outputs be widely separated so they are easily filterable. I have done this before (for example beating 32.768 kHz with 32.000 kHz to get 768 Hz... it's easy to filter out the 64.768 kHz nondesired product) with just a few transistors, but extending it to 32 somewhat arbitrary outputs may be too much.

Below 10kHz I think the crystals are officially known as "tuning forks". I've seen them show up in old test equipment, but I think you'd need them custom made.

Tim.

Reply to
Tim Shoppa

Decrementing 32 16-bit counters, checking for borrows or zeros, toggling output pins and reloading each counter. Unless I'm missing something, if it's going to be perfectly jitter-free you can't update faster than the worst case of all that stuff, which sounds like maybe

300-600 instructions to me, so you'd need a 1.2-2.4GHz micro.

If you don't care about a small frequency error AND, say, 10% jitter then it's trivial with a micro, but for a lot of the applications I've run into, jitter is a much more serious defect than a small frequency error.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

If you dedicate the micro, it's not quite so bad.

The OP said "don't have to be exact". Let's assume that the frequency can be off by 125Hz, for a total error on adjacent frequencies of 250Hz (5.125 - 5.875 = 250hz).

What does this buy us? Well, 16*17*18*19*20*21*22*23*24*25*26*27*28*29*30*31*32 is about 10^18, far too fast to clock the micro of course, at least for a few years. So, the question is, what is the minimum frequency that can be a least common multiple for the inexact frequencies. I don't know how to calculate this, so let's work out about what it might be.

32*32.125 = 1026.4

At this point I realised it was too early to be thinking, and wrote a 4 line program to give me the answer. Error Freq

125Hz 2108Khz 75Hz 3356Khz

4Mhz also works for 125Hz, 5Mhz for 75Hz.

So, let's say we have a micro clocked at a multiple of 4Mhz. How much work is needed? It'skpj l

Reply to
Ian Stirling

The application is: I frequently run into 20-30 unlabeled cables that need to be "rung out" .. (This happens far more than I'd like) Usually the way we get through them is done by connecting the conductor and shield and then going through the 30 cables to find which one is shorted. Wouldn't it be so much easier to give each cable its own low frequency signal? So cable #1 becomes 1 khz, cable

2, about 2 khz.. So each time I touch a cable with a frequency capable multimeter, I know which cable I'm on. So, if the frequency is around 2khz, I know I'm on cable 2. 3.042 khz, cable 3. +/- 20% is probably do-able. 555s are perfectly acceptable, except the construction becomes complicated. (I'd need to wire a lot of 555s)

Jitter is a non-issue. I believe most multi-meters will accept a square wave.

The key is -- for 32 outputs (And a buffer/current sink (maybe a

74LS04 or op amp for each), this starts to become a lot of wiring on a perf-board. With enough counters and flip flops, this becomes a nightmare to construct.

Design requirement #1: Simple to construct!

__________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Reply to
Barry S.

Might be possible with 11x 82C53 triple 16-bit counter/timers, clocked up to 8MHz. Use any old uP to set the Mode and load each counter.

--
Tony Williams.
Reply to
Tony Williams

Instead of 32 different frequencies why not send pulses or bursts of a tone... Pulse Coded Modulation.

Then make a receiver/demodulator for the other end of the cabling that decodes the PCM and displays the number.

[Make sure to make your transmitter tolerant of a dead short]

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
"Winners never quit, quitters never win", Jack Bradley Budnik ~1956
Reply to
Jim Thompson

Thinking on it, PWM would be even easier to implement.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
"Winners never quit, quitters never win", Jack Bradley Budnik ~1956
Reply to
Jim Thompson

I designed a product that did this as part of a wind turbine control system.

The wide range of speed of the wind sensor makes this a bit of a challange as when the wind is light the time between pulses may be long so that measuring the time between pulses is the optimum method of determining frequency and then when the wind blows hard the pulses come so fast that measureing the number of pulses in a fixed time period is the best way to go. The product I designed switch between the 2 methods so that best resolution was always in use.

There are many commercial versions of wind instruments made for sailboats. You might check them out. Many do go to data logging devices.

Dan

--
Dan Hollands
1120 S Creek Dr
Webster NY 14580
585-872-2606
dhollan3@rochester.rr.com
www.QuickScoreRace.com


"TomM"  wrote in message 
news:1135609864.033299.274700@g47g2000cwa.googlegroups.com...
>I am looking to datalog a number of signals, most of them analog.  One
> of the signals is a contact closure signal coming from a wind speed
> sensor.
>
> I need a circuit or ic that can measure the frequency of the pulses
> which correspond to speed that then I will put into a datalogger.
>
> Thanks in advance for any help
>
Reply to
John Fields

Its going through 700 ft of coax though.. Too easy to lose a little..

__________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Reply to
Barry S.

Maybe, what do they cost and how large is it?

__________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Reply to
Barry S.

Thats a really good idea... And just measure the diuty cycle..

__________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Reply to
Barry S.

I think duty-cycle, PWM (Pulse Width Modulation), has got to be the easiest to implement.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
"Winners never quit, quitters never win", Jack Bradley Budnik ~1956
Reply to
Jim Thompson

--
Have I got a deal for you!

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=/netahtml/srchnum.htm&r=1&f=G&l=50&s1=4937519.WKU.&OS=PN/4937519&RS=PN/4937519

Want one?
Reply to
John Fields

For $100 you can get one of the Spartan3 starter kits. I'm pretty sure it has enough logic to make 32 adders. Feed the top bit of each adder to an output pin. Pick 32 different constants that you add to each adder and you will get 32 different frequencies. It won't be exact, but it will easily be close enough for your original idea.

The down side is that you have to learn how to program it. The up side is that you have a neat toy leftover that you can use for other things.

formatting link
Or from the Xilinx store.

The raw board doesn't have any serious ESD protection. You might want to get one of their breadboard add-ons so you can easily add it. Or build it yourself. Or ...

--
The suespammers.org mail server is located in California.  So are all my
other mailboxes.  Please do not send unsolicited bulk e-mail or unsolicited
commercial e-mail to my suespammers.org address or any of my other addresses.
These are my opinions, not necessarily my employer\'s.  I hate spam.
Reply to
Hal Murray

Ah, okay. Maybe you could just spit out 1, 2,..,32 ~15 microsecond pulses per 1 msec period on outputs 1..32.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Or use a CoolRunner CPLD; the programming is nonvolatile flash, as opposed to the S3 where they must be reprogrammed every powerup.

Maybe: Start with a cheap xtal osc, program a divide-by-N to get close to 32 KHz. Then a binary divider string gets you 16,8,4,2,1 KHz.

Now divide the clock to get 24 KHz, hence 12,6,3.

Like that. Saves gates. Some of the high-ratio divides can share some stages, too, probably.

John

Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.