Crystals & Caps - Super noob question??


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2007
    Posts
    67

    Default Crystals & Caps - Super noob question??

    Okay I feel really really humble in asking such a simple question but I've been digging and digging and just can't find a place that really spells it out in super newbie words.

    I'm confused on the whole "cystals, oscilators, system clock and capacitors" thing.

    I'm starting to develop with 16F648A and 16F688 chips (which may or may not be right for my application but the data sheet seemed to show about the specs I need)... anyway....

    1. The data sheets seem to indicate that these both have internal clocks / oscilators / whatever that can be run between 4Mhz and 8Mhz (and lower, but I probably need to run them higher). So the first Q - do I even need any sort of external whatever other than a pull up resistor (on /MCLR - as required by PBP manual, pg 9) and a .1uF noise cap on the power supply? As I'm understanding it, these chips should run just fine at 8mhz just as is.

    2. Will they run "more accurate" with an external crystal or ocsilator? Some threads seemed to indicate timing wasn't quite accurate with the internal stuff. I will need to do some pretty accurate timing for my app, so going with an external may be required.

    3. What, exactly (read: "exactly including part number") do I need for an external "crystal"? I did some searching and found this:

    http://www.ecsxtal.com/store/pdf/hc_49us.pdf

    Is that what I need - is that what's meant by "crystal"? (Again, hanging my head in shame - that's got to be an incredibly silly question).

    4. If I get the above noted Crystal and say, I want to drive my PIC's at 20Mhz, then I just need to purchase the 20Mhz version of this crystal and add it to the circuit as noted in the PBP manual in place of the shown 4mhz crystal? And again if I want to run it at 8Mhz, or 10Mhz - I just get the correct Mhz version of that crystal and plug it in and wallah - the clock now runs at a different speed. Right?

    5. What about those .22pf caps? Is the .22pf a value always used, or does that value change depending on the crystal or the specific PIC used? I saw in a data sheet some place that seemed to say the cap value should change depending on either the PIC used or the type or speed of the crystal. If it does change, where would I find the correct value for whatever PIC / Crystal / Speed combo I end up using?

    6. What about using an "oscillator" - that same company makes an ECS-2100 serries "oscillator" which they say does not require capacitors - looks like the whole thing all in one pacakged unit:

    http://info.hobbyengineering.com/spe...100-Series.pdf

    Again I'm totally new to this whole thing, but does this oscillator work the same way but with fewer components? (I see it costs a bit more, but just trying to understand it here).




    Thank you again in advance. If there are some links to "I just got a PIC in a package and I'm not sure what the little pointy prongs are for - please guide me" sort of tutorials, I would be very thankful to share them. I hate having to ask such simple questions. lol.

    BTW - My proto PICs, my copy of PBP, and my programmer are all in a UPS box right now or I'd just try it out and see. They'll arrive mid week. I'm trying to use the PIC for a simple task that became too complicated for using descrete components - I did some BasicStamp work years ago just for fun but this is my first step back into MCU programming in a very long time - the PBP code looks very straight forward, bravo on that to MELabs - if I can just get started in the right direction, the actual application should be pretty simple.

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


    Did you find this post helpful? Yes | No

    Default

    Simple questions are good. As long as a simple answer is "OK"

    1- The internal oscillators are great for some things. Set it up in the config file *.inc and DEFINE OSC ? at the beginning of the PBP program. If you are using the external MCLR setting then the manual is the way. Some PICs can be set with in internal MCLR, if you do this then you can use that pin as an input and it makes ICSP easier.

    2- External oscillators are more accurate. If you are doing critical timing such as SERIAL communication then external is needed.

    3-4-5- Go with the three pin oscillators ( you are correct, everything in one package ) I use these
    http://www.allelectronics.com/cgi-bi...SONATORS_.html
    If the crystal is used then the correct capacitors have to be used (found in data sheet) and the part count goes up and all of that. The three pin setup will go in place of the of the crystal in the manual with the outside pins connected to OSC1 and OSC2. the middle pin goes to the ZERO rail (ground).

    For good projects with good explanations look at this site. http://www.rentron.com/pic.htm
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    kevj, you didn't mention your general level of electronics knowledge, and it would help us to answer you if you would share that.

    Something I always recommend to anyone is: Get some good, fundamental reference books. They don't have to be expensive. You might find it handy to pick up a used copy of Grob Basic Electronics (Bernard Grob) and perhaps Digital Systems (Ronald J. Tocci). If you'd like a little more "meat" (a lot more, actually), you can't go wrong with The Art of Electronics (Horowitz and Hill), harder to find used, and expensive even then, but worth it.

    Also, it helps if you tell us what your application is--what you are trying to do at any given point.

    All that being said--dive in and have some fun!

    Russ
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  4. #4
    Join Date
    Aug 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave - that's a big help.

    Quote Originally Posted by RussMartin View Post
    kevj, you didn't mention your general level of electronics knowledge, and it would help us to answer you if you would share that.
    I suppose I should have put out some more info.

    I've got a pretty good basic knowledge of DC circuits and use of major components - simple stuff with transistors, caps, and simple IC's (like 555 circuits and such). I've also got a good knowledge of programing - my real pro background is in web coding to interface with database back ends - but I've got little experience programming the "tiny computer" that is the PIC. I get ideas of stuff to rig up all the time and I've always wanted to learn to program MCU's, but was always put off by the assembly knowledge - someone finally pointed me to PBP - I knew I could program a BasicSTAMP using "basic" but never realized I could actually program the much faster, smaller, cheaper PIC's using similar methods.


    So now I'm just trying to clairify how to actually physically wire up the PIC's for proper operation.


    My current application is using timing to read random pulses coming over a radio link. I posted it here:
    http://www.picbasic.co.uk/forum/showthread.php?t=6966

    That's going to require timers and interrupts. We'll take it one step at a time.


    Thanks again for the help and links above - very helpful stuff. I've read the PBP manual cover to cover now and look forward to diving in once my parts arrive this week.

  5. #5
    Join Date
    Nov 2006
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Here you can find some very useful information about oscillators: http://techtrain.microchip.com/x14/osc/

Similar Threads

  1. Replies: 2
    Last Post: - 7th March 2008, 02:16

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