Crystal frequency for PIC
Electronics Forum Index Electronics
Circuits, theory, electrons and discussions.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ElectronicsHelp.net
Crystal frequency for PIC

 
Post new topic   Reply to topic    Electronics Forum Index -> Basics
Author Message
Jack// ani
Guest





Posted: Wed Feb 09, 2005 10:45 pm    Post subject: Crystal frequency for PIC Reply with quote

Hi all,

I'm confused as how to choose a proper frequency crystal for my PIC
uC like....16f84a,f628,f877 and so on... I have few question and
confusion, here it goes.....

1.Which is better to use, A high frequency crystal(say 10Mhz) or low
frequency(like 4Mhz). Most common one I've seen is 4Mhz, I want are
the considerations as to decide which frequency should be used.

2.I have read that you can crack up your PIC up to 20Mhz. Is that
right? Will this cause overheating and large current drain, similar to
overclocked cpu?

Thanks

Back to top
Neil
Guest





Posted: Wed Feb 09, 2005 11:43 pm    Post subject: Re: Crystal frequency for PIC Reply with quote

"Jack// ani" <nospam4u_jack@yahoo.com> wrote in message
news:1107967506.040574.78580@g14g2000cwa.googlegroups.com...
Quote:
Hi all,
I'm confused as how to choose a proper frequency crystal for my PIC
uC like....16f84a,f628,f877 and so on... I have few question and
confusion, here it goes.....

1.Which is better to use, A high frequency crystal(say 10Mhz) or low
frequency(like 4Mhz). Most common one I've seen is 4Mhz, I want are
the considerations as to decide which frequency should be used.

2.I have read that you can crack up your PIC up to 20Mhz. Is that
right? Will this cause overheating and large current drain, similar to
overclocked cpu?

Tiny tip - I found that the 16F877A I was using had a 4MHz max in xtal mode,
but would go to 20MHz in RC mode.
It did say in the data sheet, but I had to read carefully to find it.
Tried a 10MHz xtal out of curiosity, and it didn't work.
hth
Neil
Back to top
Robert Monsen
Guest





Posted: Thu Feb 10, 2005 12:10 am    Post subject: Re: Crystal frequency for PIC Reply with quote

Jack// ani wrote:
Quote:
Hi all,

I'm confused as how to choose a proper frequency crystal for my PIC
uC like....16f84a,f628,f877 and so on... I have few question and
confusion, here it goes.....

1.Which is better to use, A high frequency crystal(say 10Mhz) or low
frequency(like 4Mhz). Most common one I've seen is 4Mhz, I want are
the considerations as to decide which frequency should be used.


It depends on the application. If you need the speed, go with the higher
frequency. However, see below.

Quote:
2.I have read that you can crack up your PIC up to 20Mhz. Is that
right? Will this cause overheating and large current drain, similar to
overclocked cpu?


Exactly the same thing happens. CMOS, which is what the PIC and you
computer CPU is made out of, requires power only during the logic
transitions (except leakage). Thus, there is a roughly linear relation
between power consumption and speed. That's why desktop CPUs are
requiring better heatsinks and fans as they get faster.

Here is the best tip, though: you should learn to read the datasheet.
They are fairly simple, freely available from microchip, and have
information about this kind of thing, suggested crystal circuits, etc.
Also, they are a good resource for the assembler. Just go to
www.microchip.com and look at the technical information section. If
there are things you don't understand, you can ask them with their
support, or ask here.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.

Back to top
Byron A Jeff
Guest





Posted: Thu Feb 10, 2005 1:24 am    Post subject: Re: Crystal frequency for PIC Reply with quote

In article <1107967506.040574.78580@g14g2000cwa.googlegroups.com>,
Jack// ani <nospam4u_jack@yahoo.com> wrote:
<Hi all,
<
<I'm confused as how to choose a proper frequency crystal for my PIC
<uC like....16f84a,f628,f877 and so on... I have few question and
<confusion, here it goes.....
<
<1.Which is better to use, A high frequency crystal(say 10Mhz) or low
<frequency(like 4Mhz). Most common one I've seen is 4Mhz, I want are
<the considerations as to decide which frequency should be used.

Depends on the application. In general you want the fastest speed that will
allow your application to operate properly, but no more.

<
<2.I have read that you can crack up your PIC up to 20Mhz. Is that
<right? Will this cause overheating and large current drain, similar to
<overclocked cpu?

