Selecting a crystal frequency


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118

    Default Selecting a crystal frequency

    Hi,

    I see that the different crystal frequencies are almost all the same price.
    I have read many threads or specs that suggested the use of a higher crystal frequency to make everything more stable or more accurate.

    Is there any advantage in selecting a 4 MHz over a 20 MHz?
    Shouldn't I just select the highest crystal frequency supported by the PIC I am using?

    Thanks to anyone for clearing this out.

    Mike

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I have read many threads or specs that suggested the use of a higher crystal frequency to make everything more stable or more accurate.
    I am not so sure about that... Not sure that it make a difference in that respect.

    Advantage of a low frequency would be the chip can be ran at a lower voltage. Interfacing with low voltage peripherals and battery supplied gadgets this is handy.

    If you are using software serial and the baud is 9600 or higher you need a faster OSC.

    Different PWM resolutions are scaled with different OSC speeds.

    Timers / interrupts. The OSC speed will/maybe make a difference on how you code.

    So it pretty much depends on the overall project. Just like deciding on any other part.

    Do you have something specific in mind or just a general question?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default

    It was mainly a general question.

    So what makes the difference is power consumption?

    If power is not an issue then I could use the fastest crystal supported by the PIC and it wouldn't cause an issue?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lilimike View Post
    If power is not an issue then I could use the fastest crystal supported by the PIC and it wouldn't cause an issue?
    In general yes.
    A chip running a 4Mhz will have a different resolution for the commands than say a 20MHz:
    COUNT
    PULSIN
    PULSOUT
    PWM
    and maybe others I am not thinking about. So if you need a wider resolution then a slower OSC will be needed.

    But in general, crank it up!!! It does not hurt the chip.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default

    Got it!

    Thank you Dave

    Mike

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts