Searching \ for '[PIC]: Is this as good as it gets?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Is this as good as it gets?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Is this as good as it gets?'
2002\01\07@131507 by Sean Alcorn - Avion Sydney

flavicon
face
Hi PICers,

I have a project using a PIC16F84A with a 32.768KHz Seiko Watch Crystal.

I am utilising the timer to provide me with an interupt every 500ms

I am doing the folowing;

Calculating time required (from DIP switch array)
Starting timer
Turning an LED On
Waiting for interupt
Turning an LED Off
Wating for interupt

One second has passed (plus a couple of instructions, I guess).

Now do it X times...

Continue program

If variable X is set to 32 768 seconds, I would actually expect slightly
more (given a few GOTO routines etc. X 32768), but I am actually seeing
about 5 seconds less.

I am not worried about it, as 5/32 768 is pretty damn good, but I was just
wondering if I should expect better.

Regards,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@173516 by Jinx

face picon face
With a free-running timer IRQ you should have no latency.
Latency is a delay during which a new value is loaded to
the timer by the user. eg you want an IRQ period shorter
than the full 00 to FF. Roman and Bob Ammerman have
done some work on error-free timing, you can find it in the
archives or at the Piclist site.

With a free-running timer it merely rolls over from FF to 00
and the IRQ period should be consistent and predictable

Using a 32,768Hz crystal -

Internal cycle time = 32768/4 = 8192Hz
Time for TMR0 to roll-over = 8192/256 = 32 IRQs per sec

You can use a pre-scaler to reduce the number of IRQs, eg
pre-scaler=16 (PS0=1, PS1=1, PS2=0) = 2Hz TMR0 IRQ

This is your 500ms

> I am not worried about it, as 5/32.768 is pretty damn good,

5/32.768 is bloody awful !!!! That's 16% error from a crystal that
is ppm stable

> but I was just wondering if I should expect better.

Oh yes, oh yes. I suspect that the problem is not with the timer
but with the routine that does the overall "variable X" timing. How
do you propose to get 0.768s when you have an IRQ that has a
resolution of 0.500s ?

You can count the whole seconds easily enough, but for that last
little bit you'll have to use s/w loops and count instruction cycles

You have fun, y'hear ;-)

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@182338 by Sean Alcorn - Avion Sydney

flavicon
face
on 8/1/02 9:32 AM, Jinx at spam_OUTjoecolquittTakeThisOuTspamCLEAR.NET.NZ wrote:


> 5/32.768 is bloody awful !!!! That's 16% error from a crystal that
> is ppm stable

No. I got 32 763 seconds instead of 32 768. That is not a 16% error. More
like 0.00015258 %
>
>> but I was just wondering if I should expect better.

> Oh yes, oh yes. I suspect that the problem is not with the timer
> but with the routine that does the overall "variable X" timing. How
> do you propose to get 0.768s when you have an IRQ that has a
> resolution of 0.500s ?

No. This is rock solid. I do not know what you mean by 0.768s, sorry.

> You can count the whole seconds easily enough, but for that last
> little bit you'll have to use s/w loops and count instruction cycles

I am only counting whole seconds.

Cheers,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@190732 by Drew Vassallo

picon face
> > 5/32.768 is bloody awful !!!! That's 16% error from a crystal that
> > is ppm stable
>
>No. I got 32 763 seconds instead of 32 768. That is not a 16% error. More
>like 0.00015258 %

Oh my, the math people on this list are cringing as we speak.  Try 0.015%
error.  That is, for every 1000 instruction cycles, you have an additional
15 cycles unaccounted for.  This ain't bad by any stretch, but not perfect,
either.

I can't imagine this making any difference in your application.  But, if you
need something more precise, you're going to have to rewrite your code to
account for EVERY random instruction cycle that might occur, including
interrupt paths, unaccounted-for GOTOs or CALLs, etc.  Isynchronous code
isn't that hard to get, especially in this type of application where you are
doing only one thing at a time.  But, you're going to have to run through
the code pretty much line by line, through every single path, and make sure
each branch has the same number of instructions as every other branch.

Have fun.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@192330 by Sean Alcorn - Avion Sydney

flavicon
face
on 8/1/02 11:07 AM, Drew Vassallo at .....snurpleKILLspamspam@spam@HOTMAIL.COM wrote:



> Oh my, the math people on this list are cringing as we speak.  Try 0.015%
> error.

