Searching \ for '[PIC]: External clock...' 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/time.htm?key=clock
Search entire site for: 'External clock...'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: External clock...'
2002\05\17@022955 by Pic Dude

flavicon
face
Somehow my clock ckt seems to be running a lot slower than it should, but
I'm stumped.  Here are some details...

Swapped 32.768 khz crystal/caps for a 1.544 MHz external oscillator, into
an 16F872 circuit.  This is an ECS-200 series oscillator in a 14-pin metal
pkg, but only has 4 pins, and only 3 of those are active -- +ve, gnd, and
out
(which I connected to OSC1/CLKIN).  OSC2/CLKOUT is now open.

Pre-scaler is now 1:8 and ISR routine divides a few times:  first by 193,
then by 25, then by 10, to give me 1-sec pulses.  (There's a reason for
those divisors in case you're wondering -- I can get 0.1 sec pulses I need
for something else).

However, it's running MUCH slower than that -- taking a few minutes to
generate a 1-sec pulse!

Am I missing something here?  I've left the osc config bits to LP, and
verified the ext osc freq with an oscilloscope.  Also, there's a setting in
OPTION_REG for selecting the source clock for TMR0 to internal or
T0CKI, but I don't think this setting has anything to do with this prob.

Any ideas why I may be seeing these results?

Cheers,
-Neil.

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


2002\05\17@074731 by Olin Lathrop

face picon face
> Swapped 32.768 khz crystal/caps for a 1.544 MHz external oscillator, into
> an 16F872 circuit.  This is an ECS-200 series oscillator in a 14-pin metal
> pkg, but only has 4 pins, and only 3 of those are active -- +ve, gnd, and
> out
> (which I connected to OSC1/CLKIN).  OSC2/CLKOUT is now open.
>
> Pre-scaler is now 1:8 and ISR routine divides a few times:  first by 193,
> then by 25, then by 10, to give me 1-sec pulses.  (There's a reason for
> those divisors in case you're wondering -- I can get 0.1 sec pulses I need
> for something else).
>
> However, it's running MUCH slower than that -- taking a few minutes to
> generate a 1-sec pulse!

Watchdog issues?  Does the algorithm do what you expect when you emulate or
simulate it?

> Am I missing something here?  I've left the osc config bits to LP,

You should be using XT at 1.5MHz.

> and
> verified the ext osc freq with an oscilloscope.  Also, there's a setting
in
> OPTION_REG for selecting the source clock for TMR0 to internal or
> T0CKI, but I don't think this setting has anything to do with this prob.

That depends on whether you are using timer 0 in your divider chain.  Also
note that when the timers are driven internally, they are driven from the
instruction clock, not the oscillator frequency.  The instruction clock is
the oscillator/4.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\05\17@120025 by Pic Dude

flavicon
face
Watchdog is disabled.  Prescaler is assigned to TMR0.

Not emulating/simulating, but it worked well with the 32.768
KHZ xtal.  Only real change to this was the prescaler going
from 1:32 to 1:8.

Why XT with an external clock?  The datasheet has not
specifically stated this, and indicates that LP is fine for
1.544Mhz (DS30221B, page 89).  Not disputing, but asking for
more info as to why XT.  BTW, tried XT and that did not solve
the problem.

Yep, I know about the TMR clock being osc/4.  See my other
post from a couple mins ago with the code sections relevant
to this if you want more context.

Thanks,
-Neil.




{Original Message removed}

2002\05\18@081614 by Olin Lathrop

face picon face
> Why XT with an external clock?  The datasheet has not
> specifically stated this, and indicates that LP is fine for
> 1.544Mhz (DS30221B, page 89).  Not disputing, but asking for
> more info as to why XT.  BTW, tried XT and that did not solve
> the problem.

Too bad you didn't indicate what section you found this spec in on page 89.
I am using "PIC16F87x Data Sheet", DS30292C, which I think is the latest
that covers the 16F872 you are using.  See Table 15-1 "External Clock Timing
Requirements" on page 162.  The maximum external CLKIN frequency is shown as
200KHz for LP mode, and 4MHz for XT mode.

I am curious what you saw that contradicts this.  Can you find the same
reference in DS30292C or anything that supercedes it?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
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\05\18@113403 by Pic Dude

flavicon
face
Always assumed (yes, assumed) that the 16F872 was diff
from the 16F873+, so they had a separate datasheet for
it.  Microchip's website gave me the 16F872-specific
datasheet under that 16F872 doc portfolio.  Never looked
at the 16F87x datasheet, since I've never used any of
the bigger chips.

Not disagreeing with you, just questioning where you found
this info.  I think I was looking at section 11.x (the one
on oscillator modes).  There was nothing that stated that LP
is good to a certain max freq, but nothing that stated that
it is not.  And there was a diagram that showed external
clock usage in LP and other modes.  So there are some
implications I was basing this on.  Don't remember seeing
the table you mention, but I'll go look for it after my
backups are done.

However I did switch to XT and it works the same.

Thanks,
-Neil.



{Original Message removed}

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