Cheapest way 2 generate 22Khz clock?

M

Mark

Guest
Could somebody let me know the cheapest way to generate a stable,
reasonably accurate 22Khz, 5V logic level, clock. I'd prefer to use a
3 legged, "off-the-shelf" resonator as the source, if possible.
 
Hi Spehro, Hi Mrk,

You could use a 74HC4060, a couple of resistors and 5 1N4148s along
with an off-the-shelf 16MHz resonator. That would make an oscillator
and a divide-by-728.

Or, if you don't need the divider, use a 74HCU04. This is the unbuffered
version of the 74HC04. The 4060 also has an unbuffered oscillator
section which is great but with the HCU04 you'll get several uncommitted
inverters for other uses.

Regards, Joerg

http://www.analogconsultants.com
 
"Mark" <Mark@> wrote in message
news:jo2sq0d6n5mrkipc6615ge8298l75mrkf9@4ax.com...
Could somebody let me know the cheapest way to generate a stable,
reasonably accurate 22Khz, 5V logic level, clock. I'd prefer to use a
3 legged, "off-the-shelf" resonator as the source, if possible.
What does "stable" and "reasonably accurate" mean in quantitative terms?
The new PIC10F microcontrollers have built in 4MHz +/-1% RC oscillators, so
that translates to a 1us instruction cycle. This means you could make a
21.739kHz clock, or a 22.222kHz clock. If you wanted to get hardcore and
shoot for closer to your 22kHz you could play with tweaking the OSCCAL value
for optimal 22kHz. Over the full temperature and voltage range (2.0V-5.5V)
the intended frequency could be off by as much as +/-5%. These devices cost
less than $0.70 in single unit quantities from Mouser and are available in
SOT-23-6 or DIP8 packages.
 
In article <3b9sq0dja9bn762joiaactgv7mlo3ifau1@4ax.com>,
Spehro Pefhany <speffSNIP@interlogDOTyou.knowwhat> wrote:
On Wed, 01 Dec 2004 19:21:55 +0100, the renowned Mark <Mark@> wrote:

Could somebody let me know the cheapest way to generate a stable,
reasonably accurate 22Khz, 5V logic level, clock. I'd prefer to use a
3 legged, "off-the-shelf" resonator as the source, if possible.

You could use a 74HC4060, a couple of resistors and 5 1N4148s along
with an off-the-shelf 16MHz resonator. That would make an oscillator
and a divide-by-728.
I don't have a 4060 data sheet here, but I think there is a problem or two
with that idea.

The 4060 is a ripple counter. 728 = 512+128+64+16+8 so there are 3 delays
from the oscillator to the first bit of the decoder. You may be already
a cycle late by time the decode happens.

It seems to me that the reset pin of the 4060 effects to oscillator. As I
said I don't have the data book here.

If the OP can stand the error, the 11.0592MHz crystal divided by 512 is
21.6KHz.

Before anyone else says it "use a PIC"

--
--
kensmith@rahul.net forging knowledge
 
"Mark" <Mark@> wrote in message
news:c4rtq0hipuskn1ud5mtlfom5i4mpueuqo4@4ax.com...
On Thu, 2 Dec 2004 04:05:22 +0000 (UTC), kensmith@green.rahul.net (Ken
Smith) wrote:

[deleted]


OK so a PIC seems to rear its ugly head once again (there is already
one in another part of this design) which one should I use and is
there any pre-written code I can use, as my programming skills are in
the beginers stage.
In that case, you might be able to use the existing PIC to generate the 22
kHz.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller
http://www.kasamba.com/viewExpert.asp?conMemID=105725&Catid=1111&banID=2100
 
On Thu, 2 Dec 2004 10:41:40 -0000, "Leon Heller"
<leon_heller@hotmail.com> wrote:

"Mark" <Mark@> wrote in message
news:c4rtq0hipuskn1ud5mtlfom5i4mpueuqo4@4ax.com...
On Thu, 2 Dec 2004 04:05:22 +0000 (UTC), kensmith@green.rahul.net (Ken
Smith) wrote:

[deleted]


OK so a PIC seems to rear its ugly head once again (there is already
one in another part of this design) which one should I use and is
there any pre-written code I can use, as my programming skills are in
the beginers stage.

In that case, you might be able to use the existing PIC to generate the 22
kHz.

Leon
I think that may be too much for my programming skills, so I would
like to use a dedicated PIC on its own, any device/firmware
suggestions please?
 
In message <41af1c4f$0$78279$e4fe514c@news.xs4all.nl>, Frank Bemelman
<f.bemelmanx@xs4all.invalid.nl> writes

But any pic will do. Just pick a pic.
Hi Frank

The new 6 pin types (PIC10Fxxx) can only run from their internal clock
(a great pity for just this type of problem), so if you're planning on
using an existing more accurate clock, an 8 pin PIC is the smallest.
PIC12F629 would be suitable.

Cheers
--
Keith Wootten
 
On Thu, 02 Dec 2004 11:23:23 +0100, Mark <Mark@> wrote:


OK so a PIC seems to rear its ugly head once again (there is already
one in another part of this design) which one should I use and is
there any pre-written code I can use, as my programming skills are in
the beginers stage.
---
Would you _please_ post what you need/want in terms of accuracy and
stability?

--
John Fields
 
On Thu, 02 Dec 2004 14:47:45 +0100, Mark wrote:
On Thu, 02 Dec 2004 13:02:09 GMT, Rich Grise <rich@example.net> wrote:
On Thu, 02 Dec 2004 13:40:34 +0100, Mark wrote:
On Thu, 2 Dec 2004 10:41:40 -0000, "Leon Heller"
"Mark" <Mark@> wrote in message
OK so a PIC seems to rear its ugly head once again (there is already
one in another part of this design) which one should I use and is
there any pre-written code I can use, as my programming skills are in
the beginers stage.

In that case, you might be able to use the existing PIC to generate the
22 kHz.

I think that may be too much for my programming skills, so I would like
to use a dedicated PIC on its own, any device/firmware suggestions
please?

Yeah - learn enough PIC programming to make a 22 KHz clock come out of a
spare pin on the one you already have there.

Good Luck!
Rich

Thanks Rich, most helpful.
Hey, any time! :)

My point is, if you add a pic, you'll have to program it anyway. If you've
already got one, why add more if all you need is one more little loop and
one output pin? It's the same amount of programming, and all the
initialization stuff is already in place. In other words, you still have
to program it, regardless.

If you're going to insist on adding a chip, use a 74HC14, cap, and
resistor and make an oscillator. This will be as accurate and stable as
its components are, and you don't need a programmer or any software
written.

Of course, if somebody's already programmed a PIC for you and it's in the
mail, then this whole discussion becomes moot.

Good Luck!
Rich
 
On Thu, 02 Dec 2004 22:29:26 GMT, Rich Grise <rich@example.net> wrote:

It's written in PicBasic, for heaven's sakes - how time-critical
can it be?

---
There's no way to tell without looking at it.

--
John Fields
 
"Rich Grise" <rich@example.net> schreef in bericht
news:pan.2004.12.02.21.40.10.677612@example.net...
On Thu, 02 Dec 2004 15:55:56 -0600, John Fields wrote:

On Thu, 02 Dec 2004 18:55:52 GMT, Rich Grise <rich@example.net> wrote:

My point is, if you add a pic, you'll have to program it anyway. If
you've already got one, why add more if all you need is one more little
loop and one output pin? It's the same amount of programming, and all
the
initialization stuff is already in place. In other words, you still have
to program it, regardless.

---
The problem with that approach is that the clock divider needs to
function
in real time, so even if there's a free-running internal peripheral
counter in the chip which can generate interrupts, an ISR needs to be
written which will generate the divide-by and output the 22kHz signal.
If
there are other time-critical events which the ľC is supposed to take
care of, then it can easily become a nightmare to try to keep everybody
happy. In either case, it's a little more involved than just writing
"one
more little loop". ---

Well, I'm actually rather an adept programmer, even if it doesn't show all
the time. :) I've already answered Mark's followup, and asked him to post
the code. It's written in PicBasic, for heaven's sakes - how time-critical
can it be?
The question is, how critical is that 22KHz. If there are already
other interrupts, the new 22KHz may show some jitter. The PIC has
a rather simple interrupt system, new interrupts will be pending
if another one is in service.

But it is worth looking into.

[snip]

--
Thanks, Frank.
(remove 'x' and 'invalid' when replying by email)
 
In article <41b0957f$0$13284$626a14ce@news.free.fr>,
Fred Bartoli wrote:

LOL. Makes me wonder. Add a couple ADD or INC instrructions and
you'll have a NOP DDS (neat oddly programmable DDS).
:)

Don't laugh.... It's an easy quick and dirty way of getting
synchronised clocks and/or multiple phases.

--
Tony Williams.
 

Welcome to EDABoard.com

Sponsor

Back
Top