Yes. I would say the "math people" on this list *would* be cringing. All I
know is that my target time was 32768s second and I got 32763 seconds. When
I went to school, 32763/32768 was 0.99984741211 - That is NOT 16% and it is
NOT 0.015% - it is 0.00015258789 % - I did the math again.

> That is, for every 1000 instruction cycles, you have an additional
> 15 cycles unaccounted for.  This ain't bad by any stretch, but not perfect,
> either.

I don't see that I can have *additional* instruction cycles when my time
came up slightly short! If I had 15 additional instruction cycles for every
1000, then I would have ended up with a time of 33259.52 seconds - would I
not?

Regards,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@195206 by Jinx

face picon face
> No. I got 32 763 seconds instead of 32 768. That is not a 16%
> error. More like 0.00015258 %

But you said

"If variable X is set to 32 768 seconds, I would actually expect
slightly more (given a few GOTO routines etc. X 32768), but I
am actually seeing about 5 seconds less"

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@195616 by Cliff Griffin

flavicon
face
Sean,
You forgot that when converting a decimal number to a percentage, you have
to move the decimal two places to the right. That is 1% = 0.01, so your
number of 0.00015etc actually equal .015%. To prove this to yourself, divide
99 by 100, and you'll get 0.99, which is 99%.

Cliff
(Not cringing TOO bad.)


{Original Message removed}

2002\01\07@200705 by Jinx

face picon face
Previous post went out B4 I'd finished ;-( grrrr

Your punctuation led me (incorrectly) to read that you
were aiming for a target of 32 point 768 seconds. Now
that I look closer, I see that you wrote 32 768, not 32.768,
an error of 0.0153% or 15,260ppm

> If variable X is set to 32 768 seconds, I would actually
> expect slightly more (given a few GOTO routines etc. X
> 32768), but I am actually seeing about 5 seconds less"

A TMR0 IRQ, by its very nature, does not rely on anything
except its own counting. Unless you turn the IRQ off while
you're performing some other task, it will, like dat Ole Man
Ribber, jus' keep rollin' along. You have plenty of time
between IRQs to perform a few asks like incrementing
other counters etc

Have you measured the actual crystal frequency ?

32768 seconds is over 9 hours, and a 5 second deviance
is not totally surprising. Unacceptable, but without verifying
that the crystal is true (and temperature compensated if
possible), you can't point the finger at the s/w. What caps
have you got ? Possibly the crystal is not being correctly
driven, but 15,260ppm is way out of spec

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@203728 by Sean Alcorn - Avion Sydney

flavicon
face
on 8/1/02 12:05 PM, Jinx at joecolquittspamKILLspamCLEAR.NET.NZ wrote:

Hi Jinx,

> Previous post went out B4 I'd finished ;-( grrrr

A premature post?

> Your punctuation led me (incorrectly) to read that you
> were aiming for a target of 32 point 768 seconds. Now
> that I look closer, I see that you wrote 32 768, not 32.768,
> an error of 0.0153% or 15,260ppm

I'm sorry, it must be me. I do not see how the error is 0.0153%

I wanted 32 768 seconds

I got 32 763 seconds

32763/32768 is 0.99984741211 - That is 0.00015258789 %

> Have you measured the actual crystal frequency ?

No not yet. I do not have anything sophisticated enough - yet!!!

> 32768 seconds is over 9 hours, and a 5 second deviance
> is not totally surprising. Unacceptable, but without verifying
> that the crystal is true (and temperature compensated if
> possible), you can't point the finger at the s/w. What caps
> have you got ? Possibly the crystal is not being correctly
> driven, but 15,260ppm is way out of spec

I plan to use 15pF, but all I could get during the silly season was 10pF.
Will that make that much difference?

As I said in my original post, I am NOT that worried about it. I think the
result is acceptable. But if the general concensus on the list is that I
should get better results, I will keep playing with it! :-)

Cheers,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@204528 by Jinx

face picon face
> Hi Jinx,
>
> > Previous post went out B4 I'd finished ;-( grrrr
>
> A premature post?

Oh, don't get me started ;-) I'm supposed to building a deck,
not getting into trouble double-entendre'ing

I've promised ma a new pair of boots if there's enough post-
hole concrete left over he he. "good swimmer" is she ? Ha,
we'll see

> I wanted 32 768 seconds
>
> I got 32 763 seconds
>
> 32763/32768 is 0.99984741211

Yup, that's right. But x100 to get % - 99.9847.  I did it the
other way,  (32768/32763)x100

