What crystals for PIC?

Discussion in 'Embedded Systems and Microcontrollers' started by wannaBinventor, May 23, 2010.

  1. wannaBinventor

    Thread Starter Member

    Apr 8, 2010
    179
    4
    I've got some PIC equipment inbound, but I believe I'll need some crystals.

    What Hz should I order?

    I already have some PIC16F84s -- but I'm sure I'll branch out to some others so please consider that when you advise me on crystal choices.
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, many of the newer PICs have internal oscillators that are factory set to have about 1% accuracy. Unless you really need better accuracy, or faster clock speeds than the internal oscillator is able to provide, I'd stick with the internal oscillator; as it will save you a couple of I/O pins and the extra board space.

    Besides, crystals are somewhat fragile. Drop them from a couple of feet on a hard surface and they're toast. Ask me how I know this. :rolleyes:

    You might eventually want to run things at 10MHz or 20MHz. If you're just tinkering right now, don't worry about it too much. Some speeds come in handy for communications with RS-232 - if you still have a computer or devices that support it. Best not to develop anything new for RS232 though; it's going the way of the dinosaur. USB 2.0 or FireWire is much faster.
     
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    You could get some 32.768KHZ ones if you want to do some low power accurate timing work. It divides down nicely into seconds.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    The data sheet will give you this information. Follow the recommendation in the data sheet and you will be safe. Instead of using the old PIC16F84 you should consider newer variants. They cost less and have more onboard functions. Like more timers,SPI, and PWM
     
  5. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    We manufacture gear using various PICs.

    Depending on the speed and accuracy of the specific design, we have used 4MHz, 9.8304MHz, 10MHz and 20MHz quartz crystals, generally in HC49/4 (low height) cans. These need load caps from either end to 0V, we use 20pF for 4MHz, 10pF for 10MHz and 6.8pF for 20MHz.

    We also use three terminal ceramic resonators for 4MHz, 4.91MHz and 10MHz. These have the caps built in, you just ground the middle pin. They are not quite as accurate as crystals, but still good while cheaper & easier to assemble.

    The actual frequency to select depends on the rating of the PIC itself and choice of oscillator configuration.
     
  6. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    The crystals you select should depend on he frequency required for the microcontroller, for the F84's I have seen them rated at 4mhz, to 20Mhz, the newer pic replacements for the F84, which is the Pic16F628A's have built in oscillators, and you can use up to 20 mhz for external....

    B. Morse
     
  7. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    You can also get a programmable osc. This gives you the accuracy and the variability.

    The osc start at a nominal frequency but in the first few instructions in your PIC, you can tell it at which speed to oscillate.
     
  8. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    A microprocessor can draw much more current if it is run at a higher speed, and will get hotter, and can emit more radio frequency interference.

    So for battery powered devices or for generally better design, it's better to run a microprocessor slower, if the project doesn't need higher speed.
     
  9. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
    Actually the replacement for PIC16F84 is PIC16F88 (see this), which has up to 8MHz internal oscillator, and up to 20MHz external.

    That would be this: http://forum.allaboutcircuits.com/showthread.php?t=38616 ;)

    I run ALL my PICs at maximum frequency, I even overclocked from 20MHz to 24MHz, and it did not get even warm !
    I don't know what PICs you have experience with, but I would get worried if it wams up even a little bit...
     
    Last edited: May 26, 2010
  10. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    wow you can google stuff :rolleyes:, but still can't spell warms... unless you are saying your pics have worms :eek:

    B. Morse
     
  11. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
    LOL... Well, English is my second language, my original language does not need spelling... and besides, the spell checker in Firefox did not complain, so I assumed it's correct :D, they should also add "words in context" checker :D

    I edited my post and corrected the "worms" ;)

    Thanks
     
  12. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    Is your first language French??? I hope you didn't take offense to my comment I was just playing around....;)

    B. Morse
     
  13. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    How do you debug a worm infected system:p
     
  14. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
    I'm Romanian... we spell words as we hear them, so "spelling" was a completely new thing for me.

    No, I did not take offense, I laughed at my mistake also :)

    LOL :D

    At least you have a lure to go catch some fish :)

    [edit]
    It's starting to get quite embarrassing now... so I will stop posting for now
     
    Last edited: May 26, 2010
  15. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Yes, fishing is quite alluring. ;)
     
  16. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
    Thanks for not quoting me, and good thing I work besides a Canadian, he had a good laugh when I showed him my post.
     
  17. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    You have to pick at them with your Pickit in debug mode.... lol :D

    B. Morse
     
  18. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    LOL.. I can not believe I didn't think of that. CURSE YOU AND YOUR CREATIVITY BMORSE!
     
Loading...