20 Mhz is possible. Higher current drain of course. However these chips are
rated for 2 Mhz operation. So you're not actually overclocking them.

Now the one last issue to throw in is that many of current PIC chips have
what Michrochip calls nanowatt technology. The most interesting item about
this technology is that each chip has an internal oscillator that goes up to
8 Mhz. So you don't need a crystal at all up to 8 Mhz.

In the 18 pin form factor the 16F88 is the 16F family chip that has this.

I have an overview of the 16F88 here:

http://www.finitesite.com/d3jsys/16F88.html

BAJ
Back to top
Anthony Fremont
Guest





Posted: Thu Feb 10, 2005 2:58 am    Post subject: Re: Crystal frequency for PIC Reply with quote

"Byron A Jeff" <byron@cc.gatech.edu> wrote

Quote:
I have an overview of the 16F88 here:

http://www.finitesite.com/d3jsys/16F88.html

Hey Byron,

You have an error on that page. You specify (incorrectly) that CMCON
and ADCON1 must be initialized to turn off the analog. The 16F88
actually powers up with these two registers ready for digital i/o.
CMCON starts with a value of 0x07 and ADCON1 starts with 0x00.

OTOH, ANSEL must be initialized as (for some ignorant reason) it does
power up with all the ADC pins set as analog.
Back to top
John Fields
Guest





Posted: Thu Feb 10, 2005 3:33 am    Post subject: Re: Crystal frequency for PIC Reply with quote

On 9 Feb 2005 08:45:06 -0800, "Jack// ani" <nospam4u_jack@yahoo.com>
wrote:

Quote:
Hi all,

I'm confused as how to choose a proper frequency crystal for my PIC
uC like....16f84a,f628,f877 and so on... I have few question and
confusion, here it goes.....

1.Which is better to use, A high frequency crystal(say 10Mhz) or low
frequency(like 4Mhz). Most common one I've seen is 4Mhz, I want are
the considerations as to decide which frequency should be used.

---
The clock speed needs to be no faster than that required to accomplish
the verious tasks the µC has to do in the time it needs to accomplish
them. For example, a timer with a granularity of 1µs would require a
clock 1000 times faster than a timer with a granularity of 1ms
executing the same sequence of instructions.
---

Quote:
2.I have read that you can crack up your PIC up to 20Mhz. Is that
right?

---
I don't know.
---

Quote:
Will this cause overheating and large current drain, similar to
overclocked cpu?

---
It will certainly cause more current to be drawn, and the power
dissipation to increase, but whether it would cause overheating is
something you'd have to find out from Microchip if you can't
extrapolate it from the data sheet.

--
John Fields
Back to top
Jack// ani
Guest





Posted: Thu Feb 10, 2005 7:45 pm    Post subject: Re: Crystal frequency for PIC Reply with quote

Thanks for all replies.
Back to top
Byron A Jeff
Guest





Posted: Fri Feb 11, 2005 12:32 am    Post subject: Re: Crystal frequency for PIC Reply with quote

In article <bQuOd.32713$sr1.125@fe2.texas.rr.com>,
Anthony Fremont <spam@anywhere.com> wrote:
<
<"Byron A Jeff" <byron@cc.gatech.edu> wrote
<
<> I have an overview of the 16F88 here:
<>
<> http://www.finitesite.com/d3jsys/16F88.html
<
<Hey Byron,
<
<You have an error on that page. You specify (incorrectly) that CMCON
<and ADCON1 must be initialized to turn off the analog. The 16F88
<actually powers up with these two registers ready for digital i/o.
<CMCON starts with a value of 0x07 and ADCON1 starts with 0x00.
<
<OTOH, ANSEL must be initialized as (for some ignorant reason) it does
<power up with all the ADC pins set as analog.

Thanks for the tip. I edited that page from my 16F628 page and I didn't
update that section. Unfortunately I can't get to it right now.

And nothing about analog powerup is ignorant. Microchip posits, and I believe
correctly so, that you can have a situation where something has an analog
input could come up with a voltage that could cause signicant current drain
if the pin is in digital mode. So they have almost always set up analog/digital
inputs as analog on powerup. It's been like that since the 16C71 days nearly
15 years ago.

BAJ
Back to top
 
Post new topic   Reply to topic    Electronics Forum Index -> Basics All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Home & Living New Topics
Contact Us
Powered by phpBB