> I plan to use 15pF, but all I could get during the silly season
> was 10pF. Will that make that much difference?

100pF would be better

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@224937 by Sean Alcorn - Avion Sydney

flavicon
face
on 8/1/02 11:51 AM, Cliff Griffin at .....cliffKILLspamspam.....GRIFFINLAB.COM wrote:

Cliff,

> You forgot that when converting a decimal number to a percentage, you have
> to move the decimal two places to the right. That is 1% = 0.01, so your
> number of 0.00015etc actually equal .015%. To prove this to yourself, divide
> 99 by 100, and you'll get 0.99, which is 99%.

Yes. You are right. I did forget. Hope you will forgive me after an all
nighter! :-)

So I should be expecting better than this, huh?

Regards,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@231156 by Sean Alcorn - Avion Sydney

flavicon
face
on 8/1/02 12:44 PM, Jinx at EraseMEjoecolquittspam_OUTspamTakeThisOuTCLEAR.NET.NZ wrote:y

Hi Jinx,

You are in NZ? I'm about 2 hours and a few days sleep behind you (I assume)
in Sydney. No building decks over here in this heat!

> Yup, that's right. But x100 to get % - 99.9847.  I did it the
> other way,  (32768/32763)x100

Yes. I realise that now. Should have waited till I had a clear head. :-)

> 100pF would be better

Damn! Another trap for young players! I am going to put this into production
using a PIC16C505 and had selected the 15pF based on that data sheet. I am
using the PIC16F84A for development. Your advice to use 100pF made me check
it's data sheet (again) and realise the suggested caps are different -
interesting!

I'm sorry I wasted everybody's time on this. I was just bouncing it off the
list to see if I should expect better. After realising my screwup on the
math *and* the caps, it appears that I should.

I will invest in (or build) a Frequency counter and/or scope and take it
from there.

FYI - The crystals are rated at +/- 20% x 10-6 (10 to the minus 6)

Cheers,

Sean

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\07@232654 by Cliff Griffin

flavicon
face
Most of the crystals in my Digikey catalog have a +/- .005% tolerance.
Yours, if your readings are accurate, are three times worse than that. I
guess it all depends on what you want and need. For many things, it just
wouldn't matter.

Cliff

{Original Message removed}

2002\01\07@233415 by Larry Kayser

flavicon
face
At 08:21 PM 2002/01/07 -0800, Cliff Griffin wrote:
>Most of the crystals in my Digikey catalog have a +/- .005% tolerance.

I have an old 32768 cycle crystal here on an even older RCA COSMAC CDP1802
and it keeps on
trucking along year after year at about 35 seconds fast a year.  Ten or so
years ago I put in a tiny routine to click off 35 seconds every year and
now it goes along at about 1 to 2 seconds a year late.  It has been running
here since about 1976, the current hot shot battery should go for another
10 years or so at least, I hope I last that long......

Larry
VA3LK

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\01\08@023337 by Vasile Surducan

flavicon
face
On Tue, 8 Jan 2002, Sean Alcorn - Avion Sydney wrote:

> on 8/1/02 9:32 AM, Jinx at joecolquittspamspam_OUTCLEAR.NET.NZ wrote:
>
>
> > 5/32.768 is bloody awful !!!! That's 16% error from a crystal that
> > is ppm stable
>
> No. I got 32 763 seconds instead of 32 768. That is not a 16% error. More
> like 0.00015258 %
> >
 you have to check your computer:

 (( 32768 - 32763 ) / 32768) * 100 = 0.015%

 there are problems even using Roman's zero error methode because most
crystals have precision at x.000 MHz, or x.0000 MHz which is not enough.
Most common 32768KHz aren't stable and are cutted at slight different
frequencies. It's hard to find a good ppm crystal running without errors
and without external oven.

regards, Vasile

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@045003 by Jinx

face picon face
> > 100pF would be better
>
>PIC16F84A for development
> it's data sheet (again)

Data sheet recommends 68-100pF for 32k on an F84. I generally
keep stocks of 100pF, and 22pF for everything else. There's a
summary of PICs and clocks here -

www.piclist.com/techref/piclist/jal/microcontrollerclockoptions.htm?k
ey=crystals&from=

I thought David Van Horn  (http://www.dvanhorn.org) had a crystals
page. If it wasn't him, someone around here does/did

> I'm sorry I wasted everybody's time on this. I was just bouncing
> it off the list to see if I should expect better

If you don't ask, you don't get ;-)

