Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to chose proper clock frequency

Status
Not open for further replies.

masoud23

New Member
Hi
How do one calculate what clock frequency to use av those availble in a pic processor?
What problem do i get if i chose to low or to high clock frequency?

Tanks in advance
 
If your frequency is too high then the PIC will behave erraticly since it is only sensing a transition every few clock pulses. If you are using a crystal that is connected to the PIC then it simply will not change states until it has sensed that the crystal is ready to change states.

It is rare to actually exceed the PICs clock limit since it can work with most comercialy available frequencies. It is up to the designer however to make sure that the frequency is not too high.

Having too low of a frequency can cause problems when it comes to communicating with other devices or when programs need to be executed quickly. I don't know if the PIC has a minimum clock frequency but in most cases, try to stay at or above 32kHz.

The differency between low and high frequency clocks is not only the faster execution time, but also the power that the device consumes. Usually higher frequencies need more power than lower frequencies, but give a better execution time.
 
Ok, Tanks for the answer. I still wonder if there are simple ways or rules for chosing a proper clock frequency? If not can any one suggest i site or reading which explains how to chose proper clock frequency?
 
The "proper" clock frequency all depends on what the designer wants it to be. The only rule is that with most micro-controllers you simply need to program the clock frequency when the chip is programed. Typical frequencies are 32kHz, 1MHz, 4MHz, 10MHz and 40MHz if it can operate that high. In the case of the micro-controller that I am currently using, a 10MHz crystal can be boosted to 40MHz using a PLL.
 
Microchip has excellent datasheets for their microcontrollers and every datasheet has an "Oscillator" section that details the requirements for your clock source.

The clock source and frequency can vary by part so you need to look at the datasheet.
 
Last edited:
Having too low of a frequency can cause problems when it comes to communicating with other devices or when programs need to be executed quickly. I don't know if the PIC has a minimum clock frequency but in most cases, try to stay at or above 32kHz.

PIC's actually work down to DC, there's no lower frequency limit.

Many PIC's have internal oscillators (usually 4MHz) this is a pretty normal frequency to use, if you want faster go higher, if you want less power, then go lower.
 
If you go to very low frequencies, you can get problems with clock transitions that are too slow. For instance if you wanted to run a PIC at 50 or 60 Hz from the mains, you could easily get problems unless you use as suitable Schmitt trigger.

Sometimes the frequency is tweaked to give the correct divide for a standard baud rate. If you want to run communications at 19200 baud, that is a divide of 512 from 9.8304 MHz, but it isn't an exact divide from 10 MHz.
 
The upper limit of your frequency is limited by the chip itself.
The lower limit of your frequency is limited by how much you want the chip to get done in the required timeframe.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top