> You are in NZ? I'm about 2 hours and a few days sleep
> behind you (I assume) in Sydney.

Cheers for being unselfish and sharing the 2nd-hand smoke.
My ex-brother-in-law dodged staff cuts in the Melbourne
office by transferring recently to .... Sydney he he. 40 degrees,
smoke, thunderstorms, chaos. I'm revelling in Schadenfreude
at his individual predicament (can you tell I'm not his biggest
fan ?)

> No building decks over here in this heat!

Almost a right of passage down this way isn't it ? You aren't
a bloke until you've made a deck for the rellies !!

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@150905 by Peter L. Peres

picon face
Imho you are being bitten by the timer reload problem. Change your code to
count (fast) interrupts and do not set the timer in any way in the ISR
(only read it).

The other option is strong 50 or 60Hz hum leaking into the clock (this has
happened to me with 32kHz crystals - the 30K resistor allows it to happen
easily if there is enough field on the board or on nearby wires (mains)).

hope this helps,

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@150939 by Peter L. Peres

picon face
> on 8/1/02 9:32 AM, Jinx at @spam@joecolquittKILLspamspamCLEAR.NET.NZ wrote:
>
> > 5/32.768 is bloody awful !!!! That's 16% error from a crystal that
> > is ppm stable
>
> No. I got 32 763 seconds instead of 32 768. That is not a 16% error.
> More like 0.00015258 %

Not %:

5/32768 = .000152587890625 (exactly)

which is about 153 ppm and +/- 5Hz at the crystal freq. This is about the
pull limit (using a trim cap only) of a 32kHz watch crystal if it is
overdriven a little bit.

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@150945 by Peter L. Peres

picon face
> 20% x 10e-6

Are you sure it is 20 *percent* ? Because it is usually 20 x 10e-6 which
is 20 ppm which is +/- 0.65536 Hz at 32768Hz and takes a counter with at
least 100 second gate time to make sense of (and those are not common -
try to get one that has a period meter perhaps). Imho build a specialised
counter using a PIC and do NOT probe the osc pins, provide a separate
clock output on a pin instead (even if it is slower and takes longer to
measure).

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@150958 by Peter L. Peres

picon face
> RCA1802 and 32kHz at 35 seconds/year

This is pretty good imho, at 1.1 ppm. Is it at constant temperature etc ?
I understand that it runs on battery only.

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@152403 by dave vanhorn

flavicon
face
At 10:07 PM 1/8/2002 +0200, Peter L. Peres wrote:
> > RCA1802 and 32kHz at 35 seconds/year
>
>This is pretty good imho, at 1.1 ppm. Is it at constant temperature etc ?
>I understand that it runs on battery only.

Digital watches use a large cumbersome oven to maintain constant temperature.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@184225 by Sean Alcorn - Avion Sydney

flavicon
face
on 9/1/02 7:03 AM, Peter L. Peres at KILLspamplpKILLspamspamACTCOM.CO.IL wrote:

Peter,

> Are you sure it is 20 *percent* ?

That is exactly how it is written on the data sheet.

> Imho build a specialised
> counter using a PIC and do NOT probe the osc pins, provide a separate
> clock output on a pin instead (even if it is slower and takes longer to
> measure).

No. It's not that critical. I was happy before I started this thread! :-)
But I have learnt a couple of things that I will try, but other than that,
it will be fine. Thanks to everybody that replied.

Regards,

Sean

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\08@184849 by Sean Alcorn - Avion Sydney

flavicon
face
on 9/1/02 6:15 AM, Peter L. Peres at RemoveMEplpTakeThisOuTspamACTCOM.CO.IL wrote:

Peter,

> Imho you are being bitten by the timer reload problem. Change your code to
> count (fast) interrupts and do not set the timer in any way in the ISR
> (only read it).

Would this give me shorter or longer intervals?

> The other option is strong 50 or 60Hz hum leaking into the clock (this has
> happened to me with 32kHz crystals - the 30K resistor allows it to happen
> easily if there is enough field on the board or on nearby wires (mains)).

This is a possibility. You mean the series resistor on the crystal? What
value should it be - if any at all? Is it necessary to have it?

I am using 32.768 KHz to get *reasonable* accuracy. The Low Power mode is a
bit of a bonus. Am I better off simply using 4.194304 MHz perhaps?

Regards,

Sean

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\09@022848 by Vasile Surducan

flavicon
face
On Tue, 8 Jan 2002, dave vanhorn wrote:

>
> Digital watches use a large cumbersome oven to maintain constant temperature.


But there are other problems in choosing the correct
temperature. Stability depends drastically by temperature,
there are situation with poor stability at constant 60C than not
thermostated ambiance (25C). The way in which was cutted the crystal is
essential.

regards, Vasile

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\09@042844 by Jinx

face picon face
part 1 2338 bytes content-type:text/plain; (decoded 7bit)

> I am using 32.768 KHz to get *reasonable* accuracy. The Low
> Power mode is a bit of a bonus

For my clocks I try to use mains frequency where possible (but
directly connected, not induced) and this circuit for battery back-
up during a power cut or transportation, although it will function
perfectly as a driver in a battery-only system

Take the movement from a cheap kitchen clock and remove
the coil. What you're left with is a timebase PCB that is accurate
to a few seconds per year. The manufacturer has taken care
of the timing/temp issues, nice guy

To the pads where the coil was joined, add these components. It
is a reciprocal driver, ie the output pulse goes high (about 3V)
with respect to the other pad, then the next second it goes negative
wrt to the other pad. If you look at the gearbox of a kitchen clock
and the reciprocating magnet on the seconds cog you'll see why.

The circuit attenuates the -ve going pulse, leaving you with a 0.5Hz
pulse that can be used as an external interrupt. It doesn't matter
which pad you use as the "ground" or "reference", the clock output
is symmetrical. Now, as well as being accurate, this also means
that you can put the PIC to sleep for the vast % of the time. It is
woken for a very short period every 2 seconds by a b0 INT to
update counters etc. End result is good time-keeping at a
miniscule quiescent current. You can't do that with the PIC's
32k crystal as the timer shuts down during sleep (F84). The
F628 has a separate LP timer that runs during sleep, but for
power reasons I prefer to use the very low current external timebase

The rest of the clock is not wasted - you can drive it with a PIC at
5V if you include around 390 ohms in series with the coil. They are
a bit finnicky about the voltage, perhaps you'll need 360R or 430R.
If the second hand labours getting up towards the hour, you'll know
that the R is not quite right. As I said, the gearing is reciprocal, so
connect the coil between two outputs, say b1 and b2. First pulse
is b1 high, b2 low. Next pulse has b1 low, b2 high. Then back to
b1 high, b2 low and so on

Once you have control of the timing, you can make the clock into
a 24-hr one, or even a timer with a settable period. What you can't
do unfortunately is make it run backwards


part 2 2108 bytes content-type:image/gif; (decode)


part 3 131 bytes
--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\09@083955 by Alan B. Pearce

face picon face
>Digital watches use a large cumbersome oven to maintain constant
temperature.

I always understood the oven in this case is known as "persons arm" or
"wearers arm" ;)

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\09@085501 by dave vanhorn

flavicon
face
At 01:27 PM 1/9/2002 +0000, Alan B. Pearce wrote:
> >Digital watches use a large cumbersome oven to maintain constant
>temperature.
>
>I always understood the oven in this case is known as "persons arm" or
>"wearers arm" ;)

Sometimes the oven is cantankerous, too.
:)

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\09@163006 by Peter L. Peres

picon face
> Would this give me shorter or longer intervals?

What would ? If you set the timer and let it run then it will interrupt
and in the interrupt you increment your counter(s). You do not reload the
timer. This gives exact timing. If you reload the timer the prescaler is
zeroed. This throws out a number of ticks every reload, thus the timing
period is shorter than desired. Calculating the precise reload is not so
simple. Bob Ammerman wrote about a method to do this (see archives).

> The other option is strong 50 or 60Hz hum leaking into the clock (this
has
> happened to me with 32kHz crystals - the 30K resistor allows it to
happen
> easily if there is enough field on the board or on nearby wires
(mains)).

> This is a possibility. You mean the series resistor on the crystal? What
> value should it be - if any at all? Is it necessary to have it?

The 32kHz crystals are easily destroyed by overdriving them. At 5V without
a resistor you are almost certainly overdriving it. Once damaged the
crystal continues to work but off frequency by a little. The resistor is
calculated to reduce the amplitude of the signal on the xtal so it is not
overdriven. At 5V and 32kHz tuning fork crystal in LP mode this works out
(for me) to between 18 to 33k. But you need to do your own testing. The
resistor affects startup time.

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...